[opencms-dev] Resolution to deadlocks in getting JDBC connections?

Alexander Kandzior alex at opencms.org
Wed Jan 28 09:26:02 CET 2004


James,

sorry I have no direct solution. The failure is apparently in the 5.0
db-pooling implementation. 

What I can say is that we have replaced the "homegrown" db-pool
implementation in OpenCms 5.0 with the DBCP commons package from Apache
Jarkata in the 5.3.x version available in CVS HEAD. Hopefully this fixes the
issue for future versions. Unfortunatly backporting is not an easy option
since the DB layer as a whole has undergone some larger changes. 

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com

> -----Original Message-----
> From: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] On Behalf Of James George
> Sent: Wednesday, January 28, 2004 1:23 AM
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] Resolution to deadlocks in getting 
> JDBC connections?
> 
> 
> Hi all,
> 
> OpenCMS 5.0.0
> 9iAS/OC4J 9.0.3.1
> Oracle RDBMS 8.1.7.4
> all on HPUX
> 
> I'm assisting in trouble shooting an OpenCMS implementation 
> on an Oracle 
> 9iAS application server and we are seeing deadlocks occurring between 
> the genericsql thread using java.sql.DriverManager.getDrivers() and 
> ApplicationServerThread-X using 
> com.opencms.dbpool.CmsPool.getConnection() (see below for 
> excerpts from 
> thread traces).
> 
> I've searched the mailing list archives and found references to this 
> issue, but couldn't find any reference to a fix or suitable 
> workaround. 
>   Do any exist?  I checked the history for 5.0.1, but there was no 
> reference to this issue.
> 
> At the moment this is causing intermittent failures in a production 
> system, so if there are any pointers or suggestions (other than a 
> nightly restart) anyone can make to help us mitigate this issue, it 
> would be greatly appreciated.
> 
> Thanks in advance!
> 
> James
> 
> Deadlocked threads:
> 
> Found one Java-level deadlock:
> =============================
> "ApplicationServerThread-25":
>    waiting to lock monitor 0x18a73c (object 0x4f314438, a 
> java.util.Stack),
>    which is held by "genericsql"
> "genericsql":
>    waiting to lock monitor 0x18a7b0 (object 0x49e07240, a 
> java.lang.Class),
>    which is held by "ApplicationServerThread-25"
> 
> Java stack information for the threads listed above: 
> ===================================================
> "ApplicationServerThread-25":
>      at com.opencms.dbpool.CmsPool.getConnection(CmsPool.java:217)
>      - waiting to lock <0x4f314438> (a java.util.Stack)
>      at com.opencms.dbpool.CmsPool.connect(CmsPool.java:206)
>      at com.opencms.dbpool.CmsDriver.connect(CmsDriver.java:107)
>      at java.sql.DriverManager.getConnection(DriverManager.java:512)
>      - locked <0x49e07240> (a java.lang.Class)
>      at java.sql.DriverManager.getConnection(DriverManager.java:193)
>      - locked <0x49e07240> (a java.lang.Class)
>      at 
> com.opencms.file.genericSql.CmsDbAccess.readUser(CmsDbAccess.j
> ava:10136)
>      at 
> com.opencms.file.genericSql.CmsResourceBroker.readUser(CmsReso
> urceBroker.java:6478)
>      at 
> com.opencms.file.CmsRequestContext.init(CmsRequestContext.java:172)
>      at com.opencms.file.CmsObject.init(CmsObject.java:2200)
>      at com.opencms.core.OpenCms.initUser(OpenCms.java:896)
>      at 
> com.opencms.core.OpenCmsHttpServlet.initUser(OpenCmsHttpServle
> t.java:473)
>      at 
> com.opencms.core.OpenCmsHttpServlet.doGet(OpenCmsHttpServlet.java:304)
>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>      at 
> com.evermind.server.http.ResourceFilterChain.doFilter(Resource
> FilterChain.java:65)
>      at 
> oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
>      at 
> com.evermind.server.http.ServletRequestDispatcher.invoke(Servl
> etRequestDispatcher.java:566)
>      at 
> com.evermind.server.http.ServletRequestDispatcher.forwardInter
> nal(ServletRequestDispatcher.java:306)
>      at 
> com.evermind.server.http.HttpRequestHandler.processRequest(Htt
> pRequestHandler.java:767)
>      at 
> com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandl
> er.java:166)
>      at 
> com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandl
> er.java:72)
>      at 
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Poo
> ledExecutor.java:803)
>      at java.lang.Thread.run(Thread.java:536)
> "genericsql":
>      at java.sql.DriverManager.getDrivers(DriverManager.java:321)
>      - waiting to lock <0x49e07240> (a java.lang.Class)
>      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:317)
>      at com.opencms.dbpool.CmsPool.createConnection(CmsPool.java:338)
>      at com.opencms.dbpool.CmsPool.createConnections(CmsPool.java:320)
>      at com.opencms.dbpool.CmsPool.run(CmsPool.java:188)
>      - locked <0x4f314438> (a java.util.Stack)
> 
> Found 1 deadlock.
> 
> -- 
> -----------------------------------------------
> James George - Consultant
> Oracle Corporation          Ph:  +61 8 94267200
> Perth, Western Australia    Fax: +61 8 93215175
> 
> "I like nonsense; it wakes up the brain cells."
> - Dr. Seuss
> -----------------------------------------------
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 




More information about the opencms-dev mailing list