[Biojava-dev] BioSQL Connection Pooling

Simon Foote simon.foote at nrc-cnrc.gc.ca
Thu Jul 10 11:01:53 EDT 2003


I've made some modifications to the connection pooling for the BioSQL 
implementation and was wondering if there would be any objections to the 
following:

Change#1:  
Changed from the simple JDBCConnectionPool that Thomas had written to 
using the apache jakarta commons DBCP and POOL packages to provide this 
support.

Reason:
More robust system and also allows for change #2 to work correctly

Change#2:
Modified all the BioSQL implementation packages to use the above pooling 
system via DataSources

Reason:
Allows developers to either use  the jakarta pooling system  (should 
work almost transparently, ala the original JDBCConnectionPool)  when 
creating a BioSQLSequenceDB or they can create the DB using their own 
pooling system by passing in a DataSource instead of a driver.  This 2nd 
option also allows for easy integration into webapps where the 
application server provides its own pooling system.

Code breakage issue: (Although, since the support is fairly recent for 
the latest schema, shouldn't be a big problem)
Instead of initiating a DB driver instance before creating the 
BioSQLSequenceDB, one only has to pass in the name of the driver in the 
constructor instead.  The old constructor will throw this as an 
exception, so should be self-evident as to what has to be done.

Package additions:
commons-dbcp.jar, commons-pool.jar from the Apache Jakarta Project
As biojava already has the commons-cli.jar included and the 
LICENSE.COMMONS, I don't see a problem.  I will also add the specfics to 
the README like was done for the cli package.

Thoughts and/or comments before CVS commit,
Simon Foote

-- 
Bioinformatics Specialist
Institute for Biological Sciences
National Research Council of Canada
[T] 613-990-0561  [F] 613-952-9092
simon.foote at nrc-cnrc.gc.ca




More information about the biojava-dev mailing list