Request timed out SQLException

From: emre.yilma..r.net
Date: Tue Mar 14 2006 - 08:57:42 EST

  • Next message: Andrus Adamchik: "Re: Request timed out SQLException"

    Hi,

     I get an exception of java.sql.SQLException.I check the MsSql 7.0 polling
    interval which is 10 seconds. But when I use the context.commitChanges() in a
    TimerTask rarely I get this exception. Is there any way to handle this
    exception with cayenne or any advice you have?

    Exception :

    java.sql.SQLException: Can't obtain connection. Request timed out. Total used
    connections: 1
            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$TransactionDataSource.getConnection
    (DataNode.java:589)
            at org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:301)
            at org.objectstyle.cayenne.access.DataDomainCommitAction.commit
    (DataDomainCommitAction.java:180)
            at org.objectstyle.cayenne.access.DataDomain.onSync(DataDomain.java:750)
            at org.objectstyle.cayenne.access.DataContext.doCommitChanges(DataContext.java:
    1115)
            at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:
    1081)
            at tr.com.htr.hgys.db.AccessPersonelLogs.insertAccessLogs(AccessPersonelLogs.
    java:27)
            at tr.com.htr.hgys.core.AccesLogRecorder.validPersonelEntrance
    (AccesLogRecorder.java:37)
            at tr.com.htr.hgys.core.AccesLogRecorder.validCardEntrance(AccesLogRecorder.
    java:24)
            at tr.com.htr.hgys.core.access.MagneticDoorAccess$DoorCloseReminder.run
    (MagneticDoorAccess.java:128)
            at java.util.TimerThread.mainLoop(Unknown Source)
            at java.util.TimerThread.run(Unknown Source)
    Exception in thread "Timer-6" org.objectstyle.cayenne.CayenneRuntimeException:
    [v.1.2M11 February 13 2006] Commit Exception
            at org.objectstyle.cayenne.access.DataContext.doCommitChanges(DataContext.java:
    1125)
            at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:
    1081)
            at tr.com.htr.hgys.db.AccessPersonelLogs.insertAccessLogs(AccessPersonelLogs.
    java:27)
            at tr.com.htr.hgys.core.AccesLogRecorder.validPersonelEntrance
    (AccesLogRecorder.java:37)
            at tr.com.htr.hgys.core.AccesLogRecorder.validCardEntrance(AccesLogRecorder.
    java:24)
            at tr.com.htr.hgys.core.access.MagneticDoorAccess$DoorCloseReminder.run
    (MagneticDoorAccess.java:128)
            at java.util.TimerThread.mainLoop(Unknown Source)
            at java.util.TimerThread.run(Unknown Source)

    My code:

    class Reminder extends TimerTask {
             public void run() {
    AccessPersonelLogs newAccessLogs = (AccessPersonelLogs)
             context.createAndRegisterNewObject(AccessPersonelLogs.class);
             
             newAccessLogs.setTime(ts);
             newAccessLogs.setDeviceRel(device);
             newAccessLogs.setPersonelRel(personel);
             newAccessLogs.setLogTypeRel(type);
             newAccessLogs.setExcuseResonRel(reason);
             
             context.commitChanges();
            }
        }

    Thanks..



    This archive was generated by hypermail 2.0.0 : Tue Mar 14 2006 - 08:57:05 EST