Prepares and commits the transaction associated with this handle.
If the transaction has been aborted, or when preparing a transaction participant or calling {@link TransactionListener#beforeCompletion beforeCompletion} on a transaction listener aborts the transactionwithout throwing an exception, then the exception thrown will have as its cause the value provided in the first call to {@link Transaction#abort abort} on the transaction, if any. If the causeimplements {@link ExceptionRetryStatus}, then the exception thrown will, too, and its {@link ExceptionRetryStatus#shouldRetry shouldRetry} methodwill return the value returned by calling that method on the cause. If no cause was supplied, then {@code shouldRetry} will either notimplement {@code ExceptionRetryStatus} or its {@code shouldRetry} methodwill return {@code false}.
@throws TransactionNotActiveException if the transaction has beenaborted
@throws TransactionAbortedException if a call to {@link TransactionParticipant#prepare prepare} on a transactionparticipant or to {@code beforeCompletion} on a transactionlistener aborts the transaction but does not throw an exception
@throws IllegalStateException if {@code prepare} has been called on anytransaction participant and {@link Transaction#abort abort} hasnot been called on the transaction, or if called from a thread that is not the thread that created the transaction
@throws Exception any exception thrown when calling {@code prepare} ona participant or {@code beforeCompletion} on a listener