See
this thread, for example, as the most likely cause.
"it was because a session close statement was missing from the finally block and so whenever we had an exception, the session was not closed and and became reusable for an incoming transaction. Thus this session was at times available to 2 different threads leading to above inconsistent behavior. "
There can be other causes for this exception, but this is the most likely.