waitOnLOck on several threads when db connection lost

From: Leonard Meyer <lmeyer(at)excilys(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: waitOnLOck on several threads when db connection lost
Date: 2014-08-08 07:51:21
Message-ID: CADGbXSQxfrWASc3xRa08P9VRxyy3eHQ_J5nBiVY7rZVRe0JPLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

Basically I'm using Akka with postrgeSQL JDBC API. For those who doesn't
know Akka, just know that I have several actors (i.e threads in my case)
doing COPY from incoming files. I'm testing the resilience of my system by
stopping and restarting the database during processing. My problem is that
during restarts, some of my threads (seems random) just stay hanging for a
lock...

I already posted on the Akka mailing list, thinking I was just doing things
wrong, but given the responses I thought I should come here.

Please visit https://groups.google.com/forum/#!topic/akka-user/Ehzioy3jVoU
for detailed informations and stacktraces. Here's the diagnosis of HikariCP
main developper :

"It appears that you are using the PostgreSQL CopyManager, correct?
Looking at QueryExecutorImpl it appears that rollback() is trying to
obtain a lock that was not released by the CopyManager. I recommend using
the CopyManager.copyIn() method that returns a CopyIn object, rather than
using the convenience method that takes a reader. Use the writeToCopy() to
pump the data in, and be sure to catch SQLException. If you get an
SQLException, call cancelCopy() and retry or whatever your recovery
scenario is, otherwise call endCopy(). I would have expected PostgreSQL to
handle the severing of a Connection in the middle of a bulk copy better,
but that is probably a question for the PostgreSQL group."

Of course I already tried it and nothing changed so I'm left wondering
here... Any help welcomed ! Thanks

Browse pgsql-jdbc by date

  From Date Subject
Next Message javadesigner 2014-08-11 19:06:51 PreparedStatement error upon trying to set a '?' after interval keyword
Previous Message Ludwig Adam 2014-08-05 12:51:35 Re: Trace JDBC connection to Java Thread / local socket port