Skip to content

Commit

Permalink
BZ848855 - Transaction rollback failure after concurrent access: no t…
Browse files Browse the repository at this point in the history
…ransaction
  • Loading branch information
mswiderski committed Aug 29, 2012
1 parent 83d945e commit 6bc3ca9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public interface PersistenceContextManager {
void beginCommandScopedEntityManager();

void endCommandScopedEntityManager();

void clearPersistenceContext();

void dispose();
}
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ public void afterCompletion(int status) {
// always cleanup thread local whatever the result
Object removedSynchronization = SingleSessionCommandService.synchronizations.remove( this.service );

this.service.jpm.clearPersistenceContext();

this.service.jpm.endCommandScopedEntityManager();

StatefulKnowledgeSession ksession = this.service.ksession;
Expand All @@ -456,7 +458,7 @@ public void afterCompletion(int status) {
}
((JPAWorkItemManager) ksession.getWorkItemManager()).clearWorkItems();
}

}

public void beforeCompletion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,11 @@ public void dispose() {
}
}

public void clearPersistenceContext() {
if (this.cmdScopedEntityManager != null && this.cmdScopedEntityManager.isOpen()) {
this.cmdScopedEntityManager.clear();
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ public void dispose() {
persistenceContext.close();
}

public void clearPersistenceContext() {

}

}

0 comments on commit 6bc3ca9

Please sign in to comment.