Thomas Vandahl wrote:

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?
-8<-
    /** 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)
        {
        try
        {
            ds = ((DataSource) ctx.lookup(path));
        }
        catch (Exception e)
        {
            throw new TorqueException(e);
        }
        }

        return ds;
    }
-8<-

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

Seems reasonable to me. I'll add it to the small list of items to be addressed for 3.1.1-rc3.


Scott

--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to