publicSimpleTransactionFactory(TransactionManager transactionManager){ Assert.notNull(transactionManager, "TransactionManager must not be null"); this.transactionManager = transactionManager; }
@Override public Transaction createTransaction(String name, int timeout)throws NotSupportedException, SystemException { if (timeout >= 0) { this.transactionManager.setTransactionTimeout(timeout); } this.transactionManager.begin(); returnnew ManagedTransactionAdapter(this.transactionManager); }