if ( statementFetchSize != null && debugEnabled ) {
LOG.debugf( "JDBC result set fetch size: %s", statementFetchSize );
}
settings.setJdbcFetchSize(statementFetchSize);
MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
if ( debugEnabled ) {
LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
}
settings.setMultiTenancyStrategy( multiTenancyStrategy );
String releaseModeName = ConfigurationHelper.getString( AvailableSettings.RELEASE_CONNECTIONS, properties, "auto" );
if ( debugEnabled ) {
LOG.debugf( "Connection release mode: %s", releaseModeName );
}
ConnectionReleaseMode releaseMode;
if ( "auto".equals(releaseModeName) ) {
releaseMode = serviceRegistry.getService( TransactionFactory.class ).getDefaultReleaseMode();
}
else {
releaseMode = ConnectionReleaseMode.parse( releaseModeName );
if ( releaseMode == ConnectionReleaseMode.AFTER_STATEMENT ) {
// we need to make sure the underlying JDBC connection access supports aggressive release...
boolean supportsAgrressiveRelease = multiTenancyStrategy.requiresMultiTenantConnectionProvider()
? serviceRegistry.getService( MultiTenantConnectionProvider.class ).supportsAggressiveRelease()
: serviceRegistry.getService( ConnectionProvider.class ).supportsAggressiveRelease();
if ( ! supportsAgrressiveRelease ) {
LOG.unsupportedAfterStatement();
releaseMode = ConnectionReleaseMode.AFTER_TRANSACTION;