[opencms-dev] OpenCMS v5 and Oracle Deadlock

Denham, Martin Martin.Denham at edfenergy.com
Tue Mar 15 11:14:46 CET 2005


Hi Ian,

We have been struggling with Oracle too.  Are you still happy with your fixed code after thorough testing?  Were there any other changes you had to make?

thanks

Martin

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]On Behalf Of ian snead
Sent: 16 February 2005 18:21
To: opencms-dev at opencms.org
Subject: [opencms-dev] OpenCMS v5 and Oracle Deadlock


Hello all,

We have been hitting the reported deadlock condition discussed in the past.

I realize this will be fixed in the upcomming v6, but in the meantime...

I've been doing some reading into the data layer, and I wanted to suggest a
patch. Is there any reason not to do the following ?

In com.opencms.dbpool.CmsPool, 

    + Remove all the .notify() calls to the stack.
    + Synchronize on DriverManager.class instead of the stack.

It looks like the race condition is between the stack and the driver manager
class instance monitors, would this solve it?

I've done this, and things look just fine on my machine. Have not subjected
the server to a load test yet. 

If anything jumps out at you about this, I'd love the feedback!!!

Thanks,

Ian Snead
Applications Analyst
Georgia State Department of Audits and Accounts, IT Division


Here is a pertinant stack dump from kill -3 on Tomcat :

"http-8443-Processor15":
	at com.opencms.dbpool.CmsPool.getConnection(CmsPool.java:217)
	- waiting to lock <0x392d0d10> (a java.util.Stack)  <---------- stack
of connections
	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 <0xaf87b628> (a java.lang.Class)
	at java.sql.DriverManager.getConnection(DriverManager.java:193)
	- locked <0xaf87b628> (a java.lang.Class)
	at com.opencms.file.genericSql.CmsDbAccess.readFile(CmsDbAccess.java:6060)
	at com.opencms.file.genericSql.CmsResourceBroker.readFile(CmsResourceBroker.java:5203)
	at com.opencms.file.CmsObject.readFile(CmsObject.java:2888)
	at com.opencms.core.OpenCms.initResource(OpenCms.java:793)
	at com.opencms.core.OpenCmsHttpServlet.doGet(OpenCmsHttpServlet.java:363)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

"http-8443-Processor23":
	at java.sql.DriverManager.getDrivers(DriverManager.java:321)
	- waiting to lock <0xaf87b628> (a java.lang.Class)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:305)
	at com.opencms.dbpool.CmsPool.createConnection(CmsPool.java:338)
	at com.opencms.dbpool.CmsPool.createConnections(CmsPool.java:320)
	at com.opencms.dbpool.CmsPool.putConnection(CmsPool.java:301)
	- locked <0x392d0d10> (a java.util.Stack)

Code changes in CmsPool, swap :

synchronized(m_availableConnections) 
    to
synchronized(DriverManager.class)
    and
m_availableConnections.notify();
    to
// m_availableConnections.notify();


_______________________________________________
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


***********************************************************************************
EDF Energy plc internet e-mail disclaimer
This e-mail and any files transmitted with it are confidential and may be protected by legal privilege.
If you are not the intended recipient, please notify the sender and delete the e-mail from your system.
This e-mail has been scanned for malicious content but the internet is inherently insecure and EDF
Energy plc cannot accept any liability for the integrity of this message or its attachments. No employee
or agent of EDF Energy plc or any related company is authorised to conclude any binding agreement on
behalf of EDF Energy plc or any related company by e-mail. All e-mails sent and received by EDF Energy
plc are monitored to ensure compliance with the company's information security policy.
***********************************************************************************





More information about the opencms-dev mailing list