[v.1.1.3 September 28 2005] Global exception.

From: Claudio Rosati (claudio.rosat..csys.it)
Date: Mon Nov 28 2005 - 11:47:58 EST

  • Next message: Gentry, Michael \(Contractor\): "RE: [v.1.1.3 September 28 2005] Global exception."

    Hello all,
     
    I'm using Cayenne 1.1.3 with PostgreSQL 8.1 on Windows XP & Linux.
    The following code, called in a context where the DataContext __datactx is
    already set up and possibly some commit were already called, seems consume a
    JDBC connection when __datactx.performQuery(query); is called without
    releasing it.
     
     private Collocation getCollocation ( String pressmark )
     {
      Collocation collocation = null;
      Expression exp = ExpressionFactory.matchExp("pressmark", pressmark);
      SelectQuery query = new SelectQuery(Collocation.class, exp);
      List queriedList = __datactx.performQuery(query);
      if ( queriedList.size() > 0 )
       collocation = (Collocation) queriedList.get(0);
      return collocation;
     }

    Clearly after a while (a very short while) the following errors occurs
     
    CADMUS Ver 1.3.0
       EXCEPTION: Unexpected exception
    org.objectstyle.cayenne.CayenneRuntimeException.
     Location is:
    org.objectstyle.cayenne.access.util.SelectObserver.nextGlobalException, line
    222.
      Message is: [v.1.1.3 September 28 2005] Global exception.
     Stack trace: org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1.3
    September 28 2005] Global exception.
            at
    org.objectstyle.cayenne.access.util.SelectObserver.nextGlobalException(Selec
    tObserver.java:222)
            at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:325)
            at
    org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.java:654
    )
            at
    org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.java:1
    408)
            at
    org.objectstyle.cayenne.access.Transaction.performQueries(Transaction.java:1
    79)
            at
    org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.java:1
    366)
            at
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:162
    2)
            at
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:148
    5)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.CollocationImporter.getColloc
    ation(CollocationImporter.java:222)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.CollocationImporter.importCol
    locations(CollocationImporter.java:101)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.RecordImporter.getCollocation
    s(RecordImporter.java:798)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.RecordImporter.importRecord(R
    ecordImporter.java:412)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.RecordImporter.getRecord(Reco
    rdImporter.java:336)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.RecordImporter.importRecords(
    RecordImporter.java:168)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.SBNImporter.importRecords(SBN
    Importer.java:305)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.wizard.Progress.importRecords
    (Progress.java:208)
            at
    it.acsys.multimedia.products.cadmus.plugin.sbn.wizard.Progress.run(Progress.
    java:228)
            at
    it.acsys.swing.wizard.DefaultProgressPage$2.run(DefaultProgressPage.java:118
    1)
            at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: Can't obtain connection. Request timed
    out. Total used connections: 20
            at
    org.objectstyle.cayenne.conn.PoolManager.uncheckPooledConnection(PoolManager
    .java:466)
            at
    org.objectstyle.cayenne.conn.PoolManager.getConnection(PoolManager.java:392)
            at
    org.objectstyle.cayenne.conn.PoolManager.getConnection(PoolManager.java:385)
            at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:313)
            ... 17 more
     
    I've tried to give more connection but the problems always occurs (in a
    longer time).
     
    I don't understand is I've missed something in the code or somewhere in the
    initialization.
     
    Anyone has some suggestions?
     
    Thanks
     
    Claudio
     
     
     
     
     
     

             Multimedia <http://www.acsys.it/> Division
            

    Claudio Rosati
    Project Manager Advanced Computer Systems S.p.A.
    via Della Bufalotta 378
    00139 Roma, RM
    Italy
    claudio.rosat..csys.it
    tel:
    fax: +39 06 8709 0516
    +39 06 8720 1502
            

     <https://www.plaxo.com/add_me?u=4295038861&v0=140354&k0=586510396> Add me
    to your address book... <http://www.plaxo.com/signature> Want a signature
    like this?
     



    logo_acs_new_small.gif



    This archive was generated by hypermail 2.0.0 : Mon Nov 28 2005 - 11:48:05 EST