db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl <thomas.vand...@tewisoft.de>
Subject JndiDataSourceFactory
Date Wed, 06 Oct 2004 07:43:30 GMT
Hi there,

I was trying to use JndiDataSourceFactory in my project to keep the
configuration together. I found, however, that the database handling is
much slower that with dbcp. In the code I saw that in all other
DataSource-Factories the ds-object is cached. Not so in
JndiDataSourceFactory. Does this serve a purpose?

Anything against this fix?
	/** A locally cached copy of the DataSource */
	private DataSource ds = null;

      * @see org.apache.torque.dsfactory.DataSourceFactory#getDataSource
     public DataSource getDataSource() throws TorqueException
     	if (ds == null)
			ds = ((DataSource) ctx.lookup(path));
		catch (Exception e)
			throw new TorqueException(e);

         return ds;

I could see no side effects during testing but nmuch improved
performance. Do I miss something?

Bye, Thomas Vandahl.

To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message