Introduce TransactionDefinition.withDefaults() shortcut
Such a static unmodifiable TransactionDefinition with defaults can be used for getTransaction(null) calls, now also possible for getReactiveTransaction. Furthermore, it can be used for a simple TransactionalOperator.create(ReactiveTransactionManager) method without an internal dependency on the transaction.support package. See gh-22646
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -41,9 +41,9 @@ import org.springframework.context.ResourceLoaderAware;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionException;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
|
||||
/**
|
||||
* Common base class for accessing a Quartz Scheduler, i.e. for registering jobs,
|
||||
@@ -207,7 +207,7 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
|
||||
protected void registerJobsAndTriggers() throws SchedulerException {
|
||||
TransactionStatus transactionStatus = null;
|
||||
if (this.transactionManager != null) {
|
||||
transactionStatus = this.transactionManager.getTransaction(new DefaultTransactionDefinition());
|
||||
transactionStatus = this.transactionManager.getTransaction(TransactionDefinition.withDefaults());
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user