Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Neo4jsource
Commits
29bc2dd7
Commit
29bc2dd7
authored
7 years ago
by
Ali Ince
Browse files
Options
Download
Email Patches
Plain Diff
changed pendingTerminationNotice's type to be Status
parent
34a14b98
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/TransactionStateMachine.java
+8
-8
...va/org/neo4j/bolt/v1/runtime/TransactionStateMachine.java
community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/TransactionStateMachineTest.java
+2
-2
...rg/neo4j/bolt/v1/runtime/TransactionStateMachineTest.java
with
10 additions
and
10 deletions
+10
-10
community/bolt/src/main/java/org/neo4j/bolt/v1/runtime/TransactionStateMachine.java
+
8
-
8
View file @
29bc2dd7
...
...
@@ -137,13 +137,13 @@ public class TransactionStateMachine implements StatementProcessor
if
(
tx
!=
null
)
{
Optional
<
Status
>
status
=
tx
.
getReasonIfTerminated
();
Optional
<
Status
>
status
Opt
=
tx
.
getReasonIfTerminated
();
if
(
status
.
isPresent
()
)
if
(
status
Opt
.
isPresent
()
)
{
if
(
status
.
get
().
code
().
classification
().
rollbackTransaction
()
)
if
(
status
Opt
.
get
().
code
().
classification
().
rollbackTransaction
()
)
{
ctx
.
pendingTerminationNotice
=
status
;
ctx
.
pendingTerminationNotice
=
status
Opt
.
get
()
;
reset
();
}
...
...
@@ -153,11 +153,11 @@ public class TransactionStateMachine implements StatementProcessor
private
void
ensureNoPendingTerminationNotice
()
{
if
(
ctx
.
pendingTerminationNotice
.
isPresent
()
)
if
(
ctx
.
pendingTerminationNotice
!=
null
)
{
Status
status
=
ctx
.
pendingTerminationNotice
.
get
()
;
Status
status
=
ctx
.
pendingTerminationNotice
;
ctx
.
pendingTerminationNotice
=
Optional
.
empty
()
;
ctx
.
pendingTerminationNotice
=
null
;
throw
new
TransactionTerminatedException
(
status
);
}
...
...
@@ -422,7 +422,7 @@ public class TransactionStateMachine implements StatementProcessor
/** The current transaction, if present */
KernelTransaction
currentTransaction
;
Optional
<
Status
>
pendingTerminationNotice
=
Optional
.
empty
()
;
Status
pendingTerminationNotice
;
/** Last Cypher statement executed */
String
lastStatement
=
""
;
...
...
This diff is collapsed.
Click to expand it.
community/bolt/src/test/java/org/neo4j/bolt/v1/runtime/TransactionStateMachineTest.java
+
2
-
2
View file @
29bc2dd7
...
...
@@ -255,7 +255,7 @@ public class TransactionStateMachineTest
TransactionStateMachineSPI
stateMachineSPI
=
newTransactionStateMachineSPI
(
transaction
);
TransactionStateMachine
stateMachine
=
newTransactionStateMachine
(
stateMachineSPI
);
stateMachine
.
ctx
.
pendingTerminationNotice
=
Optional
.
of
(
Status
.
Transaction
.
TransactionTimedOut
)
;
stateMachine
.
ctx
.
pendingTerminationNotice
=
Status
.
Transaction
.
TransactionTimedOut
;
try
{
...
...
@@ -280,7 +280,7 @@ public class TransactionStateMachineTest
TransactionStateMachine
stateMachine
=
newTransactionStateMachine
(
stateMachineSPI
);
stateMachine
.
run
(
"SOME STATEMENT"
,
null
);
stateMachine
.
ctx
.
pendingTerminationNotice
=
Optional
.
of
(
Status
.
Transaction
.
TransactionTimedOut
)
;
stateMachine
.
ctx
.
pendingTerminationNotice
=
Status
.
Transaction
.
TransactionTimedOut
;
try
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help