Skip to content

Commit

Permalink
Merge pull request #41 from sdelamo/checked-runtime-rollback
Browse files Browse the repository at this point in the history
Both check and rutime exceptions are rolled back
  • Loading branch information
graemerocher committed Jun 16, 2017
2 parents dda39af + 5d265d4 commit b0db11d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/src/docs/asciidoc/programmaticTransactions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ def transferFunds() {
}
----

In this example we rollback the transaction if the destination account is not active. Also, if an unchecked `Exception` or `Error` (but not a checked `Exception`, even though Groovy doesn't require that you catch checked exceptions) is thrown during the process the transaction will automatically be rolled back.
In this example we rollback the transaction if the destination account is not active.

Also, if an `Exception` (both checked or runtime exception) or `Error` is thrown during the process the transaction will automatically be rolled back..

WARNING: GORM versions prior to 6.0.0 did not roll back transactions for a checked `Exception`.

You can also use "save points" to rollback a transaction to a particular point in time if you don't want to rollback the entire transaction. This can be achieved through the use of Spring's http:https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/transaction/SavepointManager.html[SavePointManager] interface.

Expand Down

0 comments on commit b0db11d

Please sign in to comment.