public Void execute(CommandContext commandContext) { DbEntityManagerFactory dbEntityManagerFactory = new DbEntityManagerFactory(Context.getProcessEngineConfiguration().getIdGenerator()); DbEntityManager entityManager = dbEntityManagerFactory.openSession(); JobEntity job = entityManager.selectById(JobEntity.class, JOB_ENTITY_ID); job.setLockOwner(lockOwner); entityManager.forceUpdate(job); monitor.sync(); // flush the changed entity and create a lock for the table entityManager.flush(); monitor.sync(); // commit transaction and remove the lock commandContext.getTransactionContext().commit(); return null; }
transactionContext.commit();
transactionContext.commit();
public Void execute(CommandContext commandContext) { DbEntityManagerFactory dbEntityManagerFactory = new DbEntityManagerFactory(Context.getProcessEngineConfiguration().getIdGenerator()); DbEntityManager entityManager = dbEntityManagerFactory.openSession(); JobEntity job = entityManager.selectById(JobEntity.class, JOB_ENTITY_ID); job.setLockOwner(lockOwner); entityManager.forceUpdate(job); monitor.sync(); // flush the changed entity and create a lock for the table entityManager.flush(); monitor.sync(); // commit transaction and remove the lock commandContext.getTransactionContext().commit(); return null; }
transactionContext.commit();