Search in sources :

Example 11 with Transaction

use of org.neo4j.driver.v1.Transaction in project neo4j by neo4j.

the class BoltCausalClusteringIT method executeReadQuery.

private void executeReadQuery(String bookmark, Session session) {
    try (Transaction tx = session.beginTransaction(bookmark)) {
        Record record = tx.run("MATCH (n:Person) RETURN COUNT(*) AS count").next();
        assertEquals(1, record.get("count").asInt());
    }
}
Also used : Transaction(org.neo4j.driver.v1.Transaction) Record(org.neo4j.driver.v1.Record)

Aggregations

Test (org.junit.Test)10 Driver (org.neo4j.driver.v1.Driver)7 Session (org.neo4j.driver.v1.Session)7 Transaction (org.neo4j.driver.v1.Transaction)6 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)5 CoreClusterMember (org.neo4j.causalclustering.discovery.CoreClusterMember)5 RoutingNetworkSession (org.neo4j.driver.internal.RoutingNetworkSession)5 Record (org.neo4j.driver.v1.Record)5 PartialResultSet (com.google.spanner.v1.PartialResultSet)3 Transaction (com.google.spanner.v1.Transaction)3 IOException (java.io.IOException)2 RemoteException (java.rmi.RemoteException)2 ReadReplica (org.neo4j.causalclustering.discovery.ReadReplica)2 GuardTimeoutException (org.neo4j.kernel.guard.GuardTimeoutException)2 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)2 CommunityNeoServer (org.neo4j.server.CommunityNeoServer)2 ShellException (org.neo4j.shell.ShellException)2 URL (java.net.URL)1 HashSet (java.util.HashSet)1 BoltServerAddress (org.neo4j.driver.internal.net.BoltServerAddress)1