Skip to content

Commit 33447f5

Browse files
authored
Delete Session.reset (#1149)
1 parent 936c699 commit 33447f5

File tree

11 files changed

+17
-1045
lines changed

11 files changed

+17
-1045
lines changed

driver/clirr-ignored-differences.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,10 @@
6161
<method>java.lang.Iterable values()</method>
6262
</difference>
6363

64+
<difference>
65+
<className>org/neo4j/driver/Session</className>
66+
<differenceType>7002</differenceType>
67+
<method>void reset()</method>
68+
</difference>
69+
6470
</differences>

driver/src/main/java/org/neo4j/driver/Session.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -222,23 +222,6 @@ public interface Session extends Resource, QueryRunner
222222
*/
223223
Bookmark lastBookmark();
224224

225-
/**
226-
* Reset the current session. This sends an immediate RESET signal to the server which both interrupts
227-
* any query that is currently executing and ignores any subsequently queued queries. Following
228-
* the reset, the current transaction will have been rolled back and any outstanding failures will
229-
* have been acknowledged.
230-
*
231-
* @deprecated This method should not be used and violates the expected usage pattern of {@link Session} objects.
232-
* They are expected to be not thread-safe and should not be shared between thread. However this method is only
233-
* useful when {@link Session} object is passed to another monitoring thread that calls it when appropriate.
234-
* It is not useful when {@link Session} is used in a single thread because in this case {@link #close()}
235-
* can be used. Since version 3.1, Neo4j database allows users to specify maximum transaction execution time and
236-
* contains procedures to list and terminate running queries. These functions should be used instead of calling
237-
* this method.
238-
*/
239-
@Deprecated
240-
void reset();
241-
242225
/**
243226
* Signal that you are done using this session. In the default driver usage, closing and accessing sessions is
244227
* very low cost.

driver/src/main/java/org/neo4j/driver/internal/InternalSession.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,6 @@ public Bookmark lastBookmark()
130130
return session.lastBookmark();
131131
}
132132

133-
@Override
134-
@SuppressWarnings( "deprecation" )
135-
public void reset()
136-
{
137-
Futures.blockingGet( session.resetAsync(), () -> terminateConnectionOnThreadInterrupt( "Thread interrupted while resetting the session" ) );
138-
}
139-
140133
private <T> T transaction( AccessMode mode, TransactionWork<T> work, TransactionConfig config )
141134
{
142135
// use different code path compared to async so that work is executed in the caller thread

driver/src/main/java/org/neo4j/driver/internal/async/NetworkSession.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -135,28 +135,6 @@ public CompletionStage<UnmanagedTransaction> beginTransactionAsync( AccessMode m
135135
return newTransactionStage;
136136
}
137137

138-
public CompletionStage<Void> resetAsync()
139-
{
140-
return existingTransactionOrNull()
141-
.thenAccept( tx ->
142-
{
143-
if ( tx != null )
144-
{
145-
tx.markTerminated( null );
146-
}
147-
} )
148-
.thenCompose( ignore -> connectionStage )
149-
.thenCompose( connection ->
150-
{
151-
if ( connection != null )
152-
{
153-
// there exists an active connection, send a RESET message over it
154-
return connection.reset();
155-
}
156-
return completedWithNull();
157-
} );
158-
}
159-
160138
public RetryLogic retryLogic()
161139
{
162140
return retryLogic;

driver/src/main/java/org/neo4j/driver/internal/reactive/InternalRxSession.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@ public Bookmark lastBookmark()
196196
return session.lastBookmark();
197197
}
198198

199-
public Publisher<Void> reset()
200-
{
201-
return createEmptyPublisher( session::resetAsync );
202-
}
203-
204199
@Override
205200
public <T> Publisher<T> close()
206201
{

0 commit comments

Comments
 (0)