Grokbase Groups Cayenne user May 2008
FAQ
Hello,

//Didn't confirm my subscription before - so i post it again - not sure if
my previous message was accepted by the server...

I'm new to this mailing list so forgive me all my mistakes (or repeated
question?).

I'm trying to use Cayenne with MSSQL Server 2005. I downloaded the fresh
jdbc driver, created the database, set up new user with password. After
designing the tables in the Cayenne Modeler i generate database and
everything goes fast. I checked manualy if the database exists and so on
(with the mssql management tools) and everything seems to be fine.Then I
generate classes, write some simple query and here the problem starts. It
takes great amounts of time for application to connect to the database. It
can take up to 20s when im running first query:
(...)
2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
applyObjectLayerDefaults
INFO: added runtime complimentary ObjRelationship from Klient to Placowka
2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
applyObjectLayerDefaults
INFO: added runtime complimentary ObjRelationship from DaneOsobowe to
Wlasciciel
2008-05-29 12:29:04 org.apache.cayenne.conf.RuntimeLoadDelegate
finishedLoading
INFO: finished configuration loading in 719 ms.
2008-05-29 12:29:04 org.apache.cayenne.access.QueryLogger logConnect
INFO: Opening connection:
jdbc:sqlserver://localhost:1433;database=bazac;SelectMethod=cursor
Login: michal
Password: *******
2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger logConnectSuccess
INFO: +++ Connecting: SUCCESS.
2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger
logBeginTransaction
INFO: --- transaction started.
2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger log
INFO: Detected and installed adapter:
org.apache.cayenne.dba.sqlserver.SQLServerAdapter
2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQueryStart
<-----------look at the times
INFO: --- will run 1 query.
2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
logBeginTransaction
INFO: --- transaction started.
2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQuery
INFO: SELECT t0.numerPlacowki, t0.miasto, t0.id FROM Placowka t0
(...)

Aplication freezes on NFO: Detected and installed adapter:
org.apache.cayenne.dba.sqlserver.SQLServerAdapter line.
Next one is: 2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
logQueryStart...
Sometimes i even get exception:

INFO: Detected and installed adapter:
org.apache.cayenne.dba.sqlserver.SQLServerAdapter
Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
[v.3.0M3 Jan 27 2008 20:12:33] Commit Exception
at
org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1207)
at
org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1088)
at tools.Testy.test1(Testy.java:27)
at mainFiles.Main.main(Main.java:22)
Caused by: java.sql.SQLException: Can't obtain connection. Request timed
out. Total used connections: 1
at
org.apache.cayenne.conn.PoolManager.uncheckPooledConnection(PoolManager.java:422)
at
org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:351)
at
org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:344)
at
org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:331)
at
org.apache.cayenne.dba.sybase.SybasePkGenerator.longPkFromDatabase(SybasePkGenerator.java:168)
at
org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:254)
at
org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:165)
at
org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:76)
at
org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:80)
at
org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:183)
at
org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:135)
at
org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)
at
org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)
at
org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
at
org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1175)
... 3 more
Java Result: 1


It doesn't matter what query (insert,update,select) im trying to run. Always
stops at the same place and if there is an exception (usually there is) it
looks like the one i posted. I think that its about commitChanges() but i
dont know what is causing he problem. Would love to hear your advices :)

Thank you for all your help and im sorry for my poor english :)

Mike

