If another thread has already terminated the transaction then: (i) if it rolled back, we do nothing - could throw TransactionRequired of INVALID_TRANSACTION, or NoTransaction. Probably not NoTransaction, since it would be better to distinguish between the situation where the transaction has already been terminated and there really is no transaction for this thread. (ii) if it committed, we throw INVALID_TRANSACTION.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.