@@ -63,6 +63,17 @@ Transaction.start = (data) => {
63
63
64
64
function DatasetTransaction ( dataset ) {
65
65
this . dataset = dataset ;
66
+ this . log = [ ] ; // array of LogRecord { time, operation, delta }
67
+ // [
68
+ // { id, time: '2018-01-01T12:01:00', operation: 'start' }
69
+ // { id, time: '2018-01-01T12:02:15', operation: 'set', delta }
70
+ // { id, time: '2018-01-01T12:02:32', operation: 'commit', delta }
71
+ // { id, time: '2018-01-01T12:02:37', operation: 'set', delta }
72
+ // { id, time: '2018-01-01T12:03:11', operation: 'rollback', delta }
73
+ // { id, time: '2018-01-01T12:03:18', operation: 'set', delta }
74
+ // { id, time: '2018-01-01T12:04:42', operation: 'timeout' }
75
+ // { id, time: '2018-01-01T12:04:52', operation: 'rollback', delta }
76
+ // ]
66
77
}
67
78
68
79
DatasetTransaction . start = function ( dataset ) {
@@ -74,7 +85,15 @@ DatasetTransaction.prototype.commit = function() {
74
85
// place implementation here
75
86
} ;
76
87
77
- DatasetTransaction . prototype . rollback = function ( ) {
88
+ DatasetTransaction . prototype . rollback = function ( id /* optional log id */ ) {
89
+ // place implementation here
90
+ } ;
91
+
92
+ DatasetTransaction . prototype . timeout = function (
93
+ msec , // timeout, 0 - disable
94
+ commit , // true - commit, false - rollback
95
+ listener // (optional) function(boolean) : boolean
96
+ ) {
78
97
// place implementation here
79
98
} ;
80
99
0 commit comments