Re: getting bad connection

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Feb 13 2007 - 11:21:07 EST

  • Next message: Andrus Adamchik: "Re: AW: cayenne with jetty6"

    Frank,

    > after a number of calls, it fails.

    it would help if you provide the details of your problems, like
    Exception stack traces.

    My guess will be that you are not closing the connections\. You must
    call Connection.close() every time after you finish working with a
    connection.

    Andrus

    On Feb 13, 2007, at 11:14 AM, Frank wrote:
    > Hello,
    >
    > I have this in a class to return a Cayenne connection.
    > It works ok at first, but after a number of calls, it fails.
    >
    > public class DBConnections {....
    > public Connection getAS400Connection() {
    > try {
    > Configuration config = Configuration.getSharedConfiguration();
    > DataDomain domain = config.getDomain();
    > DataNode node = domain.getNode("cdsurveyDomainNode1");
    > return node.getDataSource().getConnection();
    > } catch (Exception ex) {
    > return null;
    > }
    > }
    >
    > Thanks
    >
    > Frank
    >



    This archive was generated by hypermail 2.0.0 : Tue Feb 13 2007 - 11:21:37 EST