Repository: neo4j-contrib/neo4j-jdbc
Pull request #465 (2023-08-31 17:53:15)

Bump org.neo4j.driver:neo4j-java-driver from 5.6.0 to 5.12.0
Bumps [org.neo4j.driver:neo4j-java-driver](https://github.com/neo4j/neo4j-java-driver) from 5.6.0 to 5.12.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/neo4j/neo4j-java-driver/releases">org.neo4j.driver:neo4j-java-driver's releases</a>.</em></p>
<blockquote>
<h2>5.12.0</h2>
<p>This release includes an optimisation that removes a network roundtrip in the <code>ExecutableQuery</code>. <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1482">#1482</a></p>
<p>By removing the round trip when using the <code>ExecutableQuery</code> the network overhead of running the query is reduced by up to 1/3rd. Most benefit will be seen when running lots of single queries with few records that complete quickly on the server.</p>
<p>In addition, the token rotation API has been updated. <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1481">#1481</a></p>
<p><a href="https://neo4j.com/docs/api/java-driver/5.12">5.12 API documentation</a></p>
<h4>👏 Improvements</h4>
<hr />
<ul>
<li>Introduce BEGIN message pipelining in ExecutableQuery <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1482">#1482</a></li>
<li>Update AuthToken rotation to support more auth types <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1481">#1481</a></li>
<li>Update JUnit to 5.10.0, Surefire to 3.1.2 and Failsafe to 3.1.2 <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1473">#1473</a></li>
<li>Refactoring <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1474">#1474</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1475">#1475</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1476">#1476</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1477">#1477</a></li>
<li>Introduce inspection profile <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1478">#1478</a></li>
</ul>
<h4>🔧 Dependency Management</h4>
<hr />
<ul>
<li>Update dependencies <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1483">#1483</a></li>
</ul>
<h2>5.11.0</h2>
<p>This update introduces cancellation support to the <code>ReactiveSession.run</code> methods. This aims to ensure that the transaction is rolled back and the acquired connection is returned back to the connection pool. <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1457">#1457</a></p>
<p>In addition, the driver will round up sub millisecond values in the transaction timeout configuration. <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1451">#1451</a></p>
<p>Furthermore, an experimental BlockHound integration has been introduced. <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1450">#1450</a></p>
<p><a href="https://neo4j.com/docs/api/java-driver/5.11">5.11 API documentation</a></p>
<h4>👏 Improvements</h4>
<hr />
<ul>
<li>Update sub millisecond transaction timeout handling <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1451">#1451</a></li>
<li>Add support for cancellation on reactive session run <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1457">#1457</a></li>
<li>Improve explicit transaction terminated state handling <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1445">#1445</a></li>
<li>Ensure transaction prevents new query runs when it is closing <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1446">#1446</a></li>
<li>Add experimental BlockHound integration <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1450">#1450</a></li>
<li>Make a copy of bookmarks in SessionConfig builder <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1465">#1465</a></li>
<li>Refactoring <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1447">#1447</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1448">#1448</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1449">#1449</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1452">#1452</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1454">#1454</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1455">#1455</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1458">#1458</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1459">#1459</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1460">#1460</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1462">#1462</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1463">#1463</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1466">#1466</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1467">#1467</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1468">#1468</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1469">#1469</a> <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1470">#1470</a></li>
</ul>
<h4>🔧 Dependency Management</h4>
<hr />
<ul>
<li>Update dependencies <a href="https://redirect.github.com/neo4j/neo4j-java-driver/pull/1471">#1471</a></li>
</ul>
<h2>5.10.0</h2>
<p>This is a planned minor update release that includes several general improvements.</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/5bd7c0c762668653c02b042b55c6d983d5f245d9"><code>5bd7c0c</code></a> Update dependencies (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1483">#1483</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/e95db9665c0c0fa59bc9497382e7ac1fffab18b7"><code>e95db96</code></a> Introduce BEGIN message pipelining in ExecutableQuery (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1482">#1482</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/c3b10e30b4d2553e37b931fc9e7c990ec1ee699d"><code>c3b10e3</code></a> Update AuthToken rotation to support more auth types (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1481">#1481</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/3958fced850599d2559df07b31f21cf1f4532707"><code>3958fce</code></a> Introduce inspection profile (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1478">#1478</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/53a29e36526abead68f91ab91242d26dc5f66cb4"><code>53a29e3</code></a> Refactoring (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1477">#1477</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/1a7f23ac4b728c720fa5cef1d09ede63ce167182"><code>1a7f23a</code></a> Refactoring (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1476">#1476</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/eeadd9707467a52849846f41feb9a01bb813328f"><code>eeadd97</code></a> Refactoring (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1475">#1475</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/80fd687f8dae6156c9c7ce2353b29467a9b039dc"><code>80fd687</code></a> Refactoring (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1474">#1474</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/f3984a2ebcc52c385c47a6c7f81cddc66dce8162"><code>f3984a2</code></a> Update JUnit to 5.10.0, Surefire to 3.1.2 and Failsafe to 3.1.2 (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1473">#1473</a>)</li>
<li><a href="https://github.com/neo4j/neo4j-java-driver/commit/a2ddadef108aa8843c5e1ca125fc3f7525e5ad5f"><code>a2ddade</code></a> Update version to 5.12-SNAPSHOT (<a href="https://redirect.github.com/neo4j/neo4j-java-driver/issues/1472">#1472</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/neo4j/neo4j-java-driver/compare/5.6.0...5.12.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.6.0&new-version=5.12.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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@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/pom.xml b/neo4j-jdbc-bolt/pom.xml
index 4ad05d0a..990145eb 100644
--- a/neo4j-jdbc-bolt/pom.xml
+++ b/neo4j-jdbc-bolt/pom.xml
@@ -46,7 +46,7 @@
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
-            <version>3.12.0</version>
+            <version>3.13.0</version>
         </dependency>
 
         <!-- Performance tests dependencies -->
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 957758d7..d512dd43 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,10 +1,11 @@
 package org.neo4j.jdbc.bolt.cache;
 
+import org.neo4j.driver.AuthToken;
 import org.neo4j.driver.BaseSession;
 import org.neo4j.driver.BookmarkManager;
 import org.neo4j.driver.Driver;
+import org.neo4j.driver.ExecutableQuery;
 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;
@@ -40,12 +41,12 @@ public class BoltDriverCached implements Driver {
     }
 
     @Override
-    public QueryTask queryTask(String s) {
+    public ExecutableQuery executableQuery(String ignored) {
         throw UNSUPPORTED_OPERATION_EXCEPTION;
     }
 
     @Override
-    public BookmarkManager queryTaskBookmarkManager() {
+    public BookmarkManager executableQueryBookmarkManager() {
         throw UNSUPPORTED_OPERATION_EXCEPTION;
     }
 
@@ -71,6 +72,11 @@ public class BoltDriverCached implements Driver {
         throw UNSUPPORTED_OPERATION_EXCEPTION;
     }
 
+    @Override
+    public <T extends BaseSession> T session(Class<T> aClass, SessionConfig sessionConfig, AuthToken authToken) {
+        throw UNSUPPORTED_OPERATION_EXCEPTION;
+    }
+
     @Override
     public RxSession rxSession() {
         throw UNSUPPORTED_OPERATION_EXCEPTION;
@@ -134,6 +140,16 @@ public class BoltDriverCached implements Driver {
         throw UNSUPPORTED_OPERATION_EXCEPTION;
     }
 
+    @Override
+    public boolean verifyAuthentication(AuthToken authToken) {
+        throw UNSUPPORTED_OPERATION_EXCEPTION;
+    }
+
+    @Override
+    public boolean supportsSessionAuth() {
+        throw UNSUPPORTED_OPERATION_EXCEPTION;
+    }
+
     @Override
     public boolean supportsMultiDb() {
         return internal.supportsMultiDb();
diff --git a/pom.xml b/pom.xml
index d608bdcc..e1880b69 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,7 +79,7 @@
 		<mockito.version>5.5.0</mockito.version>
 		<junit.version>4.13.2</junit.version>
 		<jmh.version>1.37</jmh.version>
-		<neo4j.java.driver.version>5.6.0</neo4j.java.driver.version>
+		<neo4j.java.driver.version>5.12.0</neo4j.java.driver.version>
 		<neo4j.version>4.4.10</neo4j.version>
 		<httpclient.version>4.5.13</httpclient.version>
 		<jackson.version>2.15.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 28bd7fb5..4d3f9153 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
@@ -501,9 +501,19 @@ public class BoltNeo4jConnectionTest {
 	@Ignore @Test public void setAutoCommitShouldThrowExceptionOnDatabaseAccessErrorOccurred() throws SQLException {
 		expectedEx.expect(SQLException.class);
 
-		NetworkSession networkSession = new NetworkSession(null, null,
-				DatabaseNameUtil.database(""), AccessMode.READ, Set.of(), "", FetchSizeUtil.UNLIMITED_FETCH_SIZE, DevNullLogging.DEV_NULL_LOGGING,
-				new Neo4jBookmarkManager(Set.of(), (a) -> {}, () -> Set.of()));
+		NetworkSession networkSession = new NetworkSession(
+				null,
+				null,
+				DatabaseNameUtil.database(""),
+				AccessMode.READ,
+				Set.of(),
+				"",
+				FetchSizeUtil.UNLIMITED_FETCH_SIZE,
+				DevNullLogging.DEV_NULL_LOGGING,
+				new Neo4jBookmarkManager(Set.of(), (a) -> {}, Set::of),
+				NotificationConfig.defaultConfig(),
+				null
+		);
 
 		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 df075223..888e2c29 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
@@ -151,9 +151,19 @@ public class Mocker {
 	public static Driver mockDriver() {
 		Driver mockedDriver = mock(org.neo4j.driver.Driver.class);
 		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(Set.of(), (a) -> {}, () -> Set.of()));
+		NetworkSession networkSession = new NetworkSession(
+				connectionProvider,
+				null,
+				DatabaseNameUtil.database(""),
+				AccessMode.READ,
+				Set.of(),
+				"",
+				FetchSizeUtil.UNLIMITED_FETCH_SIZE,
+				DevNullLogging.DEV_NULL_LOGGING,
+				new Neo4jBookmarkManager(Set.of(), (a) -> {}, Set::of),
+				NotificationConfig.defaultConfig(),
+				null
+		);
 		Mockito.when(mockedDriver.session()).thenReturn(new InternalSession(networkSession));
 		return mockedDriver;
 	}
diff --git a/neo4j-jdbc-examples/mybatis/src/test/java/org/neo4j/jdbc/example/mybatis/ActorManagerContainerIT.java b/neo4j-jdbc-examples/mybatis/src/test/java/org/neo4j/jdbc/example/mybatis/ActorManagerContainerIT.java
index 0f91ede2..197d3325 100644
--- a/neo4j-jdbc-examples/mybatis/src/test/java/org/neo4j/jdbc/example/mybatis/ActorManagerContainerIT.java
+++ b/neo4j-jdbc-examples/mybatis/src/test/java/org/neo4j/jdbc/example/mybatis/ActorManagerContainerIT.java
@@ -88,10 +88,10 @@ public class ActorManagerContainerIT {
 		try (final Driver driver = GraphDatabase.driver(new URI(neo4jContainer.getBoltUrl()), AuthTokens.basic("neo4j", neo4jContainer.getAdminPassword()))) {
 			final String foo = "foo";
 			try (final Session session = driver.session(SessionConfig.forDatabase("system"))) {
-				session.writeTransaction(tx -> tx.run("create database " + foo + " if not exists"));
+				session.writeTransaction(tx -> tx.run("create database " + foo + " if not exists").consume());
 			}
 			try (final Session session = driver.session(SessionConfig.forDatabase(foo))) {
-				session.writeTransaction(tx -> tx.run("create (p:Person{name: 'Dave Chappelle', born: 1973})"));
+				session.writeTransaction(tx -> tx.run("create (p:Person{name: 'Dave Chappelle', born: 1973})").consume());
 			}
 		}
 	}