Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity bean Synchronization problem  RSS feed

 
sam he
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I wonder that when we insert a row to database through entitybean and we delete the row by other system, how entitybean keep the the synchronization with the datatbase? Does appserver delete the entitybean? If not so, when we get the data through the entitybean, we will get the data out of season.
I have tesed the point with BMP.I inserted rows to database through entitybean and deleted them through sqlplus.Then i inserted the same rows into the database through entitybean again,i got the result that the rows will insert into the database again on weblogic,but there will be a exception showing the entity bean already exist on jboss. Does this is relative to the concurrent strage of appserver?
 
Maximilian Trenks
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as for my understanding the bean only updates the database state when ejbLoad() and ejbStore() is called. although i cant be of any help i fear, since i know weblogic and dont have any experience with jboss. maybe the bean was still existent in the intern cache of jboss, but that is only a guess. but i also would be quite interested to know why and how this happens.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no magic in any application server. Synchronization is always through the database as max hinted above. That is why with the most common bean caching option (Option C) a bean has a lifetime for the length of the EJB transaction -- this means that access can be serialized through the database via database locking.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!