Subject | Re: FBWrappingDataSource problems... |
---|---|
Author | Mandip S. Sangha |
Post date | 2002-09-25T10:24:01Z |
Hi All
I've put the following code from TestFBWrappingDataSource into a main
method:
ds = new FBWrappingDataSource();
ds.setDatabaseName(DB_DATASOURCE_URL);
ds.setMinSize(3);
ds.setMaxSize(5);
ds.setBlockingTimeout(100);
ds.setIdleTimeout(1000);
ds.setPooling(true);
connection = ds.getConnection(DB_USER, DB_PASSWORD);
//connection.setAutoCommit(false);
assertTrue("Connection is null", connection != null);
Statement s = connection.createStatement();
Exception ex = null;
try {
s.execute("CREATE TABLE T1 ( C1 SMALLINT, C2 SMALLINT)");
//s.close();
ResultSet rs = s.executeQuery("select * from T1");
rs.close();
}
catch (Exception e) {
ex = e;
}
//connection.commit();
s.execute("DROP TABLE T1");
s.close();
//connection.commit();
connection.close()
Everything works fine except that the main methoed does not exit at the
end but just hangs instead. I've looked at the FBWrappingDataSource and
FBSimpleDataSource code to see if there is anything that I could close
but found nothing. Any comments or suggestions would be appreciated.
Regards
Mandip
BTW I checked out a copy of client-java yesterday morning
I've put the following code from TestFBWrappingDataSource into a main
method:
ds = new FBWrappingDataSource();
ds.setDatabaseName(DB_DATASOURCE_URL);
ds.setMinSize(3);
ds.setMaxSize(5);
ds.setBlockingTimeout(100);
ds.setIdleTimeout(1000);
ds.setPooling(true);
connection = ds.getConnection(DB_USER, DB_PASSWORD);
//connection.setAutoCommit(false);
assertTrue("Connection is null", connection != null);
Statement s = connection.createStatement();
Exception ex = null;
try {
s.execute("CREATE TABLE T1 ( C1 SMALLINT, C2 SMALLINT)");
//s.close();
ResultSet rs = s.executeQuery("select * from T1");
rs.close();
}
catch (Exception e) {
ex = e;
}
//connection.commit();
s.execute("DROP TABLE T1");
s.close();
//connection.commit();
connection.close()
Everything works fine except that the main methoed does not exit at the
end but just hangs instead. I've looked at the FBWrappingDataSource and
FBSimpleDataSource code to see if there is anything that I could close
but found nothing. Any comments or suggestions would be appreciated.
Regards
Mandip
BTW I checked out a copy of client-java yesterday morning