diff --git a/api-connection.html b/api-connection.html index cc498166d..300773023 100644 --- a/api-connection.html +++ b/api-connection.html @@ -42,7 +42,9 @@
+ Set a savepoint within a transaction. +
+
+ There should be an active transaction.
+ That is, beginTransaction
should have been previously called.
+
+ The callback is called when the request to set a savepoint within the transaction has completed,
+ either successfully or with an error.
+ If an error occured then err
will describe the error.
+
+ As only one request at a time may be executed on a connection, another request should not + be initiated until this callback is called. +
++ If an error occured, a string with details of the error. +
++ Run the given callback after starting a transaction, and commit or rollback the transaction afterwards. +
+
+ This is a helper that employs beginTransaction
,
+ commitTrnsaction
,
+ rollbackTransaction
and
+ saveTransaction
to greatly simplify the
+ use of database transactions and automatically handle transaction nesting.
+
+ The callback is called when the request to start a transaction (or create a savepoint, in
+ the case of a nested transaction) has completed, either successfully or with an error.
+ If an error occured, then err
will describe the error.
+ If no error occured, the callback should perform its work and eventually call
+ done
with an error or null (to trigger a transaction rollback or a
+ transaction commit) and an additional completion callback that will be called when the request
+ to rollback or commit the current transaction has completed, either successfully or with an error.
+ Additional arguments given to done
will be passed through to this callback.
+
+ As only one request at a time may be executed on a connection, another request should not + be initiated until the completion callback is called. +
++ If an error occured, a string with details of the error. +
++ If no error occured, a function to be called to commit or rollback + the transaction. +
+Release the SQL Server resources associated with a previously prepared request. diff --git a/changelog.html b/changelog.html index e228d8d25..69921ac6d 100644 --- a/changelog.html +++ b/changelog.html @@ -5,6 +5,18 @@
Connection#saveTransaction
to create transaction savepoints.
+ Change Connection#rollbackTransaction
to allow manually specifying
+ a transaction or savepoint name. Introduce new Connection#transaction
+ helper to simplify transaction handling, especially when nesting transactions.
+ (Rohit Arjunagi, Arthur Schreiber)
+