Search in sources :

Example 1 with SharedSessionContractImplementor

use of org.hibernate.engine.spi.SharedSessionContractImplementor in project hibernate-orm by hibernate.

the class AuditProcessManager method get.

public AuditProcess get(EventSource session) {
    final Transaction transaction = session.accessTransaction();
    AuditProcess auditProcess = auditProcesses.get(transaction);
    if (auditProcess == null) {
        // No worries about registering a transaction twice - a transaction is single thread
        auditProcess = new AuditProcess(revisionInfoGenerator, session);
        auditProcesses.put(transaction, auditProcess);
        session.getActionQueue().registerProcess(new BeforeTransactionCompletionProcess() {

            public void doBeforeTransactionCompletion(SessionImplementor session) {
                final AuditProcess process = auditProcesses.get(transaction);
                if (process != null) {
                    process.doBeforeTransactionCompletion(session);
                }
            }
        });
        session.getActionQueue().registerProcess(new AfterTransactionCompletionProcess() {

            public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session) {
                auditProcesses.remove(transaction);
            }
        });
    }
    return auditProcess;
}
Also used : BeforeTransactionCompletionProcess(org.hibernate.action.spi.BeforeTransactionCompletionProcess) Transaction(org.hibernate.Transaction) AfterTransactionCompletionProcess(org.hibernate.action.spi.AfterTransactionCompletionProcess) SessionImplementor(org.hibernate.engine.spi.SessionImplementor) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor)

Example 2 with SharedSessionContractImplementor

use of org.hibernate.engine.spi.SharedSessionContractImplementor in project hibernate-orm by hibernate.

the class PutFromLoadValidator method registerRemoteInvalidation.

public boolean registerRemoteInvalidation(Object key, Object lockOwner) {
    SharedSessionContractImplementor session = currentSession.get();
    TransactionCoordinator transactionCoordinator = session == null ? null : session.getTransactionCoordinator();
    if (transactionCoordinator != null) {
        if (trace) {
            log.tracef("Registering synchronization on transaction in %s, cache %s: %s", lockOwnerToString(session), cache.getName(), key);
        }
        InvalidationSynchronization sync = new InvalidationSynchronization(nonTxPutFromLoadInterceptor, key, lockOwner);
        transactionCoordinator.getLocalSynchronizations().registerSynchronization(sync);
        return true;
    }
    // evict() command is not executed in session context
    return false;
}
Also used : TransactionCoordinator(org.hibernate.resource.transaction.spi.TransactionCoordinator) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor)

Example 3 with SharedSessionContractImplementor

use of org.hibernate.engine.spi.SharedSessionContractImplementor in project hibernate-orm by hibernate.

the class AbstractRegionAccessStrategyTest method evictOrRemoveTest.

protected void evictOrRemoveTest(final boolean evict) throws Exception {
    final Object KEY = generateNextKey();
    assertEquals(0, localRegion.getCache().size());
    assertEquals(0, remoteRegion.getCache().size());
    CountDownLatch localPutFromLoadLatch = expectRemotePutFromLoad(remoteRegion.getCache(), localRegion.getCache());
    CountDownLatch remotePutFromLoadLatch = expectRemotePutFromLoad(localRegion.getCache(), remoteRegion.getCache());
    SharedSessionContractImplementor s1 = mockedSession();
    assertNull("local is clean", localAccessStrategy.get(s1, KEY, s1.getTimestamp()));
    SharedSessionContractImplementor s2 = mockedSession();
    assertNull("remote is clean", remoteAccessStrategy.get(s2, KEY, s2.getTimestamp()));
    SharedSessionContractImplementor s3 = mockedSession();
    localAccessStrategy.putFromLoad(s3, KEY, VALUE1, s3.getTimestamp(), 1);
    SharedSessionContractImplementor s5 = mockedSession();
    remoteAccessStrategy.putFromLoad(s5, KEY, VALUE1, s5.getTimestamp(), 1);
    // putFromLoad is applied on local node synchronously, but if there's a concurrent update
    // from the other node it can silently fail when acquiring the loc . Then we could try to read
    // before the update is fully applied.
    assertTrue(localPutFromLoadLatch.await(1, TimeUnit.SECONDS));
    assertTrue(remotePutFromLoadLatch.await(1, TimeUnit.SECONDS));
    SharedSessionContractImplementor s4 = mockedSession();
    assertEquals(VALUE1, localAccessStrategy.get(s4, KEY, s4.getTimestamp()));
    SharedSessionContractImplementor s6 = mockedSession();
    assertEquals(VALUE1, remoteAccessStrategy.get(s6, KEY, s6.getTimestamp()));
    SharedSessionContractImplementor session = mockedSession();
    withTx(localEnvironment, session, () -> {
        if (evict) {
            localAccessStrategy.evict(KEY);
        } else {
            doRemove(localAccessStrategy, session, KEY);
        }
        return null;
    });
    SharedSessionContractImplementor s7 = mockedSession();
    assertNull(localAccessStrategy.get(s7, KEY, s7.getTimestamp()));
    assertEquals(0, localRegion.getCache().size());
    SharedSessionContractImplementor s8 = mockedSession();
    assertNull(remoteAccessStrategy.get(s8, KEY, s8.getTimestamp()));
    assertEquals(0, remoteRegion.getCache().size());
}
Also used : SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) CountDownLatch(java.util.concurrent.CountDownLatch)

Example 4 with SharedSessionContractImplementor

use of org.hibernate.engine.spi.SharedSessionContractImplementor in project hibernate-orm by hibernate.

the class AbstractRegionAccessStrategyTest method evictOrRemoveAllTest.

protected void evictOrRemoveAllTest(final boolean evict) throws Exception {
    final Object KEY = generateNextKey();
    assertEquals(0, localRegion.getCache().size());
    assertEquals(0, remoteRegion.getCache().size());
    SharedSessionContractImplementor s1 = mockedSession();
    assertNull("local is clean", localAccessStrategy.get(s1, KEY, s1.getTimestamp()));
    SharedSessionContractImplementor s2 = mockedSession();
    assertNull("remote is clean", remoteAccessStrategy.get(s2, KEY, s2.getTimestamp()));
    CountDownLatch localPutFromLoadLatch = expectRemotePutFromLoad(remoteRegion.getCache(), localRegion.getCache());
    CountDownLatch remotePutFromLoadLatch = expectRemotePutFromLoad(localRegion.getCache(), remoteRegion.getCache());
    SharedSessionContractImplementor s3 = mockedSession();
    localAccessStrategy.putFromLoad(s3, KEY, VALUE1, s3.getTimestamp(), 1);
    SharedSessionContractImplementor s5 = mockedSession();
    remoteAccessStrategy.putFromLoad(s5, KEY, VALUE1, s5.getTimestamp(), 1);
    // putFromLoad is applied on local node synchronously, but if there's a concurrent update
    // from the other node it can silently fail when acquiring the loc . Then we could try to read
    // before the update is fully applied.
    assertTrue(localPutFromLoadLatch.await(1, TimeUnit.SECONDS));
    assertTrue(remotePutFromLoadLatch.await(1, TimeUnit.SECONDS));
    SharedSessionContractImplementor s4 = mockedSession();
    SharedSessionContractImplementor s6 = mockedSession();
    assertEquals(VALUE1, localAccessStrategy.get(s4, KEY, s4.getTimestamp()));
    assertEquals(VALUE1, remoteAccessStrategy.get(s6, KEY, s6.getTimestamp()));
    CountDownLatch endInvalidationLatch;
    if (invalidation && !evict) {
        // removeAll causes transactional remove commands which trigger EndInvalidationCommands on the remote side
        // if the cache is non-transactional, PutFromLoadValidator.registerRemoteInvalidations cannot find
        // current session nor register tx synchronization, so it falls back to simple InvalidationCommand.
        endInvalidationLatch = new CountDownLatch(1);
        if (transactional) {
            PutFromLoadValidator originalValidator = PutFromLoadValidator.removeFromCache(remoteRegion.getCache());
            assertEquals(PutFromLoadValidator.class, originalValidator.getClass());
            PutFromLoadValidator mockValidator = spy(originalValidator);
            doAnswer(invocation -> {
                try {
                    return invocation.callRealMethod();
                } finally {
                    endInvalidationLatch.countDown();
                }
            }).when(mockValidator).endInvalidatingKey(any(), any());
            PutFromLoadValidator.addToCache(remoteRegion.getCache(), mockValidator);
            cleanup.add(() -> {
                PutFromLoadValidator.removeFromCache(remoteRegion.getCache());
                PutFromLoadValidator.addToCache(remoteRegion.getCache(), originalValidator);
            });
        } else {
            ExpectingInterceptor.get(remoteRegion.getCache()).when((ctx, cmd) -> cmd instanceof InvalidateCommand).countDown(endInvalidationLatch);
            cleanup.add(() -> ExpectingInterceptor.cleanup(remoteRegion.getCache()));
        }
    } else {
        endInvalidationLatch = new CountDownLatch(0);
    }
    withTx(localEnvironment, mockedSession(), () -> {
        if (evict) {
            localAccessStrategy.evictAll();
        } else {
            SoftLock softLock = localAccessStrategy.lockRegion();
            localAccessStrategy.removeAll();
            localAccessStrategy.unlockRegion(softLock);
        }
        return null;
    });
    SharedSessionContractImplementor s7 = mockedSession();
    assertNull(localAccessStrategy.get(s7, KEY, s7.getTimestamp()));
    assertEquals(0, localRegion.getCache().size());
    SharedSessionContractImplementor s8 = mockedSession();
    assertNull(remoteAccessStrategy.get(s8, KEY, s8.getTimestamp()));
    assertEquals(0, remoteRegion.getCache().size());
    // Wait for async propagation of EndInvalidationCommand before executing naked put
    assertTrue(endInvalidationLatch.await(1, TimeUnit.SECONDS));
    TIME_SERVICE.advance(1);
    CountDownLatch lastPutFromLoadLatch = expectRemotePutFromLoad(remoteRegion.getCache(), localRegion.getCache());
    // Test whether the get above messes up the optimistic version
    SharedSessionContractImplementor s9 = mockedSession();
    assertTrue(remoteAccessStrategy.putFromLoad(s9, KEY, VALUE1, s9.getTimestamp(), 1));
    SharedSessionContractImplementor s10 = mockedSession();
    assertEquals(VALUE1, remoteAccessStrategy.get(s10, KEY, s10.getTimestamp()));
    assertEquals(1, remoteRegion.getCache().size());
    assertTrue(lastPutFromLoadLatch.await(1, TimeUnit.SECONDS));
    SharedSessionContractImplementor s11 = mockedSession();
    assertEquals((isUsingInvalidation() ? null : VALUE1), localAccessStrategy.get(s11, KEY, s11.getTimestamp()));
    SharedSessionContractImplementor s12 = mockedSession();
    assertEquals(VALUE1, remoteAccessStrategy.get(s12, KEY, s12.getTimestamp()));
}
Also used : Arrays(java.util.Arrays) Connection(java.sql.Connection) BatchModeJtaPlatform(org.hibernate.test.cache.infinispan.util.BatchModeJtaPlatform) Cache(org.infinispan.Cache) Transaction(org.hibernate.Transaction) AdvancedCache(org.infinispan.AdvancedCache) After(org.junit.After) Mockito.doAnswer(org.mockito.Mockito.doAnswer) CacheDataDescriptionImpl(org.hibernate.cache.internal.CacheDataDescriptionImpl) TestingUtil(org.infinispan.test.TestingUtil) AccessType(org.hibernate.cache.spi.access.AccessType) Predicate(java.util.function.Predicate) TombstoneUpdate(org.hibernate.cache.infinispan.util.TombstoneUpdate) JdbcResourceTransactionAccess(org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess) TestSynchronization(org.hibernate.test.cache.infinispan.util.TestSynchronization) Matchers.any(org.mockito.Matchers.any) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) SoftLock(org.hibernate.cache.spi.access.SoftLock) JdbcSessionOwner(org.hibernate.resource.jdbc.spi.JdbcSessionOwner) AfterClassOnce(org.hibernate.testing.AfterClassOnce) FutureUpdate(org.hibernate.cache.infinispan.util.FutureUpdate) PutKeyValueCommand(org.infinispan.commands.write.PutKeyValueCommand) TransactionImpl(org.hibernate.engine.transaction.internal.TransactionImpl) PutFromLoadValidator(org.hibernate.cache.infinispan.access.PutFromLoadValidator) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) Mockito.mock(org.mockito.Mockito.mock) JdbcConnectionAccess(org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess) TestResourceTracker(org.infinispan.test.fwk.TestResourceTracker) Logger(org.jboss.logging.Logger) TransactionCoordinator(org.hibernate.resource.transaction.spi.TransactionCoordinator) Session(org.hibernate.Session) Caches(org.hibernate.cache.infinispan.util.Caches) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) RegionAccessStrategy(org.hibernate.cache.spi.access.RegionAccessStrategy) SQLException(java.sql.SQLException) TestTimeService(org.hibernate.test.cache.infinispan.util.TestTimeService) RollbackException(javax.transaction.RollbackException) TransactionCoordinatorOwner(org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner) ExpectingInterceptor(org.hibernate.test.cache.infinispan.util.ExpectingInterceptor) ComparableComparator(org.hibernate.internal.util.compare.ComparableComparator) BatchModeTransactionCoordinator(org.hibernate.test.cache.infinispan.util.BatchModeTransactionCoordinator) JdbcResourceTransactionMock(org.hibernate.test.cache.infinispan.util.JdbcResourceTransactionMock) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) AssertionFailedError(junit.framework.AssertionFailedError) JdbcServices(org.hibernate.engine.jdbc.spi.JdbcServices) JdbcSessionContext(org.hibernate.resource.jdbc.spi.JdbcSessionContext) TestInfinispanRegionFactory(org.hibernate.test.cache.infinispan.util.TestInfinispanRegionFactory) Mockito.when(org.mockito.Mockito.when) BaseRegion(org.hibernate.cache.infinispan.impl.BaseRegion) ServiceRegistry(org.hibernate.service.ServiceRegistry) TimeUnit(java.util.concurrent.TimeUnit) CacheDataDescription(org.hibernate.cache.spi.CacheDataDescription) InvalidateCommand(org.infinispan.commands.write.InvalidateCommand) Assert.assertNull(org.junit.Assert.assertNull) SystemException(javax.transaction.SystemException) JdbcResourceLocalTransactionCoordinatorBuilderImpl(org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl) SqlExceptionHelper(org.hibernate.engine.jdbc.spi.SqlExceptionHelper) BeforeClassOnce(org.hibernate.testing.BeforeClassOnce) Assert.assertEquals(org.junit.Assert.assertEquals) PutFromLoadValidator(org.hibernate.cache.infinispan.access.PutFromLoadValidator) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) CountDownLatch(java.util.concurrent.CountDownLatch) InvalidateCommand(org.infinispan.commands.write.InvalidateCommand) SoftLock(org.hibernate.cache.spi.access.SoftLock)

