-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathTransaction
72 lines (62 loc) · 2.03 KB
/
Transaction
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/** Transactions are either automatic or explicit. If automatic,
* (autocommit) every operation is performed as part of a new
* transaction that is automatically committed.
*/
/** Begin a transaction.
* IMMEDIATE
*
* This function returns a promise. On success, the promise will be fulfilled.
* The optional callback receives only an error value. Any extra arguments
* passed after the callback function will be returned to the callback verbatim
* following the error.
*
* @param callback
*/
begin([callback], [...] );
/** Commit a transaction.
* ASYNC
*
* This function returns a promise. On success, the promise will be fulfilled.
* The optional callback receives only an error value. Any extra arguments
* passed after the callback function will be returned to the callback verbatim
* following the error.
*
* @param callback
*/
commit([callback], [...] );
/** Roll back a transaction.
* ASYNC
*
* This function returns a promise. On success, the promise will be fulfilled.
* The optional callback receives only an error value. Any extra arguments
* passed after the callback function will be returned to the callback verbatim
* following the error.
*
* @param callback
*/
rollback([callback], [...] );
/** Is there a transaction currently active?
* IMMEDIATE
*
* @return true if a transaction is active; or false if not
*/
boolean isActive();
/** Mark this transaction as rollback only.
* IMMEDIATE
*
* After this method is called in explicit mode,
* commit() will roll back the transaction, reject the commit promise,
* and return an error in the callback.
* rollback() will roll back the transaction, fulfill the rollback promise,
* and return success in the callback.
* If a transaction is not active, or is already marked for rollback, the method is ignored.
*
*/
setRollbackOnly();
/** Has this transaction been marked for rollback only?
* IMMEDIATE
*
* @return true if the transaction has been started and marked for rollback only; or false if not
*
*/
boolean getRollbackOnly();