Created
July 24, 2015 16:41
-
-
Save andromedarabbit/857ddd7ecc2fc838bc7e to your computer and use it in GitHub Desktop.
TransactionManager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject | |
private PlatformTransactionManager transactionManager; | |
private void someMethod(boolean roolback) { | |
TransactionStatus transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition()); | |
// Do something | |
if (rollback) { | |
transactionManager.rollback(transactionStatus); | |
return; | |
} | |
transactionManager.commit(transactionStatus); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment