Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Persistence problem [data modifed outside EJB container]  RSS feed

 
Gurminder Singh Oberai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi forum,

i am using two systems running jboss3.2.5 with two diferent applications namely "admin" and "student" running on them with a common database.

in both the applications i am using BMP entity beans,now the problem is that when one entity bean modifies some data in the database then that modification is not reflected on the other entity bean because both are using different containers.

could nany one please suggest any solution to this issue.

Thanks
[ September 14, 2006: Message edited by: Gurminder Singh Oberai ]
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ejbLoad should be called on each BMP at the start of the transaction, which allows each bean to load in the "current" data. Your only problem would be when the transactions overlap. In that case you'd have to change the isolation level of the connection so that it will lock the rows you're interested in until the completion of the transaction (at which point the second BMP would proceed as usual).
 
Gurminder Singh Oberai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply

according to ejb specifications ejbLoad() should be called every time a transaction is executed but in jboss3.2.5 what i am using, the ejbStore() method is executed before the ejbLoad() method.

because of ejbStore() executing before ejbLoad() data modified by one entity bean is is changed back to the data which is already cached by second entity bean because both beans reside on different containers and both are un aware of any changes made to the database..
[ September 14, 2006: Message edited by: Gurminder Singh Oberai ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!