Repository: neo4j-contrib/neo4j-jdbc
Pull request #413 (2023-02-24 17:56:39)

Bump neo4j-java-driver from 5.1.0 to 5.6.0
Bumps [neo4j-java-driver](https://github.com/neo4j/neo4j-java-driver) from 5.1.0 to 5.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/neo4j/neo4j-java-driver/releases">neo4j-java-driver's releases</a>.</em></p>
<blockquote>
<h2>5.6.0</h2>
<p>This is a planned minor update release that includes several general improvements.</p>
<h4>👏 Improvements</h4>
<hr />
<ul>
<li>Unmark TypeSystem as experimental <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1376">#1376</a></li>
<li>Update internal driver clock usage <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1375">#1375</a></li>
<li>Rename Driver.queryBookmarkManager() to Driver.queryTaskBookmarkManager() <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1373">#1373</a></li>
<li>Update clirr configuration to check against previous version <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1381">#1381</a></li>
<li>Improve Javadoc <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1382">#1382</a></li>
<li>Update version to 5.5-SNAPSHOT <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1370">#1370</a></li>
</ul>
<h4>🔧 Dependency Management</h4>
<hr />
<ul>
<li>Update dependencies <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1383">#1383</a></li>
</ul>
<h2>5.5.0</h2>
<p>The main feature of this release is a new experimental API that offers a convenient query execution option within a managed transaction with automatic retries on errors eligible for retrying.</p>
<p>Sample usage:</p>
<pre><code>var eagerResult = driver.queryTask(&quot;CREATE (n{field: $value}) RETURN n&quot;)
                    .withParameters(Map.of(&quot;value&quot;, &quot;5&quot;))
                    .execute();
</code></pre>
<p>In addition, it is also possible to provide a <code>java.util.stream.Collector</code> implementation to collect <code>Record</code>s to a desired final value:</p>
<pre><code>var result = driver.queryTask(&quot;UNWIND range(0, 5) as N RETURN N&quot;)
        .execute(Collectors.mapping(record -&gt; record.get(&quot;N&quot;).asLong(), Collectors.toList()));
</code></pre>
<p>See the <code>QueryTask</code> <a href="https://neo4j.com/docs/api/java-driver/5.5/org.neo4j.driver/org/neo4j/driver/QueryTask.html">documentation</a> for more details.</p>
<p>If you would like to share your feedback on this new API, please see the following <a href="https://github.com/neo4j/neo4j-java-driver/discussions/1374">discussion</a>.</p>
<h4>⭐ New Features</h4>
<hr />
<ul>
<li>Introduce managed query execution on Driver level <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1330">#1330</a> <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1367">#1367</a> <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1369">#1369</a></li>
</ul>
<h4>👏 Improvements</h4>
<hr />
<ul>
<li>Stop printing stacktrace in GraphDatabaseTest <a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/pull/1364">#1364</a></li>
</ul>
<h4>🔧 Dependency Management</h4>
<hr />
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/c7b1987f599d38f87d055b33d328a0675c92e126"><code>c7b1987</code></a> Update dependencies (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1383">#1383</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/11c68cba033e50057c99d40ea55b05cd2abe604c"><code>11c68cb</code></a> Improve Javadoc (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1382">#1382</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/a8b609b2c269deea144f469a884f375ea55ecae5"><code>a8b609b</code></a> Update clirr configuration to check against previous version (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1381">#1381</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/6dd7c0cbddc082183a89eabf0b3b4cbec69d0b23"><code>6dd7c0c</code></a> Unmark TypeSystem as experimental (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1376">#1376</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/7d0e75c69dc92288099a0831f09e3ab50d241255"><code>7d0e75c</code></a> Update internal driver clock usage (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1375">#1375</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/4633115789661fc4ec48b9c7e6ccd03b15c7932c"><code>4633115</code></a> Rename Driver.queryBookmarkManager() to Driver.queryTaskBookmarkManager() (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1">#1</a>...</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/1c9a6504ac32048c38e59a403cd02188e1d3e94e"><code>1c9a650</code></a> Update version to 5.5-SNAPSHOT (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1370">#1370</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/589296fab530026511c781ca712ef51e52c6cf60"><code>589296f</code></a> Update QueryTask Javadoc (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1369">#1369</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/78a24673229c54e83b8b4f1cd1df2de22b10e91b"><code>78a2467</code></a> Update dependencies (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1368">#1368</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/8115a010513bf332350613c6ce2f5cdcc2abeca4"><code>8115a01</code></a> Add a new QueryTask.ResultFinisher interface (<a href="https://github-redirect.dependabot.com/neo4j/neo4j-java-driver/issues/1367">#1367</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/neo4j/neo4j-java-driver/compare/5.1.0...5.6.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.neo4j.driver:neo4j-java-driver&package-manager=maven&previous-version=5.1.0&new-version=5.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/neo4j-jdbc-bolt/src/main/java/org/neo4j/jdbc/bolt/cache/BoltDriverCached.java b/neo4j-jdbc-bolt/src/main/java/org/neo4j/jdbc/bolt/cache/BoltDriverCached.java
index 56ccb7f7..957758d7 100644
--- a/neo4j-jdbc-bolt/src/main/java/org/neo4j/jdbc/bolt/cache/BoltDriverCached.java
+++ b/neo4j-jdbc-bolt/src/main/java/org/neo4j/jdbc/bolt/cache/BoltDriverCached.java
@@ -1,7 +1,10 @@
 package org.neo4j.jdbc.bolt.cache;
 
+import org.neo4j.driver.BaseSession;
+import org.neo4j.driver.BookmarkManager;
 import org.neo4j.driver.Driver;
 import org.neo4j.driver.Metrics;
+import org.neo4j.driver.QueryTask;
 import org.neo4j.driver.Session;
 import org.neo4j.driver.SessionConfig;
 import org.neo4j.driver.async.AsyncSession;
@@ -36,6 +39,16 @@ public class BoltDriverCached implements Driver {
         this.key = key;
     }
 
+    @Override
+    public QueryTask queryTask(String s) {
+        throw UNSUPPORTED_OPERATION_EXCEPTION;
+    }
+
+    @Override
+    public BookmarkManager queryTaskBookmarkManager() {
+        throw UNSUPPORTED_OPERATION_EXCEPTION;
+    }
+
     @Override
     public boolean isEncrypted() {
         return internal.isEncrypted();
@@ -53,6 +66,11 @@ public class BoltDriverCached implements Driver {
         return internal.session(sessionConfig);
     }
 
+    @Override
+    public <T extends BaseSession> T session(Class<T> aClass, SessionConfig sessionConfig) {
+        throw UNSUPPORTED_OPERATION_EXCEPTION;
+    }
+
     @Override
     public RxSession rxSession() {
         throw UNSUPPORTED_OPERATION_EXCEPTION;
diff --git a/pom.xml b/pom.xml
index 1577839d..b253d2ab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,7 +79,7 @@
 		<mockito.version>5.2.0</mockito.version>
 		<junit.version>4.13.2</junit.version>
 		<jmh.version>1.36</jmh.version>
-		<neo4j.java.driver.version>5.1.0</neo4j.java.driver.version>
+		<neo4j.java.driver.version>5.6.0</neo4j.java.driver.version>
 		<neo4j.version>4.4.10</neo4j.version>
 		<httpclient.version>4.5.13</httpclient.version>
 		<jackson.version>2.14.2</jackson.version>


Test patch:
diff --git a/neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/BoltNeo4jConnectionTest.java b/neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/BoltNeo4jConnectionTest.java
index 22214dfe..28bd7fb5 100644
--- a/neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/BoltNeo4jConnectionTest.java
+++ b/neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/BoltNeo4jConnectionTest.java
@@ -503,17 +503,7 @@ public class BoltNeo4jConnectionTest {
 
 		NetworkSession networkSession = new NetworkSession(null, null,
 				DatabaseNameUtil.database(""), AccessMode.READ, Set.of(), "", FetchSizeUtil.UNLIMITED_FETCH_SIZE, DevNullLogging.DEV_NULL_LOGGING,
-				new Neo4jBookmarkManager(Map.of(), (a, b) -> {}, new BookmarksSupplier() {
-					@Override
-					public Set<Bookmark> getBookmarks(String s) {
-						return null;
-					}
-
-					@Override
-					public Set<Bookmark> getAllBookmarks() {
-						return null;
-					}
-				}));
+				new Neo4jBookmarkManager(Set.of(), (a) -> {}, () -> Set.of()));
 
 		Session session = new InternalSession(networkSession);
 		org.neo4j.driver.Driver driver = mock(org.neo4j.driver.Driver.class);
diff --git a/neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/utils/Mocker.java b/neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/utils/Mocker.java
index 1f2dcc44..df075223 100644
--- a/neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/utils/Mocker.java
+++ b/neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/utils/Mocker.java
@@ -153,17 +153,7 @@ public class Mocker {
 		ConnectionProvider connectionProvider = mock(ConnectionProvider.class, RETURNS_MOCKS);
 		NetworkSession networkSession = new NetworkSession(connectionProvider, null,
 				DatabaseNameUtil.database(""), AccessMode.READ, Set.of(), "", FetchSizeUtil.UNLIMITED_FETCH_SIZE, DevNullLogging.DEV_NULL_LOGGING,
-				new Neo4jBookmarkManager(Map.of(), (a, b) -> {}, new BookmarksSupplier() {
-					@Override
-					public Set<Bookmark> getBookmarks(String s) {
-						return Set.of();
-					}
-
-					@Override
-					public Set<Bookmark> getAllBookmarks() {
-						return Set.of();
-					}
-				}));
+				new Neo4jBookmarkManager(Set.of(), (a) -> {}, () -> Set.of()));
 		Mockito.when(mockedDriver.session()).thenReturn(new InternalSession(networkSession));
 		return mockedDriver;
 	}