Announcement Announcement Module
Collapse
No announcement yet.
"re-using" entities accross session Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "re-using" entities accross session

    I have a "User" entity which I persist using hibernate. It is an essential entity, with many associations to others, and I use them all the time. A "User" object is always bound to the session at login.

    Sadly, for the time being, everytime I want to use the "User" in a Service method I have to get that entity back from the store in that service method's body. That's because the owning session of the user has been closed in the previous call.

    Is there a way to simply "re-awake" an entity's session so it becomes useable again ?

    bernard

  • #2
    You may want to look at the Spring OpenSessionInViewInterceptor class, as well as maybe enabling the 2nd level cache, e.g. EHCache.

    Comment

    Working...
    X