Hi,
i have a strange problem in my hibernate application. It is a web application but i don't think that this does matter
according to my problem.
The problem ist that getCurrentSession() of the SessionFactory returns different Session objects although i am
within the same thread and use ThreadLocalSessionContext. Here some debug output:
Code:
28 getSessionFactory 989823897
28 getSessionFactory 989823897
28 filter start: 510975463
28 getSessionFactory 989823897
28 getSessionFactory 989823897
28 before site action: 510975463
28 site action start: 759932786
28 site action end: 759932786
28 getSessionFactory 989823897
28 getSessionFactory 989823897
28 after site action: 510975463
28 getSessionFactory 989823897
28 getSessionFactory 989823897
28 filter end: 510975463
The first figure is the thread id and as you can see i am within the same thread all the time. The figure
following "getSessionFactory" is the hash code of the session factory that is (as expected) always the same.
The other figures are the hash codes fo the returned Session objects. At some point in my program i
get a different Session object from the same SessionFactory although still being in the same thread. This point is
nothing special... just a simple method call. After returning from this method i get back my "old" Session
object.
I don't know how this can happen... has anybody of you any clue? Thanks a lot!
Yours
Thomas