db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramesh Sabeti" ...@reazon.com>
Subject Torque JDBC2 Pool hangs w/ Oracle
Date Thu, 11 Dec 2003 18:16:31 GMT
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


Mime
View raw message