File tree Expand file tree Collapse file tree 4 files changed +54
-4
lines changed Expand file tree Collapse file tree 4 files changed +54
-4
lines changed Original file line number Diff line number Diff line change @@ -67,4 +67,19 @@ public function rollback(): void
67
67
{
68
68
$ this ->tsx ->rollback ();
69
69
}
70
+
71
+ public function isCommitted (): bool
72
+ {
73
+ return $ this ->tsx ->isCommitted ();
74
+ }
75
+
76
+ public function isRolledBack (): bool
77
+ {
78
+ return $ this ->tsx ->isRolledBack ();
79
+ }
80
+
81
+ public function isFinished (): bool
82
+ {
83
+ return $ this ->tsx ->isRolledBack ();
84
+ }
70
85
}
Original file line number Diff line number Diff line change 13
13
14
14
namespace Laudis \Neo4j \Bolt ;
15
15
16
- use Bolt \Bolt ;
17
16
use Bolt \error \ConnectionTimeoutException ;
18
17
use Bolt \error \MessageException ;
19
18
use Bolt \protocol \V3 ;
@@ -55,6 +54,7 @@ final class BoltUnmanagedTransaction implements UnmanagedTransactionInterface
55
54
private string $ database ;
56
55
57
56
private bool $ isRolledBack = false ;
57
+
58
58
private bool $ isCommitted = false ;
59
59
60
60
/**
@@ -180,13 +180,29 @@ private function handleMessageException(MessageException $e): void
180
180
}
181
181
182
182
/**
183
- * @return never
184
183
* @throws ConnectionTimeoutException
184
+ *
185
+ * @return never
185
186
*/
186
187
private function handleConnectionTimeoutException (ConnectionTimeoutException $ e ): void
187
188
{
188
189
$ this ->connection ->reset ();
189
190
190
191
throw $ e ;
191
192
}
193
+
194
+ public function isRolledBack (): bool
195
+ {
196
+ return $ this ->isRolledBack ;
197
+ }
198
+
199
+ public function isCommitted (): bool
200
+ {
201
+ return $ this ->isCommitted ;
202
+ }
203
+
204
+ public function isFinished (): bool
205
+ {
206
+ return $ this ->isRolledBack () || $ this ->isCommitted ();
207
+ }
192
208
}
Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ public function isRolledBack(): bool;
49
49
/**
50
50
* Returns whether the transaction has been committed.
51
51
*/
52
- public function isCommitted (): void ;
52
+ public function isCommitted (): bool ;
53
53
54
54
/**
55
55
* Returns whether the transaction is safe to use.
56
56
*/
57
- public function isFinished (): void ;
57
+ public function isFinished (): bool ;
58
58
}
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ final class HttpUnmanagedTransaction implements UnmanagedTransactionInterface
49
49
*/
50
50
private FormatterInterface $ formatter ;
51
51
52
+ private bool $ isCommitted = false ;
53
+
54
+ private bool $ isRolledBack = false ;
55
+
52
56
/**
53
57
* @psalm-mutation-free
54
58
*
@@ -135,4 +139,19 @@ public function __destruct()
135
139
{
136
140
$ this ->connection ->close ();
137
141
}
142
+
143
+ public function isRolledBack (): bool
144
+ {
145
+ return $ this ->isRolledBack ;
146
+ }
147
+
148
+ public function isCommitted (): bool
149
+ {
150
+ return $ this ->isCommitted ;
151
+ }
152
+
153
+ public function isFinished (): bool
154
+ {
155
+ return $ this ->isRolledBack () || $ this ->isCommitted ();
156
+ }
138
157
}
You can’t perform that action at this time.
0 commit comments