Remove deprecated properties from AvailableSettings (#4362)

* Remove deprecated ACQUIRE_CONNECTIONS and RELEASE_CONNECTIONS from AvailableSettings

Signed-off-by: Jan Schatteman <jschatte@redhat.com>

* Remove deprecated PROXOOL_PREFIX and PREFER_POOLED_VALUES_LO from AvailableSettings

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2021-11-15 23:03:16 +01:00 committed by GitHub
parent 3e97b1c205
commit 37703e2e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 19 additions and 255 deletions

View File

@ -131,8 +131,6 @@ Doing so will lead to Hibernate executing SQL operations outside of any JDBC/SQL
`*hibernate.connection.handling_mode*`::
Specifies how Hibernate should manage JDBC connections in terms of acquiring and releasing.
This configuration property supersedes `*hibernate.connection.acquisition_mode*` and
`*hibernate.connection.release_mode*`.
+
The connection handling mode strategies are defined by the
https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/resource/jdbc/spi/PhysicalConnectionHandlingMode.html[`PhysicalConnectionHandlingMode`] enumeration.
@ -142,26 +140,6 @@ The configuration can be either a `PhysicalConnectionHandlingMode` reference or
For more details about the `PhysicalConnectionHandlingMode` and Hibernate connection handling, check out the
<<chapters/jdbc/Database_Access.adoc#database-connection-handling,Connection handling>> section.
[line-through]#`*hibernate.connection.acquisition_mode*`# (e.g. `immediate`)::
[NOTE]
====
This setting is deprecated. You should use the `*hibernate.connection.handling_mode*` instead.
====
Specifies how Hibernate should acquire JDBC connections. The possible values are given by `org.hibernate.ConnectionAcquisitionMode`.
Should generally only configure this or `hibernate.connection.release_mode`, not both.
[line-through]#`*hibernate.connection.release_mode*`# (e.g. `auto` (default value))::
[NOTE]
====
This setting is deprecated. You should use the `*hibernate.connection.handling_mode*` instead.
====
Specifies how Hibernate should release JDBC connections. The possible values are given by the current transaction mode (`after_transaction` for JDBC transactions and `after_statement` for JTA transactions).
Should generally only configure this or `hibernate.connection.acquisition_mode`, not both.
`*hibernate.connection.datasource*`::
Either a `javax.sql.DataSource` instance or a JNDI name under which to locate the `DataSource`.
+

View File

@ -646,8 +646,7 @@ public interface SessionFactoryBuilder {
*
* @return {@code this}, for method chaining
*
* @see org.hibernate.cfg.AvailableSettings#ACQUIRE_CONNECTIONS
* @see org.hibernate.cfg.AvailableSettings#RELEASE_CONNECTIONS
* @see org.hibernate.cfg.AvailableSettings#CONNECTION_HANDLING
* @see org.hibernate.ConnectionAcquisitionMode
* @see ConnectionReleaseMode
*/

View File

@ -78,7 +78,6 @@ import org.hibernate.type.FormatMapper;
import org.hibernate.type.JacksonJsonFormatMapper;
import org.hibernate.type.JsonBJsonFormatMapper;
import static org.hibernate.cfg.AvailableSettings.ACQUIRE_CONNECTIONS;
import static org.hibernate.cfg.AvailableSettings.ALLOW_JTA_TRANSACTION_ACCESS;
import static org.hibernate.cfg.AvailableSettings.ALLOW_REFRESH_DETACHED_ENTITY;
import static org.hibernate.cfg.AvailableSettings.ALLOW_UPDATE_OUTSIDE_TRANSACTION;
@ -119,7 +118,6 @@ import static org.hibernate.cfg.AvailableSettings.QUERY_CACHE_FACTORY;
import static org.hibernate.cfg.AvailableSettings.QUERY_STARTUP_CHECKING;
import static org.hibernate.cfg.AvailableSettings.QUERY_STATISTICS_MAX_SIZE;
import static org.hibernate.cfg.AvailableSettings.QUERY_SUBSTITUTIONS;
import static org.hibernate.cfg.AvailableSettings.RELEASE_CONNECTIONS;
import static org.hibernate.cfg.AvailableSettings.SESSION_FACTORY_NAME;
import static org.hibernate.cfg.AvailableSettings.SESSION_FACTORY_NAME_IS_JNDI;
import static org.hibernate.cfg.AvailableSettings.SESSION_SCOPED_INTERCEPTOR;
@ -744,7 +742,6 @@ public class SessionFactoryOptionsBuilder implements SessionFactoryOptions {
};
}
@SuppressWarnings("deprecation")
private PhysicalConnectionHandlingMode interpretConnectionHandlingMode(
Map configurationSettings,
StandardServiceRegistry serviceRegistry) {
@ -756,55 +753,10 @@ public class SessionFactoryOptionsBuilder implements SessionFactoryOptions {
return specifiedHandlingMode;
}
final TransactionCoordinatorBuilder transactionCoordinatorBuilder = serviceRegistry.getService( TransactionCoordinatorBuilder.class );
// see if the deprecated ConnectionAcquisitionMode/ConnectionReleaseMode were used..
final ConnectionAcquisitionMode specifiedAcquisitionMode = ConnectionAcquisitionMode.interpret(
configurationSettings.get( ACQUIRE_CONNECTIONS )
);
final ConnectionReleaseMode specifiedReleaseMode = ConnectionReleaseMode.interpret(
configurationSettings.get( RELEASE_CONNECTIONS )
);
if ( specifiedAcquisitionMode != null || specifiedReleaseMode != null ) {
return interpretConnectionHandlingMode( specifiedAcquisitionMode, specifiedReleaseMode, configurationSettings, transactionCoordinatorBuilder );
}
return transactionCoordinatorBuilder.getDefaultConnectionHandlingMode();
}
@SuppressWarnings("deprecation")
private PhysicalConnectionHandlingMode interpretConnectionHandlingMode(
ConnectionAcquisitionMode specifiedAcquisitionMode,
ConnectionReleaseMode specifiedReleaseMode,
Map configurationSettings,
TransactionCoordinatorBuilder transactionCoordinatorBuilder) {
DEPRECATION_LOGGER.logUseOfDeprecatedConnectionHandlingSettings();
final ConnectionAcquisitionMode effectiveAcquisitionMode = specifiedAcquisitionMode == null
? ConnectionAcquisitionMode.AS_NEEDED
: specifiedAcquisitionMode;
final ConnectionReleaseMode effectiveReleaseMode;
if ( specifiedReleaseMode == null ) {
// check the actual setting. If we get in here it *should* be "auto" or null
final String releaseModeName = ConfigurationHelper.getString( RELEASE_CONNECTIONS, configurationSettings, "auto" );
assert "auto".equalsIgnoreCase( releaseModeName );
// nothing was specified (or someone happened to configure the "magic" value)
if ( effectiveAcquisitionMode == ConnectionAcquisitionMode.IMMEDIATELY ) {
effectiveReleaseMode = ConnectionReleaseMode.ON_CLOSE;
}
else {
effectiveReleaseMode = transactionCoordinatorBuilder.getDefaultConnectionReleaseMode();
}
}
else {
effectiveReleaseMode = specifiedReleaseMode;
}
return PhysicalConnectionHandlingMode.interpret( effectiveAcquisitionMode, effectiveReleaseMode );
}
private static FormatMapper determineJsonFormatMapper(Object setting, StrategySelector strategySelector) {
return strategySelector.resolveDefaultableStrategy(
FormatMapper.class,

View File

@ -853,33 +853,8 @@ public interface AvailableSettings {
*/
String FLUSH_BEFORE_COMPLETION = "hibernate.transaction.flush_before_completion";
/**
* Specifies how Hibernate should acquire JDBC connections. Should generally only configure
* this or {@link #RELEASE_CONNECTIONS}, not both
*
* @see org.hibernate.ConnectionAcquisitionMode
*
* @since 5.1
*
* @deprecated (since 5.2) use {@link #CONNECTION_HANDLING} instead
*/
@Deprecated
String ACQUIRE_CONNECTIONS = "hibernate.connection.acquisition_mode";
/**
* Specifies how Hibernate should release JDBC connections. Should generally only configure
* this or {@link #ACQUIRE_CONNECTIONS}, not both
*
* @see org.hibernate.ConnectionReleaseMode
*
* @deprecated (since 5.2) use {@link #CONNECTION_HANDLING} instead
*/
@Deprecated
String RELEASE_CONNECTIONS = "hibernate.connection.release_mode";
/**
* Specifies how Hibernate should manage JDBC connections in terms of acquiring and releasing.
* Supersedes {@link #ACQUIRE_CONNECTIONS} and {@link #RELEASE_CONNECTIONS}
*
* @see org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode
*
@ -1182,13 +1157,6 @@ public interface AvailableSettings {
*/
String PROXOOL_CONFIG_PREFIX = "hibernate.proxool";
/**
* Proxool/Hibernate property prefix
* @deprecated Use {@link #PROXOOL_CONFIG_PREFIX} instead
*/
@Deprecated
String PROXOOL_PREFIX = PROXOOL_CONFIG_PREFIX;
/**
* Proxool property to configure the Proxool Provider using an XML (<tt>/path/to/file.xml</tt>)
*/
@ -1328,15 +1296,6 @@ public interface AvailableSettings {
String JPAQL_STRICT_COMPLIANCE= "hibernate.query.jpaql_strict_compliance";
/**
* When using pooled {@link org.hibernate.id.enhanced.Optimizer optimizers}, prefer interpreting the
* database value as the lower (lo) boundary. The default is to interpret it as the high boundary.
*
* @deprecated Use {@link #PREFERRED_POOLED_OPTIMIZER} instead
*/
@Deprecated
String PREFER_POOLED_VALUES_LO = "hibernate.id.optimizer.pooled.prefer_lo";
/**
* When a generator specified an increment-size and an optimizer was not explicitly specified, which of
* the "pooled" optimizers should be preferred? Can specify an optimizer short name or an Optimizer

View File

@ -247,7 +247,7 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
@Override
public void afterStatementExecution() {
final ConnectionReleaseMode connectionReleaseMode = getConnectionReleaseMode();
final ConnectionReleaseMode connectionReleaseMode = getLogicalConnection().getConnectionHandlingMode().getReleaseMode();
LOG.tracev( "Starting after statement execution processing [{0}]", connectionReleaseMode );
if ( connectionReleaseMode == ConnectionReleaseMode.AFTER_STATEMENT ) {
if ( ! releasesEnabled ) {
@ -265,9 +265,10 @@ public class JdbcCoordinatorImpl implements JdbcCoordinator {
@Override
public void afterTransaction() {
transactionTimeOutInstant = -1;
if ( getConnectionReleaseMode() == ConnectionReleaseMode.AFTER_STATEMENT ||
getConnectionReleaseMode() == ConnectionReleaseMode.AFTER_TRANSACTION ||
getConnectionReleaseMode() == ConnectionReleaseMode.BEFORE_TRANSACTION_COMPLETION ) {
ConnectionReleaseMode connectionReleaseMode = getLogicalConnection().getConnectionHandlingMode().getReleaseMode();
if ( connectionReleaseMode == ConnectionReleaseMode.AFTER_STATEMENT ||
connectionReleaseMode == ConnectionReleaseMode.AFTER_TRANSACTION ||
connectionReleaseMode == ConnectionReleaseMode.BEFORE_TRANSACTION_COMPLETION ) {
this.logicalConnection.afterTransaction();
}
}

View File

@ -161,30 +161,6 @@ public interface JdbcCoordinator extends Serializable, TransactionCoordinatorOwn
*/
boolean isReadyForSerialization();
/**
* The release mode under which this logical connection is operating.
*
* @return the release mode.
*
* @deprecated (since 5.2) use {@link PhysicalConnectionHandlingMode} via {@link #getLogicalConnection} instead
*/
@Deprecated
default ConnectionReleaseMode getConnectionReleaseMode() {
return getLogicalConnection().getConnectionHandlingMode().getReleaseMode();
}
/**
* The mode for physical handling of the JDBC Connection
*
* @return The JDBC Connection handlng mode
*
* @deprecated (since 5.2) access via {@link #getLogicalConnection} instead
*/
@Deprecated
default PhysicalConnectionHandlingMode getConnectionHandlingMode() {
return getLogicalConnection().getConnectionHandlingMode();
}
/**
* @deprecated (since 5.2) access via {@link #getLogicalConnection} instead
*/

View File

@ -104,51 +104,6 @@ public class OptimizerFactory {
return optimizer;
}
/**
* Deprecated!
*
* @deprecated Use {@link StandardOptimizerDescriptor#getExternalName()} via {@link StandardOptimizerDescriptor#NONE}
*/
@Deprecated
@SuppressWarnings( {"UnusedDeclaration"})
public static final String NONE = StandardOptimizerDescriptor.NONE.getExternalName();
/**
* Deprecated!
*
* @deprecated Use {@link StandardOptimizerDescriptor#getExternalName()} via {@link StandardOptimizerDescriptor#HILO}
*/
@Deprecated
@SuppressWarnings( {"UnusedDeclaration"})
public static final String HILO = StandardOptimizerDescriptor.HILO.getExternalName();
/**
* Deprecated!
*
* @deprecated Use {@link StandardOptimizerDescriptor#getExternalName()} via {@link StandardOptimizerDescriptor#LEGACY_HILO}
*/
@Deprecated
@SuppressWarnings( {"UnusedDeclaration"})
public static final String LEGACY_HILO = "legacy-hilo";
/**
* Deprecated!
*
* @deprecated Use {@link StandardOptimizerDescriptor#getExternalName()} via {@link StandardOptimizerDescriptor#POOLED}
*/
@Deprecated
@SuppressWarnings( {"UnusedDeclaration"})
public static final String POOL = "pooled";
/**
* Deprecated!
*
* @deprecated Use {@link StandardOptimizerDescriptor#getExternalName()} via {@link StandardOptimizerDescriptor#POOLED_LO}
*/
@Deprecated
@SuppressWarnings( {"UnusedDeclaration"})
public static final String POOL_LO = "pooled-lo";
/**
* Determine the optimizer to use when there was not one explicitly specified.
*/
@ -163,10 +118,8 @@ public class OptimizerFactory {
return preferredPooledOptimizerStrategy;
}
// otherwise fallback to the fallback strategy (considering the deprecated PREFER_POOLED_VALUES_LO setting)
return ConfigurationHelper.getBoolean( AvailableSettings.PREFER_POOLED_VALUES_LO, configSettings, false )
? StandardOptimizerDescriptor.POOLED_LO.getExternalName()
: StandardOptimizerDescriptor.POOLED.getExternalName();
// otherwise fallback to the fallback strategy
return StandardOptimizerDescriptor.POOLED.getExternalName();
}
private OptimizerFactory() {

View File

@ -69,16 +69,6 @@ public class JdbcSessionContextImpl implements JdbcSessionContext {
return settings().doesConnectionProviderDisableAutoCommit();
}
@Override
public ConnectionReleaseMode getConnectionReleaseMode() {
return connectionHandlingMode.getReleaseMode();
}
@Override
public ConnectionAcquisitionMode getConnectionAcquisitionMode() {
return connectionHandlingMode.getAcquisitionMode();
}
@Override
public StatementInspector getStatementInspector() {
return statementInspector;

View File

@ -224,14 +224,6 @@ public interface DeprecationLogger extends BasicLogger {
)
void deprecatedLegacyCriteria();
@LogMessage(level = WARN)
@Message(
id = 90000023,
value = "Encountered use of deprecated Connection handling settings [hibernate.connection.acquisition_mode]" +
"or [hibernate.connection.release_mode]; use [hibernate.connection.handling_mode] instead"
)
void logUseOfDeprecatedConnectionHandlingSettings();
@LogMessage(level = WARN)
@Message(
id = 90000024,

View File

@ -367,10 +367,6 @@ public abstract class SimpleValue implements KeyValue {
final ConfigurationService cs = metadata.getMetadataBuildingOptions().getServiceRegistry()
.getService( ConfigurationService.class );
params.put(
AvailableSettings.PREFER_POOLED_VALUES_LO,
cs.getSetting( AvailableSettings.PREFER_POOLED_VALUES_LO, StandardConverters.BOOLEAN, false )
);
params.put(
IdentifierGenerator.CONTRIBUTOR_NAME,
buildingContext.getCurrentContributorName()

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.resource.jdbc.spi;
import org.hibernate.ConnectionAcquisitionMode;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.service.ServiceRegistry;
@ -25,18 +23,6 @@ public interface JdbcSessionContext {
boolean doesConnectionProviderDisableAutoCommit();
/**
* @deprecated Use {@link #getPhysicalConnectionHandlingMode} instead
*/
@Deprecated
ConnectionReleaseMode getConnectionReleaseMode();
/**
* @deprecated Use {@link #getPhysicalConnectionHandlingMode} instead
*/
@Deprecated
ConnectionAcquisitionMode getConnectionAcquisitionMode();
StatementInspector getStatementInspector();
JdbcObserver getObserver();

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.resource.transaction.spi;
import org.hibernate.ConnectionAcquisitionMode;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl;
import org.hibernate.resource.transaction.backend.jta.internal.DdlTransactionIsolatorJtaImpl;
@ -40,22 +38,6 @@ public interface TransactionCoordinatorBuilder extends Service {
PhysicalConnectionHandlingMode getDefaultConnectionHandlingMode();
/**
* @deprecated (since 5.2) Use {@link #getDefaultConnectionHandlingMode} instead
*/
@Deprecated
default ConnectionAcquisitionMode getDefaultConnectionAcquisitionMode() {
return getDefaultConnectionHandlingMode().getAcquisitionMode();
}
/**
* @deprecated (since 5.2) Use {@link #getDefaultConnectionHandlingMode} instead
*/
@Deprecated
default ConnectionReleaseMode getDefaultConnectionReleaseMode() {
return getDefaultConnectionHandlingMode().getReleaseMode();
}
default DdlTransactionIsolator buildDdlTransactionIsolator(JdbcContext jdbcContext) {
return isJta() ? new DdlTransactionIsolatorJtaImpl( jdbcContext ) : new DdlTransactionIsolatorNonJtaImpl( jdbcContext );
}

View File

@ -13,7 +13,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.ScrollableResults;
import org.hibernate.Session;
import org.hibernate.cfg.AvailableSettings;
@ -21,6 +20,7 @@ import org.hibernate.cfg.Environment;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl;
import org.hibernate.stat.Statistics;
@ -48,7 +48,7 @@ public class AggressiveReleaseTest extends ConnectionManagementTestCase {
TestingJtaBootstrap.prepare( settings );
// settings.put( Environment.TRANSACTION_STRATEGY, CMTTransactionFactory.class.getName() );
settings.put( AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY, JtaTransactionCoordinatorBuilderImpl.class.getName() );
settings.put( Environment.RELEASE_CONNECTIONS, ConnectionReleaseMode.AFTER_STATEMENT.toString() );
settings.put( Environment.CONNECTION_HANDLING, PhysicalConnectionHandlingMode.DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT.toString() );
settings.put( Environment.GENERATE_STATISTICS, "true" );
settings.put( Environment.STATEMENT_BATCH_SIZE, "0" );
}

View File

@ -8,10 +8,10 @@ package org.hibernate.orm.test.connections;
import java.util.Map;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.Session;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.hibernate.testing.RequiresDialect;
@ -37,6 +37,6 @@ public class BasicConnectionProviderTest extends ConnectionManagementTestCase {
@SuppressWarnings("unchecked")
protected void addSettings(Map settings) {
super.addSettings( settings );
settings.put( Environment.RELEASE_CONNECTIONS, ConnectionReleaseMode.ON_CLOSE.toString() );
settings.put( Environment.CONNECTION_HANDLING, PhysicalConnectionHandlingMode.DELAYED_ACQUISITION_AND_HOLD.toString() );
}
}

View File

@ -12,12 +12,12 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.Session;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.engine.jdbc.connections.internal.UserSuppliedConnectionProviderImpl;
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.hibernate.service.spi.Stoppable;
import org.hibernate.tool.schema.internal.SchemaCreatorImpl;
import org.hibernate.tool.schema.internal.SchemaDropperImpl;
@ -81,7 +81,7 @@ public class SuppliedConnectionTest extends ConnectionManagementTestCase {
protected void addSettings(Map settings) {
super.addSettings( settings );
settings.put( Environment.RELEASE_CONNECTIONS, ConnectionReleaseMode.ON_CLOSE.toString() );
settings.put( Environment.CONNECTION_HANDLING, PhysicalConnectionHandlingMode.DELAYED_ACQUISITION_AND_HOLD.toString() );
settings.put( Environment.CONNECTION_PROVIDER, UserSuppliedConnectionProviderImpl.class.getName() );
Connection connection;

View File

@ -348,7 +348,7 @@ public class SequenceStyleConfigUnitTest {
assertClassAssignability( SequenceStructure.class, generator.getDatabaseStructure().getClass() );
assertClassAssignability( PooledOptimizer.class, generator.getOptimizer().getClass() );
props.setProperty( Environment.PREFER_POOLED_VALUES_LO, "true" );
props.setProperty( Environment.PREFERRED_POOLED_OPTIMIZER, StandardOptimizerDescriptor.POOLED_LO.getExternalName() );
generator = new SequenceStyleGenerator();
generator.configure(
new TypeConfiguration().getBasicTypeRegistry()

View File

@ -6,12 +6,12 @@
*/
package org.hibernate.test.multitenancy;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.MultiTenancyStrategy;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Environment;
import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.hibernate.service.spi.ServiceException;
import org.hibernate.service.spi.ServiceRegistryImplementor;
@ -54,7 +54,7 @@ public class ConfigurationValidationTest extends BaseUnitTestCase {
try {
serviceRegistry = (ServiceRegistryImplementor) new StandardServiceRegistryBuilder()
.applySetting( Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA )
.applySetting( Environment.RELEASE_CONNECTIONS, ConnectionReleaseMode.AFTER_STATEMENT.name() )
.applySetting( Environment.CONNECTION_HANDLING, PhysicalConnectionHandlingMode.DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT.name() )
.addService(
MultiTenantConnectionProvider.class,
new TestingConnectionProvider(

View File

@ -10,11 +10,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.ScrollableResults;
import org.hibernate.Session;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl;
import org.hibernate.testing.DialectChecks;
@ -49,7 +49,7 @@ public class CMTTest extends BaseNonConfigCoreFunctionalTestCase {
settings.put( AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY, JtaTransactionCoordinatorBuilderImpl.class.getName() );
settings.put( AvailableSettings.AUTO_CLOSE_SESSION, "true" );
settings.put( AvailableSettings.FLUSH_BEFORE_COMPLETION, "true" );
settings.put( AvailableSettings.RELEASE_CONNECTIONS, ConnectionReleaseMode.AFTER_STATEMENT.toString() );
settings.put( AvailableSettings.CONNECTION_HANDLING, PhysicalConnectionHandlingMode.DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT.toString() );
settings.put( AvailableSettings.GENERATE_STATISTICS, "true" );
settings.put( AvailableSettings.USE_QUERY_CACHE, "true" );
settings.put( AvailableSettings.CACHE_REGION_PREFIX, "" );