Hi,
a EOFetchSpecification that locks objects and throws an exception on any other access trials (SELECT, UPDATE, whatever) is required. The behaviour should be the same as the SQL Statement 'SELECT FOR UPDATE NO WAIT'.
For locking objects ('SELECT FOR UPDATE') the EOFetchSpecifications method 'setRefreshesRefetchedObjects' is used:
EOFetchSpecification spec = new EOFetchSpecification("AnEntity", qualifier, null); spec.setRefreshesRefetchedObjects(true);
For the 'NO WAIT' clause, the OracleSQLExpressions 'setUseNoWaitLocks' method seems to be the right one, but i could not figure out, how to apply it (i'm new to java...and english speaking -.-).
Any helpful hints or examples how to use 'setUseNoWaitLocks' would be appreciated.
Regards
Andri von Allmen
|