Search Discussions

  • Nirwan at May 29, 2008 at 11:14 am
    Hello,

    I'm trying to use Cayenne with MSSQL Server 2005. I downloaded the fresh
    jdbc driver, created the database, set up new user with password. After
    designing the tables in the Cayenne Modeler i generate database and
    everything goes fast. I checked manualy if the database exists and so on
    (with the mssql management tools) and everything seems to be fine.Then I
    generate classes, write some simple query and here the problem starts. It
    takes great amounts of time for application to connect to the database. It
    can take up to 20s when im running first query:
    (...)
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from Klient to Placowka
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from DaneOsobowe to
    Wlasciciel
    2008-05-29 12:29:04 org.apache.cayenne.conf.RuntimeLoadDelegate
    finishedLoading
    INFO: finished configuration loading in 719 ms.
    2008-05-29 12:29:04 org.apache.cayenne.access.QueryLogger logConnect
    INFO: Opening connection:
    jdbc:sqlserver://localhost:1433;database=bazac;SelectMethod=cursor
    Login: michal
    Password: *******
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger logConnectSuccess
    INFO: +++ Connecting: SUCCESS.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger log
    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQueryStart
    <-----------look at the times
    INFO: --- will run 1 query.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQuery
    INFO: SELECT t0.numerPlacowki, t0.miasto, t0.id FROM Placowka t0
    (...)

    Aplication freezes on NFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter line.
    Next one is: 2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logQueryStart...
    Sometimes i even get exception:

    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
    [v.3.0M3 Jan 27 2008 20:12:33] Commit Exception
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1207)
    at
    org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1088)
    at tools.Testy.test1(Testy.java:27)
    at mainFiles.Main.main(Main.java:22)
    Caused by: java.sql.SQLException: Can't obtain connection. Request timed
    out. Total used connections: 1
    at
    org.apache.cayenne.conn.PoolManager.uncheckPooledConnection(PoolManager.java:422)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:351)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:344)
    at
    org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:331)
    at
    org.apache.cayenne.dba.sybase.SybasePkGenerator.longPkFromDatabase(SybasePkGenerator.java:168)
    at
    org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:254)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:165)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:76)
    at
    org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:80)
    at
    org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:183)
    at
    org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:135)
    at
    org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)
    at
    org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
    at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1175)
    ... 3 more
    Java Result: 1


    It doesn't matter what query (insert,update,select) im trying to run. Always
    stops at the same place and if there is an exception (usually there is) it
    looks like the one i posted. I think that its about commitChanges() but i
    dont know what is causing he problem. Would love to hear your advices :)

    Thank you for all your help and im sorry for my poor english :)

    Mike
    --
    View this message in context: http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532439p17532439.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Garcia Corral, Josep at May 29, 2008 at 11:35 am
    Hello Mike,

    Your message is arriving to the list!

    I cannot help much, since I am using Cayenne, without any problem, with Oracle and MySql. I am sure some guy on the other side of the Atlantic ocean will have experience with Cayenne + SQL Server. You will get responses within a few hours (different time zone ;-)

    Cheers,
    Josep

    -----Mensaje original-----
    De: nirwan
    Enviado el: jueves, 29 de mayo de 2008 13:14
    Para: user@cayenne.apache.org
    Asunto: MSSQL + Cayenne -> connection problem


    Hello,

    I'm trying to use Cayenne with MSSQL Server 2005. I downloaded the fresh
    jdbc driver, created the database, set up new user with password. After
    designing the tables in the Cayenne Modeler i generate database and
    everything goes fast. I checked manualy if the database exists and so on
    (with the mssql management tools) and everything seems to be fine.Then I
    generate classes, write some simple query and here the problem starts. It
    takes great amounts of time for application to connect to the database. It
    can take up to 20s when im running first query:
    (...)
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from Klient to Placowka
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from DaneOsobowe to
    Wlasciciel
    2008-05-29 12:29:04 org.apache.cayenne.conf.RuntimeLoadDelegate
    finishedLoading
    INFO: finished configuration loading in 719 ms.
    2008-05-29 12:29:04 org.apache.cayenne.access.QueryLogger logConnect
    INFO: Opening connection:
    jdbc:sqlserver://localhost:1433;database=bazac;SelectMethod=cursor
    Login: michal
    Password: *******
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger logConnectSuccess
    INFO: +++ Connecting: SUCCESS.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger log
    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQueryStart
    <-----------look at the times
    INFO: --- will run 1 query.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQuery
    INFO: SELECT t0.numerPlacowki, t0.miasto, t0.id FROM Placowka t0
    (...)

    Aplication freezes on NFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter line.
    Next one is: 2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logQueryStart...
    Sometimes i even get exception:

    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
    [v.3.0M3 Jan 27 2008 20:12:33] Commit Exception
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1207)
    at
    org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1088)
    at tools.Testy.test1(Testy.java:27)
    at mainFiles.Main.main(Main.java:22)
    Caused by: java.sql.SQLException: Can't obtain connection. Request timed
    out. Total used connections: 1
    at
    org.apache.cayenne.conn.PoolManager.uncheckPooledConnection(PoolManager.java:422)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:351)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:344)
    at
    org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:331)
    at
    org.apache.cayenne.dba.sybase.SybasePkGenerator.longPkFromDatabase(SybasePkGenerator.java:168)
    at
    org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:254)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:165)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:76)
    at
    org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:80)
    at
    org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:183)
    at
    org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:135)
    at
    org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)
    at
    org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
    at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1175)
    ... 3 more
    Java Result: 1


    It doesn't matter what query (insert,update,select) im trying to run. Always
    stops at the same place and if there is an exception (usually there is) it
    looks like the one i posted. I think that its about commitChanges() but i
    dont know what is causing he problem. Would love to hear your advices :)

    Thank you for all your help and im sorry for my poor english :)

    Mike
    --
    View this message in context: http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532439p17532439.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Nirwan at May 29, 2008 at 12:29 pm
    Hello Josep,

    Thank you for your message. I'm sorry for double posting my question :(

    Regards,
    Mike


    --
    View this message in context: http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532439p17534638.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Bill Fan at May 29, 2008 at 12:48 pm
    Mike,

    Try this....you need to make sure the TCP port is 1433 and no value
    specified for TCP Dynamic Port for IPAll in the TCP/IP setting. For all
    other IP's, you can set TCP Dynamic Ports to be 0 and leave TCP Port empty.

    It can be configured through SQL Server Configuration Manager.

    Cheers,
    Bill


    Garcia Corral, Josep wrote:
    Hello Mike,

    Your message is arriving to the list!

    I cannot help much, since I am using Cayenne, without any problem, with Oracle and MySql. I am sure some guy on the other side of the Atlantic ocean will have experience with Cayenne + SQL Server. You will get responses within a few hours (different time zone ;-)

    Cheers,
    Josep

    -----Mensaje original-----
    De: nirwan
    Enviado el: jueves, 29 de mayo de 2008 13:14
    Para: user@cayenne.apache.org
    Asunto: MSSQL + Cayenne -> connection problem


    Hello,

    I'm trying to use Cayenne with MSSQL Server 2005. I downloaded the fresh
    jdbc driver, created the database, set up new user with password. After
    designing the tables in the Cayenne Modeler i generate database and
    everything goes fast. I checked manualy if the database exists and so on
    (with the mssql management tools) and everything seems to be fine.Then I
    generate classes, write some simple query and here the problem starts. It
    takes great amounts of time for application to connect to the database. It
    can take up to 20s when im running first query:
    (...)
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from Klient to Placowka
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from DaneOsobowe to
    Wlasciciel
    2008-05-29 12:29:04 org.apache.cayenne.conf.RuntimeLoadDelegate
    finishedLoading
    INFO: finished configuration loading in 719 ms.
    2008-05-29 12:29:04 org.apache.cayenne.access.QueryLogger logConnect
    INFO: Opening connection:
    jdbc:sqlserver://localhost:1433;database=bazac;SelectMethod=cursor
    Login: michal
    Password: *******
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger logConnectSuccess
    INFO: +++ Connecting: SUCCESS.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger log
    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQueryStart
    <-----------look at the times
    INFO: --- will run 1 query.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQuery
    INFO: SELECT t0.numerPlacowki, t0.miasto, t0.id FROM Placowka t0
    (...)

    Aplication freezes on NFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter line.
    Next one is: 2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logQueryStart...
    Sometimes i even get exception:

    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
    [v.3.0M3 Jan 27 2008 20:12:33] Commit Exception
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1207)
    at
    org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1088)
    at tools.Testy.test1(Testy.java:27)
    at mainFiles.Main.main(Main.java:22)
    Caused by: java.sql.SQLException: Can't obtain connection. Request timed
    out. Total used connections: 1
    at
    org.apache.cayenne.conn.PoolManager.uncheckPooledConnection(PoolManager.java:422)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:351)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:344)
    at
    org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:331)
    at
    org.apache.cayenne.dba.sybase.SybasePkGenerator.longPkFromDatabase(SybasePkGenerator.java:168)
    at
    org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:254)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:165)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:76)
    at
    org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:80)
    at
    org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:183)
    at
    org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:135)
    at
    org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)
    at
    org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
    at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1175)
    ... 3 more
    Java Result: 1


    It doesn't matter what query (insert,update,select) im trying to run. Always
    stops at the same place and if there is an exception (usually there is) it
    looks like the one i posted. I think that its about commitChanges() but i
    dont know what is causing he problem. Would love to hear your advices :)

    Thank you for all your help and im sorry for my poor english :)

    Mike
    --
    View this message in context: http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532439p17532439.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.


  • Nirwan at May 29, 2008 at 1:25 pm
    Hello Bill,

    Thank you for response. I've done what you've said but it didn't help at
    all. It's still the same. The delay is huge and usually ends with timeout
    exception :(

    any other ideas?

    Regards,
    Mike


    Bill Fan wrote:
    Mike,

    Try this....you need to make sure the TCP port is 1433 and no value
    specified for TCP Dynamic Port for IPAll in the TCP/IP setting. For all
    other IP's, you can set TCP Dynamic Ports to be 0 and leave TCP Port
    empty.

    It can be configured through SQL Server Configuration Manager.

    Cheers,
    Bill


    Garcia Corral, Josep wrote:
    Hello Mike,

    Your message is arriving to the list!

    I cannot help much, since I am using Cayenne, without any problem, with
    Oracle and MySql. I am sure some guy on the other side of the Atlantic
    ocean will have experience with Cayenne + SQL Server. You will get
    responses within a few hours (different time zone ;-)

    Cheers,
    Josep

    -----Mensaje original-----
    De: nirwan
    Enviado el: jueves, 29 de mayo de 2008 13:14
    Para: user@cayenne.apache.org
    Asunto: MSSQL + Cayenne -> connection problem


    Hello,

    I'm trying to use Cayenne with MSSQL Server 2005. I downloaded the fresh
    jdbc driver, created the database, set up new user with password. After
    designing the tables in the Cayenne Modeler i generate database and
    everything goes fast. I checked manualy if the database exists and so on
    (with the mssql management tools) and everything seems to be fine.Then I
    generate classes, write some simple query and here the problem starts. It
    takes great amounts of time for application to connect to the database.
    It
    can take up to 20s when im running first query:
    (...)
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from Klient to Placowka
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from DaneOsobowe to
    Wlasciciel
    2008-05-29 12:29:04 org.apache.cayenne.conf.RuntimeLoadDelegate
    finishedLoading
    INFO: finished configuration loading in 719 ms.
    2008-05-29 12:29:04 org.apache.cayenne.access.QueryLogger logConnect
    INFO: Opening connection:
    jdbc:sqlserver://localhost:1433;database=bazac;SelectMethod=cursor
    Login: michal
    Password: *******
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger
    logConnectSuccess
    INFO: +++ Connecting: SUCCESS.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger log
    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQueryStart
    <-----------look at the times
    INFO: --- will run 1 query.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQuery
    INFO: SELECT t0.numerPlacowki, t0.miasto, t0.id FROM Placowka t0
    (...)

    Aplication freezes on NFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter line.
    Next one is: 2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logQueryStart...
    Sometimes i even get exception:

    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
    [v.3.0M3 Jan 27 2008 20:12:33] Commit Exception
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1207)
    at
    org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1088)
    at tools.Testy.test1(Testy.java:27)
    at mainFiles.Main.main(Main.java:22)
    Caused by: java.sql.SQLException: Can't obtain connection. Request timed
    out. Total used connections: 1
    at
    org.apache.cayenne.conn.PoolManager.uncheckPooledConnection(PoolManager.java:422)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:351)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:344)
    at
    org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:331)
    at
    org.apache.cayenne.dba.sybase.SybasePkGenerator.longPkFromDatabase(SybasePkGenerator.java:168)
    at
    org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:254)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:165)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:76)
    at
    org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:80)
    at
    org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:183)
    at
    org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:135)
    at
    org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)
    at
    org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
    at
    org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1175)
    ... 3 more
    Java Result: 1


    It doesn't matter what query (insert,update,select) im trying to run.
    Always
    stops at the same place and if there is an exception (usually there is)
    it
    looks like the one i posted. I think that its about commitChanges() but i
    dont know what is causing he problem. Would love to hear your advices :)

    Thank you for all your help and im sorry for my poor english :)

    Mike
    --
    View this message in context:
    http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532439p17532439.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.


    --
    View this message in context: http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532439p17535796.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Garcia Corral, Josep at May 29, 2008 at 1:31 pm
    I would first try to connect with a graphical JDBC client.
    I recommend Squirrel SQL Client. It's released under the GNU Lesser General Public License. http://www.squirrelsql.org/

    Once you get it working with your SQL Server, I am sure it will with your Cayenne client code.

    Cheers,

    -----Mensaje original-----
    De: nirwan
    Enviado el: jueves, 29 de mayo de 2008 15:25
    Para: user@cayenne.apache.org
    Asunto: Re: MSSQL + Cayenne -> connection problem


    Hello Bill,

    Thank you for response. I've done what you've said but it didn't help at
    all. It's still the same. The delay is huge and usually ends with timeout
    exception :(

    any other ideas?

    Regards,
    Mike


    Bill Fan wrote:
    Mike,

    Try this....you need to make sure the TCP port is 1433 and no value
    specified for TCP Dynamic Port for IPAll in the TCP/IP setting. For all
    other IP's, you can set TCP Dynamic Ports to be 0 and leave TCP Port
    empty.

    It can be configured through SQL Server Configuration Manager.

    Cheers,
    Bill


    Garcia Corral, Josep wrote:
    Hello Mike,

    Your message is arriving to the list!

    I cannot help much, since I am using Cayenne, without any problem, with
    Oracle and MySql. I am sure some guy on the other side of the Atlantic
    ocean will have experience with Cayenne + SQL Server. You will get
    responses within a few hours (different time zone ;-)

    Cheers,
    Josep

    -----Mensaje original-----
    De: nirwan
    Enviado el: jueves, 29 de mayo de 2008 13:14
    Para: user@cayenne.apache.org
    Asunto: MSSQL + Cayenne -> connection problem


    Hello,

    I'm trying to use Cayenne with MSSQL Server 2005. I downloaded the fresh
    jdbc driver, created the database, set up new user with password. After
    designing the tables in the Cayenne Modeler i generate database and
    everything goes fast. I checked manualy if the database exists and so on
    (with the mssql management tools) and everything seems to be fine.Then I
    generate classes, write some simple query and here the problem starts. It
    takes great amounts of time for application to connect to the database.
    It
    can take up to 20s when im running first query:
    (...)
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from Klient to Placowka
    2008-05-29 12:29:04 org.apache.cayenne.map.EntityResolver
    applyObjectLayerDefaults
    INFO: added runtime complimentary ObjRelationship from DaneOsobowe to
    Wlasciciel
    2008-05-29 12:29:04 org.apache.cayenne.conf.RuntimeLoadDelegate
    finishedLoading
    INFO: finished configuration loading in 719 ms.
    2008-05-29 12:29:04 org.apache.cayenne.access.QueryLogger logConnect
    INFO: Opening connection:
    jdbc:sqlserver://localhost:1433;database=bazac;SelectMethod=cursor
    Login: michal
    Password: *******
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger
    logConnectSuccess
    INFO: +++ Connecting: SUCCESS.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:05 org.apache.cayenne.access.QueryLogger log
    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQueryStart
    <-----------look at the times
    INFO: --- will run 1 query.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logBeginTransaction
    INFO: --- transaction started.
    2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger logQuery
    INFO: SELECT t0.numerPlacowki, t0.miasto, t0.id FROM Placowka t0
    (...)

    Aplication freezes on NFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter line.
    Next one is: 2008-05-29 12:29:25 org.apache.cayenne.access.QueryLogger
    logQueryStart...
    Sometimes i even get exception:

    INFO: Detected and installed adapter:
    org.apache.cayenne.dba.sqlserver.SQLServerAdapter
    Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
    [v.3.0M3 Jan 27 2008 20:12:33] Commit Exception
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1207)
    at
    org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1088)
    at tools.Testy.test1(Testy.java:27)
    at mainFiles.Main.main(Main.java:22)
    Caused by: java.sql.SQLException: Can't obtain connection. Request timed
    out. Total used connections: 1
    at
    org.apache.cayenne.conn.PoolManager.uncheckPooledConnection(PoolManager.java:422)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:351)
    at
    org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:344)
    at
    org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:331)
    at
    org.apache.cayenne.dba.sybase.SybasePkGenerator.longPkFromDatabase(SybasePkGenerator.java:168)
    at
    org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:254)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:165)
    at
    org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:76)
    at
    org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:80)
    at
    org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:183)
    at
    org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:135)
    at
    org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)
    at
    org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)
    at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
    at
    org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
    at
    org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1175)
    ... 3 more
    Java Result: 1


    It doesn't matter what query (insert,update,select) im trying to run.
    Always
    stops at the same place and if there is an exception (usually there is)
    it
    looks like the one i posted. I think that its about commitChanges() but i
    dont know what is causing he problem. Would love to hear your advices :)

    Thank you for all your help and im sorry for my poor english :)

    Mike
    --
    View this message in context:
    http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532439p17532439.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.


    --
    View this message in context: http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532439p17535796.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Andrus Adamchik at May 29, 2008 at 1:36 pm

    On May 29, 2008, at 1:45 PM, Michał Morzywołek wrote:

    Caused by: java.sql.SQLException: Can't obtain connection. Request
    timed
    out. Total used connections: 1
    at
    There is a connection leak somewhere...

    The simplest solution is to set max connections for the DataNode in
    the Modeler to a number higher than 1.

    Andrus
  • Nirwan at May 29, 2008 at 1:49 pm
    Hello Andrus,

    It works fine after the change :) Thank you very much :) I wonder where is
    the leak...

    Thank you once again :)

    Regards,
    Mike



    Andrus Adamchik wrote:
    On May 29, 2008, at 1:45 PM, Michał Morzywołek wrote:

    Caused by: java.sql.SQLException: Can't obtain connection. Request
    timed
    out. Total used connections: 1
    at
    There is a connection leak somewhere...

    The simplest solution is to set max connections for the DataNode in
    the Modeler to a number higher than 1.

    Andrus
    --
    View this message in context: http://www.nabble.com/MSSQL-%2B-Cayenne--%3E-connection-problem-tp17532984p17536181.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedMay 29, '08 at 10:46a
activeMay 29, '08 at 1:49p
posts9
users4
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase