1. I can't find "since Hibernate 3.0.1 OpenSessionInView is built-in without having to use Spring..." . What do I need to do special to use this built-in feature?
2. In our Struts->EJB->Hibernate application, we have mutltiple Hibernate session open/close calls made before the requested page is returned to the user. If I understand this correctly using 'OpenSessionInView' pattern the hibernate session would be opened & closed only once. Can anyone comment on performance, memory consumption, server load, connection limitations, connection pool sizes, etc. This would be used to justify this big code modification which would probably involve stripping out all those getCurrentSession() and closeSession() calls in the Data access layer (Dal) classes.
3. Our current hibernate.properties file has the following 'Transaction API' section. What needs to be turned ON or OFF in this file to be able to use the OpenSessionInView pattern?
#######################
### Transaction API ###
#######################
## Enable automatic flush during the JTA beforeCompletion() callback
## (This setting is relevant with or without the Transaction API)
#hibernate.transaction.flush_before_completion
## Enable automatic session close at the end of transaction
## (This setting is relevant with or without the Transaction API)
#hibernate.transaction.auto_close_session
## the Transaction API abstracts application code from the underlying JTA or JDBC transactions
hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
#hibernate.transaction.factory_class net.sf.hibernate.transaction.JDBCTransactionFactory
## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI
## default is java:comp/UserTransaction
## you do NOT need this setting if you specify hibernate.transaction.manager_lookup_class
#jta.UserTransaction jta/usertransaction
#jta.UserTransaction javax.transaction.UserTransaction
#jta.UserTransaction UserTransaction
#jta.UserTransaction java:/UserTransaction
## to use JCS caching with JTA, Hibernate must be able to obtain the JTA TransactionManager
hibernate.transaction.manager_lookup_class org.hibernate.transaction.JBossTransactionManagerLookup
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.WeblogicTransactionManagerLookup
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereTransactionManagerLookup
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.OrionTransactionManagerLookup
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.ResinTransactionManagerLookup
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: