org.hibernate.ejb.test.lock
Class UpgradeLockTest

java.lang.Object
  extended by org.hibernate.testing.junit4.BaseUnitTestCase
      extended by org.hibernate.ejb.test.BaseEntityManagerFunctionalTestCase
          extended by org.hibernate.ejb.test.lock.UpgradeLockTest

public class UpgradeLockTest
extends org.hibernate.ejb.test.BaseEntityManagerFunctionalTestCase

Test that we can upgrade locks


Field Summary
 
Fields inherited from class org.hibernate.ejb.test.BaseEntityManagerFunctionalTestCase
NO_CLASSES, NO_MAPPINGS
 
Constructor Summary
UpgradeLockTest()
           
 
Method Summary
 Class[] getAnnotatedClasses()
           
 void testUpgradeReadLockToOptimisticForceIncrement()
          Initially in tx1, get a LockModeType.READ and upgrade to LockModeType.OPTIMISTIC_FORCE_INCREMENT.
 
Methods inherited from class org.hibernate.ejb.test.BaseEntityManagerFunctionalTestCase
addConfigOptions, addMappings, afterConfigurationBuilt, afterEntityManagerFactoryBuilt, applyServices, buildConfiguration, buildEntityManagerFactory, constructConfiguration, createEntityManager, createIsolatedEntityManager, createIsolatedEntityManager, createSchema, entityManagerFactory, getCachedClasses, getCachedCollections, getConfig, getDialect, getEjb3DD, getMappings, getOrCreateEntityManager, releaseResources, serviceRegistry
 
Methods inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
releaseTransactions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpgradeLockTest

public UpgradeLockTest()
Method Detail

testUpgradeReadLockToOptimisticForceIncrement

public void testUpgradeReadLockToOptimisticForceIncrement()
                                                   throws Exception
Initially in tx1, get a LockModeType.READ and upgrade to LockModeType.OPTIMISTIC_FORCE_INCREMENT. To prove success, tx2, will modify the entity which should cause a failure in tx1.

Throws:
Exception

getAnnotatedClasses

public Class[] getAnnotatedClasses()
Overrides:
getAnnotatedClasses in class org.hibernate.ejb.test.BaseEntityManagerFunctionalTestCase


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.