Im working on a Web project, I use Hibernate
and Spring
to manage transactions and access to my MySQL database. I have a problem really bizzar, I execute a query selection in a session created by Spring.
SessionFactoryUtils.getSession(sessionFactory, allowCreate);
The query is executed several times without problem, but from the 5th call the application crashes completely and I have received nothing like an exception. I tried to run the application in debug mode, and I found that all crashes at the statement level Query.list (
).
I did the same thing using Programmatic transaction management with TransactionTemplate
and everything is Ok.
Thanks in advance.
I had a hibernate configuration problem in pool connection size. I add this property <prop key="hibernate.connection.release_mode">after_transaction</prop>
to free the connection pool after a transaction.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.