I committed a first pass at this. I added a DataSourcePlugin (not
sure I like the name) interface and implementations for HSQLDB,
InstantDB and Derby. The actual implementation is chosen using xbean-
finder. We look for a file in the classpath with the name META-INF/
org.apache.openejb.resource.jdbc.DataSourcePlugin/${jdbcVendor} and
in that file is a single line containing the name of the
implementation class. The jdbcVendor name comes from the jdbc url
specified in the datasource configuration using the pattern jdbc:$
{jdbcVendor}:jdbc-properties
Anyway, please take a look (especially David B), and let me know what
you think.
-dain
On Jul 16, 2007, at 2:32 PM, Dain Sundstrom wrote:
When making the change to DBCP I missed the HsqldbPathHack,
InstantdbPropertiesHack, DerbySystemHomeHack, and
ManagedConnectionFactoryPathHack classes in the resource.jdbc
package. These classes tweak the system so that the databases
created by Java DBs like HSQL, InstantDB and Derby are created
inside of the server installation instead of the directory where
you started OpenEJB.
I'm going to move the code from JdbcManagedConnectionFactory (and
the classes above) to work in Basic[Managed]
DataSource.createDataSource(). If possible, I'd like to make this
code be finder based instead of hard coded, so as new Java
databases are added (like H2) we don't have to change the server code.
Anyway, for the time being databases may be created in the wrong
place.
-dain