On 2/8/12 6:27 AM, Katherine Marsden wrote:
On 2/8/2012 2:15 AM, Kristian Waagan wrote:
On 08.02.2012 11:01, Knut Anders Hatlen wrote:
<snip>

This deadlock does not happen in Java 6 because the getConnection() method is no longer synchronized, and the synchronized section in getDriver() has been narrowed down (and in Java 7 it's completely removed).

We had the same problem in the replication test code at some point. I can't remember what was done to fix it, maybe the code was restructured to avoid the problem altogether.


We had this problem in Network Server initially if client was in the same jvm. The solution was to avoid using Driver Manager in internally all together and let the user have the DriverManagerLock. In NetworkServerControlImpl we have:
    // start the server.
cloudscapeDriver = (Driver) Class.forName(CLOUDSCAPE_DRIVER).newInstance();

and then use that Driver for getting connections.



Thanks Kathey, Knut, and Kristian. The discussion and experiments were very helpful. I can reproduce this hang on Linux on Java 5 using the short test case attached to newly filed DERBY-5607.

Thanks,
-Rick

Reply via email to