HHH-12313: org.hibernate.jpa.test.transaction.TransactionCommitFailureTest fails on HANA

This commit is contained in:
Jonathan Bregler 2018-02-21 09:37:48 +01:00 committed by Vlad Mihalcea
parent 94fe106fb5
commit 17bd61033d
2 changed files with 13 additions and 5 deletions

View File

@ -72,6 +72,8 @@ import org.hibernate.exception.LockAcquisitionException;
import org.hibernate.exception.LockTimeoutException;
import org.hibernate.exception.SQLGrammarException;
import org.hibernate.exception.spi.SQLExceptionConversionDelegate;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.util.JdbcExceptionHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Table;
@ -109,6 +111,8 @@ import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor;
*/
public abstract class AbstractHANADialect extends Dialect {
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( AbstractHANADialect.class );
private static final AbstractLimitHandler LIMIT_HANDLER = new AbstractLimitHandler() {
@Override
@ -1497,8 +1501,11 @@ public abstract class AbstractHANADialect extends Dialect {
}
}
}
catch (SQLException e) {
// ignore
catch (Exception e) {
LOG.debug(
"An error occurred while trying to determing the value of the HANA parameter indexserver.ini / session / max_lob_prefetch_size. Using the default value "
+ maxLobPrefetchSizeDefault,
e );
}
finally {
if ( conn != null ) {

View File

@ -21,7 +21,6 @@ import org.hibernate.cfg.Environment;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl;
import org.hibernate.jpa.boot.spi.Bootstrap;
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.jpa.test.PersistenceUnitDescriptorAdapter;
import org.hibernate.jpa.test.SettingsGenerator;
@ -48,10 +47,12 @@ public class TransactionCommitFailureTest extends BaseUnitTestCase {
@Before
public void setUp() {
final Map settings = basicSettings();
emf = Bootstrap.getEntityManagerFactoryBuilder( new PersistenceUnitDescriptorAdapter(), settings ).build();
// static variables need to be initialized before the EMF is set up, because they can be referenced during EMF setup via the connection provider.
transactionFailureTrigger = new AtomicBoolean();
connectionIsOpen = new AtomicBoolean();
final Map settings = basicSettings();
emf = Bootstrap.getEntityManagerFactoryBuilder( new PersistenceUnitDescriptorAdapter(), settings ).build();
}
@After