Hibernate 1-to-many deadlock
Frequent deadlocks in spring + hibernate + Struts + SQL databases. The query is deadlocked after update is executed.
It's dead. You have to stop tomcat to continue running.
Solution: use the database connection pool c3p0
<Bean id = "datasource" class = "com. mchange. v2.c3p0. combopooleddatasource" Destroy-method = "close">
<Property name = "driverclass" value = "com. Microsoft. JDBC. sqlserver. sqlserverdriver"/>
<Property name = "jdbcurl" value = "JDBC: Microsoft: sqlserver: // localhost: 1433; databasename = bookshop"/>
<! --
<Property name = "user" value = "$ {dB. User}"/>
<Property name = "password" value = "$ {dB. Pass}"/>
-->
<Property name = "properties">
<Props>
<! -- The number of connections that c3p0 obtains at the same time when connections in the connection pool are exhausted. Default: 3 -->
<Prop key = "c3p0. acquire_increment"> 5 </prop>
<! -- Check all idle connections in the connection pool every 60 seconds. Default: 0 -->
<Prop key = "c3p0. idle_test_period"> 60 </prop>
<Prop key = "c3p0. max_size"> 15 </prop>
<Prop key = "c3p0. max_statements"> 0 </prop>
<Prop key = "c3p0. min_size"> 10 </prop>
<Prop key = "user"> SA </prop>
<Prop key = "password"> SA </prop>
</Props>
</Property>
</Bean>