Thanks Thomas!
It turned out that there were a couple of other hidden connections
being made in the loop and making those also use the one connection
did the trick.
That said, I am wondering why the connection pool is not replenished
or at least not fast enough so. Is there a setting that would change
that?
thanks,
h.
On Thu, Apr 17, 2008, at 12:49AM, Thomas Fischer wrote:
From your description, I do not know where the problem is. You
might want
to try the following:
- Check that you are using a current dbcp version (1.2.2)
- Try to debug into the save() code and check where Torque opens a new
connection. The Data source used in SharedPoolDataSourceFactory,
org.apache.commons.dbcp.datasources.SharedPoolDataSource, has a method
getNumActive(), so it should store the number of active connections
somewhere (You need a debugger for this, Torque does not expose the
Data
Source). Also check that getNumActive() decreases after the
connection is
closed. With this information. I might be able to help you further.
Thomas
Helge Weissig <[EMAIL PROTECTED]> schrieb am 17.04.2008 01:30:48:
Hi all,
the following configuration and pseudo code cause my web
application
to hang if the value of numObjects is larger than the value of
torque.dsfactory.oracle.pool.maxActive
Torque.properties:
torque.database.oracle.adapter=oracle
torque
.dsfactory
.oracle
.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
torque
.dsfactory.oracle.connection.driver=oracle.jdbc.driver.OracleDriver
torque.dsfactory.oracle.pool.maxActive=40
java pseudo code:
for (int n = 0; n < numObjects; n++) {
TestTable o = new TestTable();
o.setRowValue(n);
o.save();
}
I have (without success) tried several other ways, including the re-
use of one single connection:
Connection con = Torque.getConnection("oracle");
for (int n = 0; n < numObjects; n++) {
TestTable o = new TestTable();
o.setRowValue(n);
TestTablePeer.doInsert(o, con);
}
con.close();
Any idea what would allow me to not have to use some ridiculously
high
value for the number of maximum active connections in the connection
pool?
I am using Torque 3.3 and Oracle 8i (OK, yes, that may be a problem,
but I would still love to hear the *reason*). The table in question
uses a native ID method via a simple sequence.
thanks so much!
h.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]