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?
It will follow the standard rules of a non-extended persistence context in JPA. It will be scoped to the length of the transaciton.