• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

EJB Persistence problem [data modifed outside EJB container]

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic