Htm clickservletjava 448ff handles this case and

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: nt)pm1.getObjectById(p4oid, true); p1tx1.setX(101); p2tx1.setX(201); pm1.deletePersistent(p3tx1); pm1.deletePersistent(p4tx1); // update/delete the instances in tx2 tx2.begin(); *** PCPoint p1tx2 = (PCPoint)pm2.getObjectById(p1oid, true); *** this is where the test hangs *** PCPoint p2tx2 = (PCPoint)pm2.getObjectById(p2oid, true); PCPoint p3tx2 = (PCPoint)pm2.getObjectById(p3oid, true); PCPoint p4tx2 = (PCPoint)pm2.getObjectById(p4oid, true); PCPoint p5tx2 = (PCPoint)pm2.getObjectById(p5oid, true); p1tx2.setX(102); // pm2.deletePersistent(p2tx2); // this should fail but succeeds due to an RI bug p3tx2.setX(202); pm2.deletePersistent(p4tx2); p5tx2.setX(502); // this change should not be committed Set expectedFailedObjects = new HashSet(); expectedFailedObjects.add(p1tx2); // expectedFailedObjects.add(p2tx2); expectedFailedObjects.add(p3tx2); expectedFailedObjects.add(p4tx2); // commit tx1 (should succeed) tx1.commit(); tx1 = null; // commit tx2 (should fail) try { tx2.commit(); fail(ASSERTION_FAILED, "concurrent commit not detected"); } catch (JDOOptimisticVerificationException ex) { // verify the correct information in the exception RUN OptimisticFailure.test[INFO] tck - Exception during setUp or runtest: <javax.jdo.JDODataStoreException: Fetch request failed: SELECT PCPOINT.X,PCPOINT.Y,PCPOINT.ID FROM PCPOINT WHERE (PCPOINT.ID = ?) [java] NestedThrowables: [java] SQL Exception: A lock could not be obtained within the time requested>javax.jdo.JDODataStoreException: Fetch request failed: SELECT PCPOINT.X,PCPOINT.Y,PCPOINT.ID FROM PCPOINT WHERE (PCPOINT.ID = ?) [java] at org.jpox.store.rdbms.request.FetchRequest.execute(FetchRequest.java:195) [java] at org.jpox.store.rdbms.table.ClassTable.fetch(ClassTable.java:1739) [java] at org.jpox.store.StoreManager.fetch(StoreManager.java:665) [java] at org.jpox.state.StateManagerImpl.loadDFGFields(StateManagerImpl.java:1573) [java] at org.jpox.state.StateManagerImpl.loadDefaultFetchGroup(StateManagerImpl.java:1666) [java] at org.jpox.state.StateManagerImpl.validate(StateManagerImpl.java:3456) [java] at org.jpox.AbstractPersistenceManager.getO...
View Full Document

Ask a homework question - tutors are online