So I finally put my old Cayenne 1.x-upgraded to 3.x app into production.
A couple of hours later, I got this error [1]. Note that my app
synchronizes requests so only one thread should ever be running
Cayenne requests at a time.
My app has run for years with only a single connection. My 3.x app
ran in development for a year before it was deployed to production.
Is this a fluke? I did raise my connection pool to 3 the next day,
but I don't want to arbitrarily assign a higher number and think I've
magically solved the problem.
Does having three active server runtimes affect this? Before, my
query qualifiers were all handled inside the main runtime, but now I
have three separate runtimes configured. My guess is that all three
runtimes share the same pool, so this is probably not the cause. And
since the problem happened a couple hours later and the three runtimes
were being used well before that without an error, I'd say experience
bears this out.
[1]
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:452)
at
org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:382)
at
org.apache.cayenne.conn.PoolManager.getConnection(PoolManager.java:371)
at
org.apache.cayenne.access.DataNode$TransactionDataSource.getConnection(DataNode.java:351)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:259)