本文整理匯總了Java中org.springframework.transaction.support.TransactionCallback.doInTransaction方法的典型用法代碼示例。如果您正苦於以下問題:Java TransactionCallback.doInTransaction方法的具體用法?Java TransactionCallback.doInTransaction怎麽用?Java TransactionCallback.doInTransaction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.transaction.support.TransactionCallback
的用法示例。
在下文中一共展示了TransactionCallback.doInTransaction方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: maybeRunInNewTransaction
import org.springframework.transaction.support.TransactionCallback; //導入方法依賴的package包/類
@Override
public <T> T maybeRunInNewTransaction(final TransactionCallback<T> callback, final boolean newTransaction, final LockedAccountsOnPayments minForNewTx) {
if (newTransaction && applicationService.getLockedAccountsOnPayments().compareTo(minForNewTx) >= 0) {
return runInNewTransaction(callback);
} else {
return callback.doInTransaction(null);
}
}
示例2: execute
import org.springframework.transaction.support.TransactionCallback; //導入方法依賴的package包/類
@Override
public <T> T execute(TransactionCallback<T> action) throws TransactionException {
return action.doInTransaction(new SimpleTransactionStatus());
}
示例3: execute
import org.springframework.transaction.support.TransactionCallback; //導入方法依賴的package包/類
@Override
public <T> T execute(TransactionDefinition definition, TransactionCallback<T> callback) throws TransactionException {
this.definition = definition;
this.status = new SimpleTransactionStatus();
return callback.doInTransaction(this.status);
}
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:7,代碼來源:MockCallbackPreferringTransactionManager.java