0

I encounter a issue that in the worst case only happens. Ex. I have a Job that runs every minute

    UpdateJobForAnObjectA:
    PersistenceManager pm = Context.getPersistenceManager();
    Transaction tx = pm.currentTransaction();
    tx.begin();
    update a collection of an ObjectA
    tx.comit();
    pm.close();

Now I have a deadlock(Pessimist Strategy) or an opstimic lock violation(Optimistic Violation) if in another segment I update an objectA. I set to nonTransactionalRead and nonTransacionalWriete and still I'm having the error of deadlock or opstimic lock violation. But there is a way that see if I can wait for a transaction ends? Using JDO and KODO

Gatusko
  • 2,503
  • 1
  • 17
  • 25

1 Answers1

1

You can set a Synchronization object on the Transaction, and use its methods to be notified when a txn commits/rolls back.

Neil Stockton
  • 11,383
  • 3
  • 34
  • 29