Re: Synchronization/Deadlock

From: Orion Fields (ofield..martserv.com)
Date: Fri Feb 25 2005 - 09:23:57 EST

  • Next message: Andrus Adamchik: "Re: Synchronization/Deadlock"

    I have a minimum of 2 connections and a max of 5 connections to the db.

    What I noticed on my server was that an outside connection to another
    webserver (IIS...) would sometimes hang and never return, thus
    preventing one of the database connections from being used. I have
    since modified to code to support socket timeouts. In case anyone is
    wondering, the URL.open() doesn't support timeouts and you're better off
    writing your own http connections using a plain Socket class.

    However, after two of those threads had blocked, the next time cayenne
    needed a database connection, I saw it open one in the logs, but it
    never actually used it. Next time it should do it, I will find out
    where all the threads are blocking and send it to the list.

    Orion

    Mike Kienenberger wrote:

    >Orion Fields <ofield..martserv.com> wrote:
    >
    >
    >>I'm experiencing what seems to be a deadlock/synch problem with my
    >>DataContexts.
    >>
    >>Specs of what I'm running:
    >>Linux / Java 1.4.2_06 / MySql v 4.1.9
    >>
    >>Libraries I'm using:
    >>cayenne1.2M2.jar, mysql-connector-java-3.0.11-stable-bin.jar as well as
    >>a couple of unrelated proprietary jar files.
    >>
    >>I have the server setup as a standalone app which opens up a
    >>serversocket and just listens. New requests are spawned on a new thread
    >>which takes the requesting socket and a couple of params.
    >>
    >>
    >
    >The only time I've ever had Cayenne deadlock was when I didn't provide
    >enough connection pool resources.
    >
    >-Mike
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Feb 25 2005 - 09:30:15 EST