Skip to content

Commit 304f000

Browse files
authored
Refactor FlowRunner transaction invocation (#2612)
Stop calling `transact` if already in a transaction.
1 parent 15cf3e1 commit 304f000

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/java/google/registry/flows/FlowRunner.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public EppOutput run(final EppMetric.Builder eppMetricBuilder) throws EppExcepti
7575
flowReporter.recordToLogs();
7676
}
7777
eppMetricBuilder.setCommandNameFromFlow(flowClass.getSimpleName());
78-
if (!isTransactional) {
78+
// We may already be in a transaction, e.g., when invoked by DeleteExpiredDomainsAction.
79+
if (!isTransactional || jpaTransactionManager.inTransaction()) {
7980
return EppOutput.create(flowProvider.get().run());
8081
}
8182
try {

0 commit comments

Comments
 (0)