Skip to content

Commit

Permalink
[Fix] Don't close a TX retrieved from TransactionThreadLocal.getTx()
Browse files Browse the repository at this point in the history
  • Loading branch information
eitch committed Sep 27, 2024
1 parent 022d1d9 commit 3a97a86
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ public boolean isRefreshAllowed() {
}

private void writeAudit(Certificate certificate, String login, AccessType accessType, String username) {
if (hasTx()) {
StrolchTransaction tx = getTx();
tx.setSuppressAudits(true);
Audit audit = tx.auditFrom(accessType, PRIVILEGE, CERTIFICATE, username);
tx.getAuditTrail().add(tx, audit);
return;
}

StrolchRealm realm = getContainer().getRealm(certificate);
try (StrolchTransaction tx = hasTx() ? getTx() : openTx(certificate, login, realm)) {
tx.setSuppressAudits(true);
Expand Down

0 comments on commit 3a97a86

Please sign in to comment.