1 Reply Latest reply on Oct 31, 2007 11:34 AM by Pete Muir

    Hibernate session in stateful bean?

    Marcus Schmidke Newbie

      Hello all,

      today I'm wondering about a really simple question:

      I have a stateful session bean with @Name and Application-@Scope.

      May I have a @PersistenceContext Hibernate session in this class?

      What happens to such a Hibernate session? Will it be open all the time?

      Of course, it is not desired to have it open all the time, but when I wrote the code, I simply didn't think about this question. Today I accidentally had a look at this code and was wondering what will happen ...

      The SFSB prepares and caches some lists of entities which make up the configuration of the application.

      Which is the right way to do this?


      Marcus.