/**
* If using a XAConnection underneath.
*/
- private volatile javax.sql.XAConnection xaConnection;
+ protected volatile javax.sql.XAConnection xaConnection;
/**
* When we track abandon traces, this string holds the thread dump
*/
private volatile boolean suspect = false;
+ private java.sql.Driver driver = null;
+
/**
* Constructor
* @param prop - pool properties
}
}
protected void connectUsingDriver() throws SQLException {
- java.sql.Driver driver = null;
+
try {
- driver = (java.sql.Driver) Class.forName(poolProperties.getDriverClassName(),
- true, PooledConnection.class.getClassLoader()).newInstance();
+ if (driver==null)
+ driver = (java.sql.Driver) Class.forName(poolProperties.getDriverClassName(),
+ true, PooledConnection.class.getClassLoader()
+ ).newInstance();
} catch (java.lang.Exception cn) {
if (log.isDebugEnabled()) {
log.debug("Unable to instantiate JDBC driver.", cn);
public class AlternateUsernameTest extends DefaultTestCase {
- private static final int iterations = (new Random(System.currentTimeMillis())).nextInt(1000000)+100000;
+ private static final int iterations = 500000; //(new Random(System.currentTimeMillis())).nextInt(1000000)+100000;
public AlternateUsernameTest(String name) {
super(name);
}
private void testUsername(boolean allowUsernameChange) throws Exception {
long start = System.currentTimeMillis();
+ int withoutuser =10;
+ int withuser = withoutuser;
this.init();
+ this.datasource.setMaxActive(withuser+withoutuser);
this.datasource.setDriverClassName(Driver.class.getName());
this.datasource.setUrl("jdbc:tomcat:test");
this.datasource.setAlternateUsernameAllowed(allowUsernameChange);
this.datasource.getConnection().close();
- int withoutuser =10;
- int withuser = withoutuser;
+
TestRunner[] runners = new TestRunner[withuser+withoutuser];
for (int i=0; i<withuser; i++) {
TestRunner with = new TestRunner("foo","bar",datasource.getPoolProperties().getUsername(),datasource.getPoolProperties().getPassword());