You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Ramesh Sabeti <rs...@reazon.com> on 2003/12/11 19:16:31 UTC

Torque JDBC2 Pool hangs w/ Oracle

I'm doing a "torture" test by repeatedly opening torque connections to a
database, performing a bunch of SELECTs and closing connections.  It
works fine if only one browser calls the torture test page, but if it's
done from two separate browsers (one IE and NS), one of them completes
the process and the other one hangs in the middle without any exceptions
thrown.  Here's my code...  any suggestions?

private void doTest() {
	try {
		for (int i = 0; i < 10; i++) {
			java.sql.Connection conn =
Torque.getConnection();
			System.out.print(">");
			java.sql.Statement stmt =
conn.createStatement();
			
			for (int j = 0; j < 100; j++) {
				stmt.execute("SELECT itm_id from item
where itm_id=" + new Random().nextInt());
				System.out.print(".");
			}
			
			Torque.closeConnection(conn);
			System.out.println();
		} 	
		
		System.out.println("Torture test ended successfully.");
	}
	catch (Exception e) {
		System.out.println("Exception in TortureTestForm");
	}
}

Thanks,

Ramesh.

P.S.  The torque connection setting is:

torque.dsfactory.default.factory=org.apache.torque.dsfactory.Jdbc2PoolDa
taSourceFactory
torque.dsfactory.default.pool.defaultMaxActive=50
torque.dsfactory.default.pool.testOnBorrow=true
torque.dsfactory.testDB.pool.minEvictableIdleTimeMillis=300000
torque.dsfactory.testDB.pool.timeBetweenEvictionRunsMillis=600000
torque.dsfactory.testDB.pool.defaultMaxIdle=10
torque.dsfactory.default.pool.validationQuery=SELECT sysdate from dual


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org