Skip to content

Commit

Permalink
JBPM-3814, BZ 1002724 Bugfixes with regards to concurrency (cherry pi…
Browse files Browse the repository at this point in the history
…cked from commit c29dfae)
  • Loading branch information
Marco Rietveld committed Oct 3, 2013
1 parent 711b69e commit 188f1d3
Showing 1 changed file with 6 additions and 11 deletions.
Expand Up @@ -124,7 +124,12 @@ public void endCommandScopedEntityManager() {
if (this.env.get(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER) != null) {
getCommandScopedPersistenceContext().close();
}


// Code formerly in the clearPersistenceContext method.
EntityManager cmdScopedEntityManager = (EntityManager) this.env.get(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER);
if (cmdScopedEntityManager != null) {
cmdScopedEntityManager.clear();
}
}
}

Expand All @@ -148,14 +153,4 @@ public ProcessPersistenceContext getProcessPersistenceContext() {
return new JpaProcessPersistenceContext((EntityManager) this.env.get(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER));
}

public void clearPersistenceContext() {
if (TransactionSynchronizationManager.hasResource("cmdEM")) {
EntityManager cmdScopedEntityManager = (EntityManager) this.env.get(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER);
if (cmdScopedEntityManager != null) {
cmdScopedEntityManager.clear();
}

}
}

}

0 comments on commit 188f1d3

Please sign in to comment.