| org.jaffa.persistence.blackboxtests.ConcurrencyTest
ConcurrencyTest | public class ConcurrencyTest extends TestCase (Code) | | author: GautamJ |
Method Summary | |
public void | testConcurrentUowCreation() This test will create 50 UOW objects concurrently. | public void | testOptimisticLocking() This is a test for Optimistic locking.
It will retrieve the condition 'Z-TESTSYCD-01' in Optimistic locking-mode and modify a field. | public void | testParanoidLocking() This is a test for Paranoid locking.
It will retrieve the condition 'Z-TESTSYCD-01' in Paranoid locking-mode. | public void | testPessimisticLocking() This is a test for Pessimistic locking.
It will retrieve the condition 'Z-TESTSYCD-01' in Pessimistic locking-mode and modify a field. | public void | testReadOnlyLocking() This is a test for ReadOnly locking. |
m_succesfulUowCreationCounter | int m_succesfulUowCreationCounter(Code) | | |
ConcurrencyTest | public ConcurrencyTest(String name)(Code) | | Creates new QueryTest
|
testConcurrentUowCreation | public void testConcurrentUowCreation()(Code) | | This test will create 50 UOW objects concurrently. The test fails, if any exception is raised.
|
testOptimisticLocking | public void testOptimisticLocking()(Code) | | This is a test for Optimistic locking.
It will retrieve the condition 'Z-TESTSYCD-01' in Optimistic locking-mode and modify a field. The condition will remain unlocked.
It'll then retrieve the same condition in another UOW, but in Paranoid locking mode. The other UOW should obtain a lock on the condition object.
It'll then try to retrieve the same condition in another UOW, but in Pessimistic locking mode. It should be possible to modify it.
Finally retrieve the same object in another UOW in Optimistic locking mode and try to update it. It should be possible to modify it.
Note: In the case of Optimistic locking, a lock is acquired on the object only when the UOW is commited.
|
testParanoidLocking | public void testParanoidLocking()(Code) | | This is a test for Paranoid locking.
It will retrieve the condition 'Z-TESTSYCD-01' in Paranoid locking-mode. The condition will get locked.
It'll then try to retrieve the same condition in another UOW, in Paranoid locking mode. The retrieve should fail, since the object has been locked by the 1st UOW
It'll then try to retrieve the same condition in another UOW, but in Pessimistic locking mode. The retrieve will work, but it'll not be possible to modify it, since the object has been locked by the 1st UOW
Finally retrieve the same object in another UOW in Optimistic locking mode and try to update it. The update will fail.
Note: In the case of Paranoid locking, a lock is acquired on the object when retrieving it.
|
testPessimisticLocking | public void testPessimisticLocking()(Code) | | This is a test for Pessimistic locking.
It will retrieve the condition 'Z-TESTSYCD-01' in Pessimistic locking-mode and modify a field. The condition will get locked.
It'll then try to retrieve the same condition in another UOW, but in Paranoid locking mode. The retrieve should fail, since the object has been locked by the 1st UOW
It'll then try to retrieve the same condition in another UOW, but in Pessimistic locking mode. The retrieve will work, but it'll not be possible to modify it, since the object has been locked by the 1st UOW
Finally retrieve the same object in another UOW in Optimistic locking mode and try to update it. The update will fail.
Note: In the case of Pessimistic locking, a lock is acquired on the object when any field is updated.
|
testReadOnlyLocking | public void testReadOnlyLocking()(Code) | | This is a test for ReadOnly locking.
It will retrieve the condition 'Z-TESTSYCD-01' in ReadOnly mode.
An exception should be raised while trying to update any of its fields.
|
|
|