| org.apache.ojb.junit.ODMGTestCase org.apache.ojb.odmg.UserTestCases
UserTestCases | public class UserTestCases extends ODMGTestCase (Code) | | Collection of test cases sent by OJB users
author: Armin Waibel version: $Id: UserTestCases.java,v 1.13.2.4 2005/06/04 14:48:05 arminw Exp $ |
testDuplicateInsertion | public void testDuplicateInsertion() throws Exception(Code) | | Send by Antonio
Note: The name attribute was declared as
unique in the DB.
|
testImplicitLocking | public void testImplicitLocking() throws Exception(Code) | | User test case posted by Charles:
Up to now, we've been just using the broker layer. I now have a usecase
where we will need to use the ODMG layer. We do not want to use implicit
locking; I want my developers to explicit lock each object to an ODMG
transaction (implicit locking generates loads of queries for all the proxy
collections - should be fixed since OJB1.0.3).
It seems that something 'funny' happens if implicit locking is turned off -
objects are not marked as being "dirty" when changed - even when they are
explicitly lock to the transaction.
As I am a complete novice in the ways of the ODMG, I don't really know where
to look to sort this issue out so I have added a new test method to
org.apache.ojb.odmg.UserTestCases (it should be attached to this email).
Essentially, it creates an object and persists it; retrieves and updates it;
then flushes the cache, and retrieves it again to ensure the update worked.
If ImplicitLocking is TRUE, the test passes. If ImplicitLocking is FALSE,
the test fails.
I think this is incorrect, and would dearly like this to be resolved.
thma's comment: IMO this works as designed. objects must be locked to
an ODMG tx before any modifications are taking place.
I simply moved the lock two lines up and the test passed.
|
testRetrieveNonExistent | public void testRetrieveNonExistent()(Code) | | |
testRetrieveOutsideTxn | public void testRetrieveOutsideTxn()(Code) | | Not recommended to use such a construct!!!
|
testSimpleQueryDelete | public void testSimpleQueryDelete() throws Exception(Code) | | |
testStoreRetrieveSameTxn | public void testStoreRetrieveSameTxn() throws Exception(Code) | | store an object and then retrieve it by id.
|
|
|