Details
-
Type:
Defect
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:0.2.3
Description
transaction* currently catches Exceptions for its rollback logic. This means Throwables subclassing java.lang.Error are not caught, and indeed the transaction seems to be immediately committed in this case (at least if the connection has autocommit set to true).
This happened to me in the case of an OutOfMemoryError. Another example is that the following code commits:
(transaction
(insert-records "table" {:foo 12})
(assert false))
Presumably this can be fixed by catching Throwable instead of Exception. I'll prepare a patch to that effect.
Thanx Gary. In the latest source there may be two pieces of transaction logic so please check for anywhere else that Exception is mentioned!