• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to perform locking on entity bean?

 
Lu Samm
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I just met one problem while using CMP1.1 to perform update action. while one thread perform setXXX() on a specific entity bean and the transaction is not commit yet, another thread can also update the entity bean. I'd like to implement that while the entity bean is updating by one transaction, other request trying to update it will not be handle until the transaction complete. How to do that? I set up the transaction isolation level as READ COMMITED (my application server doesn't suppport REPEATABLE READ).
Many thanks!
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All of this is actually handled at the database level, often with a "Select...for update" statement. It may depend on your application server as to what you can do about it. For instance this article describes the combination of Isolation Level and special IBM EJB settings to accomplish this in WebSphere 4.0. this article describes the same feature for JBoss. This page shows how to set it up in WebLogic 7.0.
Kyle
 
Lu Samm
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kyle! I will take time to read articals you provided.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!