jim
Nov 14th, 2005, 04:41 PM
Hi,
I was wondering what the best method of caching the hibernateSessionFactory in the business layer is.
I am using SLSB, business pojo (extends AbstractStatelessSessionBean), DAO, Hibernate. Before attempting to introduce a layered architecture, I was storing the hibernateSessionFactory in a static SLSB member variable which renders the state cached - if I understand the SLSB behaviour correctly.
Question is now, can I do the same with the bizpojo interface and declare it as a static variable.
Anyone have any idea what the overhead would be like for a few hundred hits per minute max on a jndi-lookup for the hibernateSessionFactory taking place for every request?
The reason I ask is that I am not sure that the hibernateSessionFactory which is defined in my applicationContext.xml will be cached otherwise.
Any help is much appreciated.
Jim
I was wondering what the best method of caching the hibernateSessionFactory in the business layer is.
I am using SLSB, business pojo (extends AbstractStatelessSessionBean), DAO, Hibernate. Before attempting to introduce a layered architecture, I was storing the hibernateSessionFactory in a static SLSB member variable which renders the state cached - if I understand the SLSB behaviour correctly.
Question is now, can I do the same with the bizpojo interface and declare it as a static variable.
Anyone have any idea what the overhead would be like for a few hundred hits per minute max on a jndi-lookup for the hibernateSessionFactory taking place for every request?
The reason I ask is that I am not sure that the hibernateSessionFactory which is defined in my applicationContext.xml will be cached otherwise.
Any help is much appreciated.
Jim