Am I correct in thinking there is no API that will tell me whether an object is in a detached state or not? I'm trying to determine whether or not it is "safe" to call lock on an object given that it might be associated with a suspended transaction/session further down the call stack. (I'm using Spring for transaction management.)
If there is no API, does anyone have a suggestion on how to handle this? I guess I could use Interceptor to maintain a list of all objects associated with any open sessions, but I'm hoping there is an easier way.
Thanks.
|