Class TransactionalImportRunner
Object
TransactionalImportRunner
Runs each import entry in its own independent transaction.
Must be a separate Spring bean so the proxy intercepts the @Transactional call.
This prevents a caught DB exception in one entry from poisoning the entire import transaction.
When an inner @Transactional method throws, Spring marks the REQUIRES_NEW transaction as
rollback-only. importEntry catches the exception and builds a meaningful ArtifactImportResult,
but that result is discarded when the commit fails with TransactionSystemException.
lastEntryResult captures the result before the commit attempt so the orchestrator can recover it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrunDeleteOrphan(ArtifactImporter<?> importer, String key, String user) runEntry(ArtifactImporter<T> importer, T entry, FileResolver resolver, String user)
-
Constructor Details
-
TransactionalImportRunner
public TransactionalImportRunner()
-
-
Method Details
-
runEntry
@Transactional(propagation=REQUIRES_NEW) public <T> ArtifactImportResult runEntry(ArtifactImporter<T> importer, T entry, FileResolver resolver, String user) -
drainLastEntryResult
-
runDeleteOrphan
@Transactional(propagation=REQUIRES_NEW) public void runDeleteOrphan(ArtifactImporter<?> importer, String key, String user)
-