| Author |
Detach Before Transaction Completes
|
Josh Britton
Greenhorn
Joined: Nov 26, 2008
Posts: 24
|
|
First, I'm really not sure what the best forum is for this question, so I apologize in advance if this is the wrong place. My situation: I use Hibernate with EJB3, and I use the default transaction behavior. So my transactions last for my whole methods. However, sometimes I want to 'detach' a persistent object before a method completes. There have been several occasions where this seemed useful. Today it's because I get an object using LockMode_UPGRADE at the beginning of a method, then make a small change to the object, then perform the rest of a long method. I no longer need a lock on the object's row during the rest of the method, but I don't know how to release the lock except when the container automatically completes the transaction. Any ideas? Thanks, Josh
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26195
|
|
Josh, Welcome to JavaRanch! Both Hibernate and EJB 3 are ORM frameworks. So I'll move this to our ORM forum for you.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: Detach Before Transaction Completes
|
|
|