Description:
I have the following error with resin 2.1.12 servlet container when the max-active-time field in the JDBC pool is set to 60 sec and the connection get closed :
Java stack information for the threads listed above:
===================================================
"tcpConnection-6802-293":
at com.mysql.jdbc.ResultSet.close(ResultSet.java:736)
- waiting to lock <0x57aaf308> (a com.mysql.jdbc.ResultSet)
at com.mysql.jdbc.Statement.realClose(Statement.java:1606)
- locked <0x57aaeb30> (a com.mysql.jdbc.Connection)
- locked <0x57aaf398> (a com.mysql.jdbc.Statement)
at com.mysql.jdbc.Connection.closeAllOpenStatements(Connection.java:2126)
at com.mysql.jdbc.Connection.realClose(Connection.java:4422)
at com.mysql.jdbc.Connection.close(Connection.java:2098)
- locked <0x57aaeb30> (a com.mysql.jdbc.Connection)
at com.phonevalley.smsV3.plugin.dedicace.technique.PropertiesDAO.getByCustomerId(PropertiesDAO.java:70)
at com.phonevalley.smsV3.plugin.dedicace.domain.Properties.findProperties(Properties.java:85)
at _smsV3._jeux._dedicace._left__jsp._jspService(_left__jsp.java:105)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.subservice(Page.java:506)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
at com.caucho.server.http.Invocation.service(Invocation.java:315)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:534)
"Thread-1703":
at com.mysql.jdbc.Connection.getCharsetConverter(Connection.java:3177)
- waiting to lock <0x57aaeb30> (a com.mysql.jdbc.Connection)
at com.mysql.jdbc.Field.getStringFromBytes(Field.java:583)
at com.mysql.jdbc.Field.getName(Field.java:487)
at com.mysql.jdbc.ResultSet.buildIndexMapping(ResultSet.java:593)
at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:926)
- locked <0x57aaf308> (a com.mysql.jdbc.ResultSet)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:5015)
at com.phonevalley.smsV3.plugin.admin.technique.WordingShortNumberDAO.get(WordingShortNumberDAO.java:111)
at com.phonevalley.smsV3.plugin.admin.technique.ShortNumberDAO.getAllShortNumber(ShortNumberDAO.java:123)
at com.phonevalley.smsV3.plugin.admin.technique.ShortNumberDAO.getByShortNumberVal(ShortNumberDAO.java:171)
at com.phonevalley.smsV3.plugin.admin.domain.ShortNumber.findByValue(ShortNumber.java:180)
at com.phonevalley.smsV3.plugin.winOption.service.ShortNumberFinder.getShortNumberTaxeByValue(ShortNumberFinder.java:71)
at com.phonevalley.smsV3.plugin.winOption.domain.WinOption.alimMap(WinOption.java:133)
at com.phonevalley.smsV3.plugin.winOption.domain.WinOption.winOption(WinOption.java:56)
at com.phonevalley.smsV3.classes.ManageMO.getKeyWords(ManageMO.java:590)
at com.phonevalley.smsV3.classes.ManageMO.getInfos(ManageMO.java:754)
at com.phonevalley.smsV3.classes.ManageMO.handleMO(ManageMO.java:129)
at com.phonevalley.smsV3.envoi.drivers.connexionoperators.accuse.AccuseHttpMo$ProcessThread.run(AccuseHttpMo.java:170)
at com.phonevalley.smsV3.outils.threadpool.WorkerThread.run(WorkerThread.java:30)
Found 1 deadlock.
This error locks the pool. I have changed the max-active-time field to 300 sec. The deadlock occurs less but still happens. This version of MySQL normally fixes this problem of synchronisation of multiple thread that use the same connection but I'm not sure it is totally fixed. Do you have some feedback ?
Regards
Arnaud de La Sudrie
How to repeat:
install resin 2.1.12 and set the max-active-time to 2 secondes. Do queries with a connection in a thead and leave the JDBC pool close the connection when the max-active-time is reached.