Comment 5 for bug 540180

Revision history for this message
Oded Peer (oded-50) wrote :

You can work around this by changing the connection pool configuration programatically by adding your own plugin.
DBPlugin sets the configuration in onApplicationStart(), so in your plugin change the configuration in the afterApplicationStart() method, for example:

public class MyPlugin extends PlayPlugin {
 public void afterApplicationStart() {
  Properties p = Play.configuration;

  // change the main Play datasource configuration
  ComboPooledDataSource mainDataSource = (ComboPooledDataSource)DB.datasource;
  mainDataSource.setAcquireRetryAttempts( Integer.parseInt( p.getProperty( "db.retry.attempts", "2" ) ) );
  mainDataSource.setAcquireRetryDelay( Integer.parseInt( p.getProperty( "db.retry.delay", "200" ) ) );
  mainDataSource.setBreakAfterAcquireFailure( false );
        }
}