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?