Example 5 with SharedSessionContractImplementor

use of org.hibernate.engine.spi.SharedSessionContractImplementor in project hibernate-orm by hibernate.

the class AbstractRegionAccessStrategyTest method mockedSession.

protected SharedSessionContractImplementor mockedSession() {
    SessionMock session = mock(SessionMock.class);
    when(session.isClosed()).thenReturn(false);
    when(session.getTimestamp()).thenReturn(TIME_SERVICE.wallClockTime());
    if (jtaPlatform == BatchModeJtaPlatform.class) {
        BatchModeTransactionCoordinator txCoord = new BatchModeTransactionCoordinator();
        when(session.getTransactionCoordinator()).thenReturn(txCoord);
        when(session.beginTransaction()).then(invocation -> {
            Transaction tx = txCoord.newTransaction();
            tx.begin();
            return tx;
        });
    } else if (jtaPlatform == null) {
        Connection connection = mock(Connection.class);
        JdbcConnectionAccess jdbcConnectionAccess = mock(JdbcConnectionAccess.class);
        try {
            when(jdbcConnectionAccess.obtainConnection()).thenReturn(connection);
        } catch (SQLException e) {
        // never thrown from mock
        }
        JdbcSessionOwner jdbcSessionOwner = mock(JdbcSessionOwner.class);
        when(jdbcSessionOwner.getJdbcConnectionAccess()).thenReturn(jdbcConnectionAccess);
        SqlExceptionHelper sqlExceptionHelper = mock(SqlExceptionHelper.class);
        JdbcServices jdbcServices = mock(JdbcServices.class);
        when(jdbcServices.getSqlExceptionHelper()).thenReturn(sqlExceptionHelper);
        ServiceRegistry serviceRegistry = mock(ServiceRegistry.class);
        when(serviceRegistry.getService(JdbcServices.class)).thenReturn(jdbcServices);
        JdbcSessionContext jdbcSessionContext = mock(JdbcSessionContext.class);
        when(jdbcSessionContext.getServiceRegistry()).thenReturn(serviceRegistry);
        when(jdbcSessionOwner.getJdbcSessionContext()).thenReturn(jdbcSessionContext);
        NonJtaTransactionCoordinator txOwner = mock(NonJtaTransactionCoordinator.class);
        when(txOwner.getResourceLocalTransaction()).thenReturn(new JdbcResourceTransactionMock());
        when(txOwner.getJdbcSessionOwner()).thenReturn(jdbcSessionOwner);
        when(txOwner.isActive()).thenReturn(true);
        TransactionCoordinator txCoord = JdbcResourceLocalTransactionCoordinatorBuilderImpl.INSTANCE.buildTransactionCoordinator(txOwner, null);
        when(session.getTransactionCoordinator()).thenReturn(txCoord);
        when(session.beginTransaction()).then(invocation -> {
            Transaction tx = new TransactionImpl(txCoord, session.getExceptionConverter());
            tx.begin();
            return tx;
        });
    } else {
        throw new IllegalStateException("Unknown JtaPlatform: " + jtaPlatform);
    }
    return session;
}
Also used : Arrays(java.util.Arrays) Connection(java.sql.Connection) BatchModeJtaPlatform(org.hibernate.test.cache.infinispan.util.BatchModeJtaPlatform) Cache(org.infinispan.Cache) Transaction(org.hibernate.Transaction) AdvancedCache(org.infinispan.AdvancedCache) After(org.junit.After) Mockito.doAnswer(org.mockito.Mockito.doAnswer) CacheDataDescriptionImpl(org.hibernate.cache.internal.CacheDataDescriptionImpl) TestingUtil(org.infinispan.test.TestingUtil) AccessType(org.hibernate.cache.spi.access.AccessType) Predicate(java.util.function.Predicate) TombstoneUpdate(org.hibernate.cache.infinispan.util.TombstoneUpdate) JdbcResourceTransactionAccess(org.hibernate.resource.transaction.backend.jdbc.spi.JdbcResourceTransactionAccess) TestSynchronization(org.hibernate.test.cache.infinispan.util.TestSynchronization) Matchers.any(org.mockito.Matchers.any) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) SoftLock(org.hibernate.cache.spi.access.SoftLock) JdbcSessionOwner(org.hibernate.resource.jdbc.spi.JdbcSessionOwner) AfterClassOnce(org.hibernate.testing.AfterClassOnce) FutureUpdate(org.hibernate.cache.infinispan.util.FutureUpdate) PutKeyValueCommand(org.infinispan.commands.write.PutKeyValueCommand) TransactionImpl(org.hibernate.engine.transaction.internal.TransactionImpl) PutFromLoadValidator(org.hibernate.cache.infinispan.access.PutFromLoadValidator) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) Mockito.mock(org.mockito.Mockito.mock) JdbcConnectionAccess(org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess) TestResourceTracker(org.infinispan.test.fwk.TestResourceTracker) Logger(org.jboss.logging.Logger) TransactionCoordinator(org.hibernate.resource.transaction.spi.TransactionCoordinator) Session(org.hibernate.Session) Caches(org.hibernate.cache.infinispan.util.Caches) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) RegionAccessStrategy(org.hibernate.cache.spi.access.RegionAccessStrategy) SQLException(java.sql.SQLException) TestTimeService(org.hibernate.test.cache.infinispan.util.TestTimeService) RollbackException(javax.transaction.RollbackException) TransactionCoordinatorOwner(org.hibernate.resource.transaction.spi.TransactionCoordinatorOwner) ExpectingInterceptor(org.hibernate.test.cache.infinispan.util.ExpectingInterceptor) ComparableComparator(org.hibernate.internal.util.compare.ComparableComparator) BatchModeTransactionCoordinator(org.hibernate.test.cache.infinispan.util.BatchModeTransactionCoordinator) JdbcResourceTransactionMock(org.hibernate.test.cache.infinispan.util.JdbcResourceTransactionMock) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) AssertionFailedError(junit.framework.AssertionFailedError) JdbcServices(org.hibernate.engine.jdbc.spi.JdbcServices) JdbcSessionContext(org.hibernate.resource.jdbc.spi.JdbcSessionContext) TestInfinispanRegionFactory(org.hibernate.test.cache.infinispan.util.TestInfinispanRegionFactory) Mockito.when(org.mockito.Mockito.when) BaseRegion(org.hibernate.cache.infinispan.impl.BaseRegion) ServiceRegistry(org.hibernate.service.ServiceRegistry) TimeUnit(java.util.concurrent.TimeUnit) CacheDataDescription(org.hibernate.cache.spi.CacheDataDescription) InvalidateCommand(org.infinispan.commands.write.InvalidateCommand) Assert.assertNull(org.junit.Assert.assertNull) SystemException(javax.transaction.SystemException) JdbcResourceLocalTransactionCoordinatorBuilderImpl(org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl) SqlExceptionHelper(org.hibernate.engine.jdbc.spi.SqlExceptionHelper) BeforeClassOnce(org.hibernate.testing.BeforeClassOnce) Assert.assertEquals(org.junit.Assert.assertEquals) JdbcResourceTransactionMock(org.hibernate.test.cache.infinispan.util.JdbcResourceTransactionMock) JdbcSessionContext(org.hibernate.resource.jdbc.spi.JdbcSessionContext) SQLException(java.sql.SQLException) Connection(java.sql.Connection) TransactionCoordinator(org.hibernate.resource.transaction.spi.TransactionCoordinator) BatchModeTransactionCoordinator(org.hibernate.test.cache.infinispan.util.BatchModeTransactionCoordinator) JdbcServices(org.hibernate.engine.jdbc.spi.JdbcServices) TransactionImpl(org.hibernate.engine.transaction.internal.TransactionImpl) SqlExceptionHelper(org.hibernate.engine.jdbc.spi.SqlExceptionHelper) JdbcSessionOwner(org.hibernate.resource.jdbc.spi.JdbcSessionOwner) BatchModeTransactionCoordinator(org.hibernate.test.cache.infinispan.util.BatchModeTransactionCoordinator) Transaction(org.hibernate.Transaction) JdbcConnectionAccess(org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess) ServiceRegistry(org.hibernate.service.ServiceRegistry)

Aggregations

SharedSessionContractImplementor (org.hibernate.engine.spi.SharedSessionContractImplementor)54 Test (org.junit.Test)17 CountDownLatch (java.util.concurrent.CountDownLatch)12 Session (org.hibernate.Session)10 EntityManager (javax.persistence.EntityManager)7 PutFromLoadValidator (org.hibernate.cache.infinispan.access.PutFromLoadValidator)7 JtaTransactionCoordinatorImpl (org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl)7 AssertionFailedError (junit.framework.AssertionFailedError)6 SessionFactoryImplementor (org.hibernate.engine.spi.SessionFactoryImplementor)6 EntityPersister (org.hibernate.persister.entity.EntityPersister)6 Serializable (java.io.Serializable)5 HibernateException (org.hibernate.HibernateException)5 AssertionFailure (org.hibernate.AssertionFailure)4 TestForIssue (org.hibernate.testing.TestForIssue)4 Connection (java.sql.Connection)3 SQLException (java.sql.SQLException)3 ArrayList (java.util.ArrayList)3 Arrays (java.util.Arrays)3 List (java.util.List)3 TimeUnit (java.util.concurrent.TimeUnit)3