Re: Connections & Pooling

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Nov 30 2005 - 11:31:57 EST

  • Next message: Mike Kienenberger: "Re: Please help: retrieval and proper usage of per thread DataContext"

    I am not sure if you've followed this recent thread, and tried any of
    the suggestions:

    http://objectstyle.org/cayenne/lists/cayenne-user/2005/11/0168.html

    In short - two likely causes of exhausted connection pool are many
    slow queries being run in parallel or users working at the JDBC (or
    Cayenne ResultIterator) level forgetting to close the connections
    explicitly.

    Andrus

    On Nov 30, 2005, at 5:57 PM, noban wrote:
    > Hi!
    >
    > I`m recieving strange error.
    >
    > After 10 successfull inserts into DB my program recieves error,
    > that I`ve reached max connections count, as you can imagine my max
    > connections count param is set to 10.
    > So my gues is that I`m just wrongly using Cayenne for desktop client.
    >
    > I`m using it in such a way:
    >
    > ...
    > DataContext dataContext = MyConnectionModel.getDataContext();
    > MyTableClass tableClassObj = (MyTableClass)
    > dataContext.createAndRegisterNewObject(MyTableClass.class);
    > tableClassObj .setColumn1Value(value);
    > tableClassObj .setColumn2Value(value);
    > ...
    > try {
    > dataContext.commitChanges();
    > } catch (Exception e) {
    > e.printStackTrace();
    > }
    >
    > Is this right way to do things?
    >
    > I mean taht, my program opens all 10 connections, and thats, all.
    > What I should do to prevent from opening new connections, and
    > how to use opened one`s, or at least close them after:
    > ctxt.commitChanges()?
    >
    > And actually how I can check my hypothesis (that program is opening
    > new connections and holding old one`s)?
    >



    This archive was generated by hypermail 2.0.0 : Wed Nov 30 2005 - 11:32:00 EST