I managed to find out what was going on.
What I did was download the hibernate source. Stopped at the exception ponit with the debugger and found out which instance was causing the problem. As it turned out it was a vairable which existed in a super process which I have not taken care of.
Now everything is all right.
So.... Remember that usually the problem is with your variables, and they can exist in a super process too.