File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
driver/src/main/java/org/neo4j/driver/internal Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -56,24 +56,31 @@ public class ExplicitTransaction implements Transaction
56
56
private enum State
57
57
{
58
58
/** The transaction is running with no explicit success or failure marked */
59
- ACTIVE ,
59
+ ACTIVE ( true ) ,
60
60
61
61
/** Running, user marked for success, meaning it'll value committed */
62
- MARKED_SUCCESS ,
62
+ MARKED_SUCCESS ( true ) ,
63
63
64
64
/** User marked as failed, meaning it'll be rolled back. */
65
- MARKED_FAILED ,
65
+ MARKED_FAILED ( true ) ,
66
66
67
67
/**
68
68
* This transaction has been explicitly terminated by calling {@link Session#reset()}.
69
69
*/
70
- TERMINATED ,
70
+ TERMINATED ( false ) ,
71
71
72
72
/** This transaction has successfully committed */
73
- COMMITTED ,
73
+ COMMITTED ( false ) ,
74
74
75
75
/** This transaction has been rolled back */
76
- ROLLED_BACK
76
+ ROLLED_BACK ( false );
77
+
78
+ final boolean txOpen ;
79
+
80
+ State ( boolean txOpen )
81
+ {
82
+ this .txOpen = txOpen ;
83
+ }
77
84
}
78
85
79
86
private final Connection connection ;
@@ -289,7 +296,7 @@ public CompletionStage<StatementResultCursor> runAsync( Statement statement )
289
296
@ Override
290
297
public boolean isOpen ()
291
298
{
292
- return state != State . COMMITTED && state != State . ROLLED_BACK && state != State . TERMINATED ;
299
+ return state . txOpen ;
293
300
}
294
301
295
302
private void ensureCanRunQueries ()
You can’t perform that action at this time.
0 commit comments