If the transaction wasn't a new one, omit the commit for proper participation in the surrounding transaction. If a previous transaction has been suspended to be able to create a new one, resume the previous transaction after committing the new one.
Note that when the commit call completes, no matter if normally or throwing an exception, the transaction must be fully completed and cleaned up. No rollback call should be expected in such a case.
If this method throws an exception other than a TransactionException, then some before-commit error caused the commit attempt to fail. For example, an O/R Mapping tool might have tried to flush changes to the database right before commit, with the resulting DataAccessException causing the transaction to fail. The original exception will be propagated to the caller of this commit method in such a case.
@param status object returned by the getTransaction
method
@throws UnexpectedRollbackException in case of an unexpected rollbackthat the transaction coordinator initiated
@throws HeuristicCompletionException in case of a transaction failurecaused by a heuristic decision on the side of the transaction coordinator
@throws TransactionSystemException in case of commit or system errors(typically caused by fundamental resource failures)
@throws IllegalTransactionStateException if the given transactionis already completed (that is, committed or rolled back)
@see TransactionStatus#setRollbackOnly
|
|