I'm running a series of performance tests as both a learning tool and to
assist our chief designer, and am converting our test suite from CMP to BMP.
I'm confused about how Orion manages jdbc connection pooling. The mail
archive discussion I found , from last November, is adding to the fog....
The following snippet from data-sources.xml would suggest that it's
possible to obtain either a pooled or non-pooled connection by using either
jdbc/DefaultDS or jdbc/DefaultPooledDS - but I'm getting similar benchmark
times using either one (by changing which line is commented in
getConnection, below).
Could someone tell me what is being returned by either of these, if I'm
headed in the right direction, and where to look if I'm not?
Thanks!
Kirk Yarina
<data-source
name="Default data-source"
class="com.evermind.sql.ConnectionDataSource"
location="jdbc/DefaultDS"
pooled-location="jdbc/DefaultPooledDS"
xa-location="jdbc/xa/DefaultXADS"
ejb-location="jdbc/DefaultEJBDS"
url="jdbc:HypersonicSQL:defaultdb"
connection-driver="org.hsql.jdbcDriver"
username="sa"
password=""
schema="database-schemas/hypersonic.xml"
/>
private Connection
getConnection()
{
// String dsName = "jdbc/DefaultPooledDS"; // Pooled connections?
String dsName = "jdbc/DefaultDS"; // non-pooled connections?
InitialContext initialContext = null;
try {
initialContext = new InitialContext();
}
catch ( Exception ex )
{
System.err.println( "-- Getting Initial Context --" );
ex.printStackTrace( System.err );
throw new EJBException
( "getting Sequence InitialContext, " + ex.getMessage() );
}
try {
DataSource ds =
(DataSource) initialContext.lookup( dsName );
return ds.getConnection();
}
catch ( Exception ex )
{
System.err.println
( "-- looking up DataSource '" + dsName + "' --" );
ex.printStackTrace( System.err );
throw new EJBException
( "looking up dsName '"
+ dsName + "', " + ex.getMessage() );
}
}
Kirk Yarina
[EMAIL PROTECTED]