Commits and closes the transaction. All changes made to persistent objects during the transaction are made persistent; objects created during the transaction are made durable; and, objects removed during the transaction are removed from the database.
In other words, any modifications to any data objects which are queried/loaded/created/update to this database is automatically stored to the database and visible to subsequence transactions. (ie. update is solely used for long transaction support and should not be called for any data object queried/loaded/created in the this transaction.)
If the transaction cannot commit, the entire transaction rolls back and a {@link TransactionAbortedException} exception isthrown.
After this method returns, the transaction is closed and all persistent objects are transient. Using {@link #begin} to open anew transaction will not restore objects to their persistent stage.
@throws TransactionNotInProgressException Method called whiletransaction is not in progress
@throws TransactionAbortedException The transaction cannotcommit and has been rolled back