david wrote:
The error is indication that the operation was not under the influence of a transaction. Also, once an exception is throw the session should not be used any longer as it can be in an invalid state. Alternatively, call sess.evict() which clears that cache.
See, that's the wierd part - the claimed area it was running in wasn't in fact where the thread was. I steppped through with a debugger and got al the way to the .close() call. When I stepped over that, (very, very far away from the code identified in the root of the exception), this was the stack trace that came out.
After the transaction was comitted (which it did without error) there are no other references to the session (other than closing it) or the transaction.
Also, after that exception is thrown, there are no other references to the session (even if the close() didn't throw an exception, there would be no additional references to that session.
I don't understand how the exception can identify a section of code that only executes once in the program and even then, execute long before this method (hubreds and hunreds of lines earlier). It's not like this is multi-threaded (confirmed - there are no other threads -- just the main thread -- wehen the exception happens).
I wonder if this is possible a hibernate/c3p0 problems - I am using hiber 2.1beta4.