Bookmark Topic Watch Topic
  • New Topic

Entity bean database access  RSS feed

 
shawn kennedy
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Report post to moderator
I would like to know whether 2 entity bean instances can access the same database data instance at the same time.If yes,how would it not create a data corruption problem if both try to update data at same time.If not,why is it so i am confused on this issue pls help
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Report post to moderator
Yes, they can access the same physical row in the database table. The question is, what is the mode of access? Are they trying to read or write data? The answer mainly depends on the mode of access and this thing called transaction isolation level - see the ejbjar.xml definition. Using this level, you control the effects of truly concurrent access.
Let's not forget database level record locking provided by most vendors that helps to further alleviate this problem.
Cheers,
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please see this discussion that is already well underway. I encourage you to ask your questions under that thread.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!