aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscgilardi <scgilardi@gmail.com>2009-01-21 14:16:27 +0000
committerscgilardi <scgilardi@gmail.com>2009-01-21 14:16:27 +0000
commit68509921a5784ae1a7d5ec5d0c794641c6a8af1f (patch)
treeaa9e355b355babfede9942a0181c850c37f0da40
parentddadff672034102f41234c5c933d6e189059a8f8 (diff)
sql: correct docs for transact(*) regarding rollback-only
-rw-r--r--src/clojure/contrib/sql.clj9
-rw-r--r--src/clojure/contrib/sql/internal.clj9
2 files changed, 12 insertions, 6 deletions
diff --git a/src/clojure/contrib/sql.clj b/src/clojure/contrib/sql.clj
index ca9e1c71..77ea1e60 100644
--- a/src/clojure/contrib/sql.clj
+++ b/src/clojure/contrib/sql.clj
@@ -42,9 +42,12 @@
(defmacro transaction
"Evaluates body as a transaction on the open database connection. Any
- nested transactions are absorbed into the outermost transaction. All
- database updates are committed together as a group after evaluating the
- outermost body, or rolled back on any uncaught exception."
+ nested transactions are absorbed into the outermost transaction. By
+ default, all database updates are committed together as a group after
+ evaluating the outermost body, or rolled back on any uncaught
+ exception. If set-rollback-only is called within scope of the outermost
+ transaction, the entire transaction will be rolled back rather than
+ committed when complete."
[& body]
`(transaction* (fn [] ~@body)))
diff --git a/src/clojure/contrib/sql/internal.clj b/src/clojure/contrib/sql/internal.clj
index 34278694..4eb0955a 100644
--- a/src/clojure/contrib/sql/internal.clj
+++ b/src/clojure/contrib/sql/internal.clj
@@ -87,9 +87,12 @@
(defn transaction*
"Evaluates func as a transaction on the open database connection. Any
- nested transactions are absorbed into the outermost transaction. All
- database updates are committed together as a group after evaluating the
- outermost func, or rolled back on any uncaught exception."
+ nested transactions are absorbed into the outermost transaction. By
+ default, all database updates are committed together as a group after
+ evaluating the outermost body, or rolled back on any uncaught
+ exception. If rollback-only is set within scope of the outermost
+ transaction, the entire transaction will be rolled back rather than
+ committed when complete."
[func]
(io!
(let [con (connection*)