This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Entity bean Synchronization problem  RSS feed

 
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?
 
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.
 
author
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
 
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!