#37 ProxoolDataSource bug

closed-fixed
5
2007-05-15
2007-05-11
No

Hi,
If one wants to configure ProxoolDataSource, specifies user and password tags, and leaves delegateProperties tag empty, the user and password are not used due to the below source code:

private synchronized void registerPool() throws ProxoolException {
if (!ConnectionPoolManager.getInstance().isPoolExists(alias)) {
ConnectionPoolDefinition cpd = new ConnectionPoolDefinition();
cpd.setAlias(getAlias());
cpd.setDriver(getDriver());
cpd.setFatalSqlExceptionsAsString(getFatalSqlExceptionsAsString());
cpd.setFatalSqlExceptionWrapper(getFatalSqlExceptionWrapperClass());
cpd.setHouseKeepingSleepTime(getHouseKeepingSleepTime());
cpd.setHouseKeepingTestSql(getHouseKeepingTestSql());
cpd.setMaximumActiveTime(getMaximumActiveTime());
cpd.setMaximumConnectionCount(getMaximumConnectionCount());
cpd.setMaximumConnectionLifetime(getMaximumConnectionLifetime());
cpd.setMinimumConnectionCount(getMinimumConnectionCount());
cpd.setOverloadWithoutRefusalLifetime(getOverloadWithoutRefusalLifetime());
cpd.setPassword(getPassword());
cpd.setPrototypeCount(getPrototypeCount());
cpd.setRecentlyStartedThreshold(getRecentlyStartedThreshold());
cpd.setSimultaneousBuildThrottle(getSimultaneousBuildThrottle());
cpd.setStatistics(getStatistics());
cpd.setStatisticsLogLevel(getStatisticsLogLevel());
cpd.setTrace(isTrace());
cpd.setUrl(getDriverUrl());
cpd.setUser(getUser());
cpd.setVerbose(isVerbose());
cpd.setJmx(isJmx());
cpd.setJmxAgentId(getJmxAgentId());
cpd.setTestAfterUse(isTestAfterUse());
cpd.setTestBeforeUse(isTestBeforeUse());
cpd.setDelegateProperties(delegateProperties);
ProxoolFacade.registerConnectionPool(cpd);
}
}

As you can see, cpd.setDelegateProperties(delegateProperties);
is called *after* the cpd.setUser(getUser()); and cpd.setPassword(getPassword());.

setUser in turn adds a property entry in the delegateProperties.
So, when the delegateProperties tag is left empty, the user and password set via the user and password tags are cleared because delegateProperties are set to null.

Until the bug is corrected, in order for the current setup to work, the users have to specify bogus info in the setup and password tags (because empty tags cause an exception) and supply the real user and password information in the delegateProperties tag.

Regards,
Bulent Erdemir

Discussion

  • Bill Horsman

    Bill Horsman - 2007-05-15

    Logged In: YES
    user_id=91747
    Originator: NO

    Bulent, you're right. I've moved the setUser and setPassword methods to after the setDelegateProperties method. I've just committed a fix (move the setUser and setPassword after the setDelegateProperties) to CVS so that it can be part of 0.9.0. Thanks. Bill

     
  • Bill Horsman

    Bill Horsman - 2007-05-15
    • assigned_to: nobody --> billhorsman
    • status: open --> closed-fixed
     

Log in to post a comment.