0

I use Proxool 0.9.1.

Since Hibernate 4.x, ProxoolConnectionProvider had been moved to org.hibernate.service.jdbc.connections.internal packet (in jar: ${hibernate-release-4.x}/lib/optional/proxool/hibernate-proxool-4.x.jar).

When I upgrade to 4.x from 3.x (the configuration did not change), it always tells me

Exception: the url can not be null

...so I traced the Hibernate source code and found that the method public void configure(Properties props) in ProxoolConnectionProvider has never been called, so all attributes in ProxoolConnectionProvider are null.

Can anyone help me resolve this problem?

Joachim Isaksson
  • 176,943
  • 25
  • 281
  • 294
Shvalb
  • 1,835
  • 2
  • 30
  • 60

1 Answers1

0

This occurs due to a bug in Hibernate 4.x (HHH-7289)

You can work around the issue by extending org.hibernate.service.jdbc.connections.internal.ProxoolConnectionProvider and implementing the org.hibernate.service.spi.Configurable interface. For example:

public class ConfigurableProxoolConnectionProvider extends ProxoolConnectionProvider implements Configurable
    @Override
    public void configure( final Map configurationValues ) {
        final Map<?,?> configuration = (Map<?,?>) configurationValues;
        final Properties properties = new Properties( );
        for ( final Map.Entry entry : configuration.entrySet() ) {
            properties.setProperty(
                String.valueOf( entry.getKey() ),
                String.valueOf( entry.getValue() ) );
        }       
        super.configure( properties );
    }
}

Then reference the extending class (e.g. xxx.yyy.ConfigurableProxoolConnectionProvider) in your hibernate properties under 'hibernate.connection.provider_class'.

sjones4
  • 146
  • 1