Giter VIP home page Giter VIP logo

neo4j-dotnet-driver's Introduction

Neo4j .NET Driver

This repository contains the official Neo4j driver for .NET.

This document covers the usage of the driver; for contribution guidance, see Contributing.

Installation

Neo4j publishes its .NET libraries to NuGet with the following targets:

To add the latest NuGet package:

> dotnet add package Neo4j.Driver

Versions

Starting with 5.0, the Neo4j drivers moved to a monthly release cadence. A new minor version is released on the last Thursday of each month to maintain versioning consistency with the core product (Neo4j DBMS), which also has moved to a monthly cadence.

As a policy, Neo4j will not release patch versions except on rare occasions. Bug fixes and updates will go into the latest minor version; users should upgrade to a later version to patch bug fixes. Driver upgrades within a major version will never contain breaking API changes, excluding the Neo4j.Driver.Preview namespace reserved for the preview of features.

See also: https://neo4j.com/developer/kb/neo4j-supported-versions/

Synchronous and Reactive driver extensions

Strong-named

A strong-named version of each driver package is available on NuGet Neo4j.Driver.Signed. The strong-named packages contain the same version of their respective packages with strong-name compliance. Consider using the strong-named version only if your project is strong-named or requires strong-named dependencies.

To add the strong-named version of the driver to your project using the NuGet Package Manager:

> Install-Package Neo4j.Driver.Signed

Getting started

Connecting to a Neo4j database:

using Neo4j.Driver;

await using var driver = GraphDatabase.Driver("bolt://localhost:7687", AuthTokens.Basic("neo4j", "password"));

There are a few points to highlight when adding the driver to your project:

  • Each IDriver instance maintains a pool of connections inside; as a result, use a single driver instance per application.
  • Sessions and transactions do not open new connections if a free one is in the driver's connection pool; this makes both resources cheap to create and close.
  • The driver is thread-safe and made to be used across an application. Sessions and transactions are not thread-safe; using a session or transaction concurrently will result in undefined behavior.

Verifying connectivity:

await driver.VerifyConnectivityAsync();

To ensure the credentials and URLs specified when creating the driver, you can call VerifyConnectivityAsync on the driver instance. If either configuration is wrong, the Task will result in an exception.

Executing a single query transaction:

await driver.ExecutableQuery("CREATE (:Node{id: 0})")
    .WithConfig(new QueryConfig(database:"neo4j"))
    .ExecuteAsync();

As of version 5.10, The .NET driver includes a fluent querying API on the driver's IDriver interface. The fluent API is the most concise API for executing single query transactions. It avoids the boilerplate that comes with handling complex problems, such as results that exceed memory or multi-query transactions.

Remember to specify a database.

    .WithConfig(new QueryConfig(database:"neo4j"))

Always specify the database when you know which database the transaction should execute against. By setting the database parameter, the driver avoids a roundtrip and concurrency machinery associated with negotiating a home database.

Getting Results

var response = await driver.ExecutableQuery("MATCH (n:Node) RETURN n.id as id")
    .WithConfig(dbConfig)
    .ExecuteAsync();

The response from the fluent APIs is an EagerResult<IReadOnlyList<IRecord>> unless we use other APIs; more on that later. EagerResult comprises of the following:

  • All records materialized(Result).
  • keys returned from the query(Keys).
  • a query summary(Summary).

Decomposing EagerResult

var (result, _, _) = await driver.ExecutableQuery(query)
    .WithConfig(dbConfig)
    .ExecuteAsync();
foreach (var record in result)
    Console.WriteLine($"node: {record["id"]}")

EagerResult allows you to discard unneeded values with decomposition for an expressive API.

Mapping

var (result, _, _) = await driver.ExecutableQuery(query)
    .WithConfig(dbConfig)
    .WithMap(record => new EntityDTO { id = record["id"].As<long>() })
    .ExecuteAsync();

Types

Values in a record are currently exposed as of object type. The underlying types of these values are determined by their Cypher types.

The mapping between driver types and Cypher types are listed in the table bellow:

Cypher Type Driver Type
null null
List IList< object >
Map IDictionary<string, object>
Boolean boolean
Integer long
Float float
String string
ByteArray byte[]
Point Point
Node INode
Relationship IRelationship
Path IPath

To convert from object to the driver type, a helper method ValueExtensions#As<T> can be used:

IRecord record = await result.SingleAsync();
string name = record["name"].As<string>();

Temporal Types - Date and Time

The mapping among the Cypher temporal types, driver types, and convertible CLR temporal types - DateTime, TimeSpan and DateTimeOffset - (via IConvertible interface) are as follows:

Cypher Type Driver Type Convertible CLR Type
Date LocalDate DateTime, DateOnly(.NET6+)
Time OffsetTime TimeOnly(.NET6+)
LocalTime LocalTime TimeSpan, DateTime
DateTime ZonedDateTime DateTimeOffset
LocalDateTime LocalDateTime DateTime
Duration Duration ---

neo4j-dotnet-driver's People

Contributors

adam-cowley avatar ali-ince avatar andyheap-neotech avatar bigmontz avatar boggle avatar davidwandar avatar fbiville avatar gjmwoods avatar ingvarkofoed avatar injectives avatar jakewins avatar jsoref avatar lutovich avatar michael-simons avatar mneedham avatar nigelsmall avatar pontusmelke avatar praveenag avatar richardirons-neo4j avatar robsdedude avatar technige avatar teo-tsirpanis avatar thelonelyvulpes avatar zhenlineo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neo4j-dotnet-driver's Issues

Proper DeadlockDetectedException handling

Hi,

what would be a proper way of catching DeadlockDetectedException. I see TransientException. Does TransientException.Code contain actual neo4j error name which I can use? In this case DeadlockDetectedException.

Thanks

PackStreamWriter cannot write DateTime's

When trying to save an object with a DateTime in it, I receive the following error

Neo4j.Driver.V1.ProtocolException : Cannot understand value with type System.DateTime

Query Results Returning Blank

In v1.2 of the driver my resultsets are coming up empty. The code used is similar to the following:

            using (ISession session = client.Session())
            {
                IStatementResult result = session.Run("MATCH (a:Person)-[b:FRIENDS_WITH]->(c:Person) RETURN a,b,c");

                foreach (var evt in result)
                {
                    // Do something with results
                }

I don't even get to enumerate the results in this case. Running the same query directly on the DB is fine.

Also of note - when I use the debugger in VS I can expand the results view but it just shows a bunch of empty entries (I suspect the number of empty rows matches the number of results I'm expecting, but the Summary object doesn't reference the number of edges and nodes matched from the query).

Is there something different I should be doing to query the database in 1.2? The documentation on the Neo4j website doesn't seem to indicate anything has changed although I've noticed in the Wiki that there is now support for streaming data. Glancing at the source code quickly doesn't reveal anything that might be different.

Stream results of Session.Run() instead of preloading them all

When running session.Run("MATCH (n) RETURN n") the driver seems to preload all results into memory before returning any of them. Even without the high memory usage (#85) this would make it impractical for working with many rows. I would expect Run() to return as soon as the first result is available and then load the results from the server as the caller enumerates over the returned IStatementResult, similar to how SqlCommand.ExecuteReader() works. (If there are reasons to preload results in some cases then perhaps there can be a separate methods for streaming and preloading results.)

Driver cannot handle DateTime values

Version used: 1.0.0

Error message:

Cannot understandvalue with type System.DateTime
Parameter name: value
Actual value was System.DateTime.

Easiest way to replicate:

txn.Run("CREATE (person:Person {name: {name}})", new Dictionary<string, object> { { "name", DateTime.Now } });

PowerShell Driver req.

Here is some PowerShell code I made to query NEO4J using the .net Bolt protocol.

#requires -version 2

Function NEO4J-Bolt-Connect
{
<#
.SYNOPSIS
Creates a .NET Bolt Connection to a NEO4J Database for Queries.
Author: Larry Cummings (@genome_8 on neo4j-users.slack.com)
Source: https://github.com/Genome8/NEO4J-PowerShell-Driver
License: MIT License
Required Dependencies: Neo4j.Driver.dll, Sockets.Plugin.Abstractions.dll `
, Sockets.Plugin.dll, .NET 4.5 tested on WIndows 10 & Server 2012 w/
.net 4.6.2 installed but the Driver can be adapted for .net 3.5 with
some modifications. https://github.com/neo4j/neo4j-dotnet-driver
Optional Dependencies:
.DESCRIPTION
Allows Powershell to connect to NEO4j Databases using the BOLT Protocall
via the NEO4J .net driver functions in PowerShell. After providing
the required Dependencies and paramaters This function will return the
authorization token and Driver to Query the NEO4J Database.

.PARAMETER User_ID
    The User Name for your NEO4J Connection.
.PARAMETER User_Password
    The Password in String format for your NEO4J Connection.
.PARAMETER Server_Address
    The URL and Port to your NEO4J Connection.
.EXAMPLE
    # First we need to connect to the DB
    $N4J_Connection = neo4j-Bolt-Connect -User_ID 'neo4j' -User_Password 'A_Secure_L0ng_P@$$w0Rd' -Server_Address 'BOLT://localhost:7687' (Optional -Verbose)
    # Ok, Great I can connect to the NEO4J Database, Now what?
    # Basic Query ---------------------------------------------------------------------
     $result = $N4J_Connection.Run('MATCH (n) RETURN n LIMIT 10')
     Write-Host ($result | ConvertTo-JSON -Depth 20)
    # Query with parameters -----------------------------------------------------------
     $CYPHER_PARAM = new-object 'system.collections.generic.dictionary[[string],[object]]'
     $CYPHER_PARAM.Add('limit', 10)
     $result = $N4J_Connection.Run('MATCH (n) RETURN n LIMIT {limit}', $CYPHER_PARAM )
     Write-Host ($result | ConvertTo-JSON -Depth 20)
    # Advanced Query with parameters --------------------------------------------------
     # 1st., we must define the correct data type to pass to .net driver.
     $listForUnwind = new-object 'System.Collections.Generic.List[[object]]'
     # Next we build our Optimised Query for Bulk Insert.
     $query = 'UNWIND {props} AS
        prop MERGE (user:User {name:prop.account}) WITH user,
        prop MERGE (computer:Computer {name: prop.computer}) WITH user,computer,
        prop MERGE (computer)-[:HasSession {Weight : prop.weight}]-(user)'
     # Now we can add the data to the Prop's.
     $iprops = new-object 'system.collections.generic.dictionary[[string],[object]]'
     $iprops.Add('account', '[email protected]')
     $iprops.Add('computer', '[email protected]')
     $iprops.Add('weight', '1') 
     # Here we are building the List Array.
     $listForUnwind.Add($iprops)
     # Lest add some more data for the example
     $iprops = new-object 'system.collections.generic.dictionary[[string],[object]]'
     $iprops.Add('account', '[email protected]')
     $iprops.Add('computer', '[email protected]')
     $iprops.Add('weight', '1') 
     # And add more data to the List Array
     $listForUnwind.Add($iprops)
     # Finnaly we need to build the Props UNWIND for NEO4J
     $CYPHER_PARAM = new-object 'system.collections.generic.dictionary[[string],[object]]'
     $CYPHER_PARAM.Add('props', $listForUnwind)

     $result = $N4J_Connection.Run($query, $CYPHER_PARAM)
     Write-Host ($result | ConvertTo-JSON -Depth 10)
.NOTES
    ***Special Thanks to: @glennsarti & @cskardon for the help with .net data types for
    the .net Driver intergration when my brain stoped working.***

#>
Param
(
[Parameter(Position = 0, Mandatory = $True)]
[String]
$User_ID,

    [Parameter(Position = 1, Mandatory = $True)]
    [String]
    $User_Password,

    [Parameter(Position = 2, Mandatory = $True)]
    [String]
    $Server_Address
)

Write-Verbose "Building AuthToken for: $User_ID"
$authToken = [Neo4j.Driver.V1.AuthTokens]::Basic($User_ID,$User_Password)

Write-Verbose "Building .net DB Driver."
$dbDriver = [Neo4j.Driver.V1.GraphDatabase]::Driver($Server_Address,$authToken)

Write-Verbose "Getting Auth Token to: $Server_Address"
$session = $dbDriver.Session()
Write-Verbose "Connection returned: $($session.ID)"

return $session
}

If the Drivers are located with the script then un comment else set Dir.

$Driver_Location = split-path -parent $MyInvocation.MyCommand.Definition
#$Driver_Location = 'C:\Users\SOMEUSER\Desktop\Folder'

Write-Verbose "Loading .net drivers from: $Driver_Location"
Add-Type -Path $($Driver_Location + '\Neo4j.Driver.dll')
Add-Type -Path $($Driver_Location + '\Sockets.Plugin.Abstractions.dll')
Add-Type -Path $($Driver_Location + '\Sockets.Plugin.dll')

Lets build the connection

$N4J_Connection = NEO4J-Bolt-Connect -User_ID 'neo4j' -User_Password 'noe4jPASSWORD' -Server_Address 'bolt://localhost:7687' -Verbose

$result = $N4J_Connection.Run('MATCH (n) RETURN n LIMIT 10')
Write-Host ($result.Values | ConvertTo-JSON -Depth 10)

When we are done Make sure to Close the connection so other can use the rescource pool

$N4J_Connection.Close()

Lest take out the Garabage like a Good Child lol.

Write-Host 'fin'

Connection with the server breaks due to IOException: Failed to connect to the server localhost:7687 within connection timeout 5000ms

I found that when our webapi server hosted in iis is recycled then we have this error
We use the 1.3 driver

Neo4j.Driver.V1.ServiceUnavailableException: Connection with the server breaks due to IOException: Failed to connect to the server localhost:7687 within connection timeout 5000ms ---> System.IO.IOException: Failed to connect to the server localhost:7687 within connection timeout 5000ms
   at Neo4j.Driver.Internal.Connector.SocketConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketConnection.cs:line 73
   at Neo4j.Driver.Internal.Connector.DelegatedConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\DelegatedConnection.cs:line 96
   --- End of inner exception stack trace ---
   at Neo4j.Driver.Internal.Connector.PooledConnection.OnError(Exception error) in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\PooledConnection.cs:line 75
   at Neo4j.Driver.Internal.Connector.DelegatedConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\DelegatedConnection.cs:line 98
   at Neo4j.Driver.Internal.ConnectionPool.CreateNewPooledConnection() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\ConnectionPool.cs:line 113
   at Neo4j.Driver.Internal.ConnectionPool.<Acquire>b__21_0() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\ConnectionPool.cs:line 143
   at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func) in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs:line 49
2017-08-06 15:03:47,502 ERROR ITECH_ApiServices [#32] - Neo4j.Driver.V1.ServiceUnavailableException: Connection with the server breaks due to IOException: Failed to connect to the server localhost:7687 within connection timeout 5000ms ---> System.IO.IOException: Failed to connect to the server localhost:7687 within connection timeout 5000ms
   at Neo4j.Driver.Internal.Connector.SocketConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketConnection.cs:line 73
   at Neo4j.Driver.Internal.Connector.DelegatedConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\DelegatedConnection.cs:line 96
   --- End of inner exception stack trace ---
   at Neo4j.Driver.Internal.Connector.PooledConnection.OnError(Exception error) in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\PooledConnection.cs:line 75
   at Neo4j.Driver.Internal.Connector.DelegatedConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\DelegatedConnection.cs:line 98
   at Neo4j.Driver.Internal.ConnectionPool.CreateNewPooledConnection() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\ConnectionPool.cs:line 113
   at Neo4j.Driver.Internal.ConnectionPool.<Acquire>b__21_0() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\ConnectionPool.cs:line 143
   at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func) in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs:line 54
   at Neo4j.Driver.Internal.Session.<>c__DisplayClass14_0.<Run>b__0() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Session.cs:line 62
   at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func) in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs:line 49
2017-08-06 15:03:47,502 ERROR ITECH_ApiServices [#32] - Neo4j.Driver.V1.ServiceUnavailableException: Connection with the server breaks due to IOException: Failed to connect to the server localhost:7687 within connection timeout 5000ms ---> System.IO.IOException: Failed to connect to the server localhost:7687 within connection timeout 5000ms
   at Neo4j.Driver.Internal.Connector.SocketConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketConnection.cs:line 73
   at Neo4j.Driver.Internal.Connector.DelegatedConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\DelegatedConnection.cs:line 96
   --- End of inner exception stack trace ---
   at Neo4j.Driver.Internal.Connector.PooledConnection.OnError(Exception error) in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\PooledConnection.cs:line 75
   at Neo4j.Driver.Internal.Connector.DelegatedConnection.Init() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\DelegatedConnection.cs:line 98
   at Neo4j.Driver.Internal.ConnectionPool.CreateNewPooledConnection() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\ConnectionPool.cs:line 113
   at Neo4j.Driver.Internal.ConnectionPool.<Acquire>b__21_0() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\ConnectionPool.cs:line 143
   at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func) in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs:line 54
   at Neo4j.Driver.Internal.Session.<>c__DisplayClass14_0.<Run>b__0() in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Session.cs:line 62
   at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func) in Z:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs:line 54

Updated from 1.3 to 1.5 - reference dlls missing in output folder?

We have multiple projects and one project has the neo4j nuget package and reference. When referencing this project from other projects the neo4j dll is copied to the outputfolder of the other projects.
In version 1.3 all other referencing dlls that are used by the neo4j are also copied.
In version 1.5 only the neo4j dll is copied.

This creates problems when trying to create our setup files since the dlls are missing in these folders.

I guess this is now intended?

Any scheduled release date ?

Hi,
Thanks for building a native .net driver for neo4j. Its more exciting to see that it is built for version 3.0.
Can we expect, hopefully, to see it released along the production version of neo4j?

Thanks,

Can't run integration unittests

I have spend several hours trying to get the integration unittests to work. I'm running on a clean Windows 10 with Visual Studio 2015 Community and JRE 8. I'm running both VS, cosole and PS as administrator.

I have tracked down the issue to when the PS scripts tries to start the neo4j servies by debugging the unittest. Then I tried running the PS scripts manually and got the same error. Here is the log:

PS C:\Sources\neo4j\original\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\bin\target\neo4j\neo4j-commu
nity-3.0.0-RC1\bin> Invoke-Neo4j start -v
VERBOSE: Neo4j Root is 'C:\Sources\neo4j\original\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\bin\target\neo4j\neo4j-community-3.0.0-RC1'
VERBOSE: Neo4j Server Type is 'Community'
VERBOSE: Neo4j Version is '3.0.0-RC1'
VERBOSE: Neo4j Database Mode is ''
VERBOSE: Start command specified
VERBOSE: Neo4j Windows Service Name is neo4j
VERBOSE: Starting the service. This can take some time...
Invoke-Neo4j : Failed to start service 'Neo4j Graph Database - neo4j (neo4j)'.
At line:1 char:1

  • Invoke-Neo4j start -v
  • - CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    - FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-Neo4j
    

It works if I get it to run as console:

PS C:\Sources\neo4j\original\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\bin\target\neo4j\neo4j-community-3.0.0-RC1\bin> Invoke-Neo4j console -v
VERBOSE: Neo4j Root is 'C:\Sources\neo4j\original\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\bin\target\neo4j\neo4j-community-3.0.0-RC1'
VERBOSE: Neo4j Server Type is 'Community'
VERBOSE: Neo4j Version is '3.0.0-RC1'
VERBOSE: Neo4j Database Mode is ''
VERBOSE: Console command specified
VERBOSE: Java detected at 'C:\Program Files\Java\jre1.8.0_73\bin\java.exe'
VERBOSE: Java version detected as '1.8'
VERBOSE: Starting Neo4j as a console with command line C:\Program Files\Java\jre1.8.0_73\bin\java.exe -cp
"C:\Sources\neo4j\original\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\bin\target\neo4j\neo4j-community-3.0.0-RC1/lib/;C:\Sources\neo4j\original\neo4j-dotnet-driver\Neo4j.D
river\Neo4j.Driver.IntegrationTests\bin\target\neo4j\neo4j-community-3.0.0-RC1/plugins/
" -server -Dorg.neo4j.config.file=conf/neo4j.conf -Dlog4j.configuration=file:conf/log4j.properties
-Dneo4j.ext.udc.source=zip-powershell -Dorg.neo4j.cluster.logdirectory=data/log -Dorg.neo4j.config.file=conf/neo4j.conf -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow -XX:hashCode=5
-XX:+AlwaysPreTouch -XX:+UnlockExperimentalVMOptions -XX:+TrustFinalNonStaticFields -XX:+DisableExplicitGC -Dunsupported.dbms.udc.source=zip -Dfile.encoding=UTF-8
org.neo4j.server.CommunityEntryPoint
2016-03-21 09:06:23.118+0000 INFO Starting...
2016-03-21 09:06:31.680+0000 INFO Started.
2016-03-21 09:06:34.633+0000 INFO Remote interface available at http://localhost:7474/

I have also tried starting the service manually from Windows Services, but got this message:

The Neo4j Graph Database - neo4j service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

I would really like to get them running, so I can contribute to the project :)

Any suggestions?

Persistent javax.net.ssl.SSLException - Connection reset thrown

I use LOAD CSV using SSL URI to reference the file hosted on Azure Storage. It works greath for tiny files but anything larger than ~500MB I regularely get the exception below. I implemented retry mechanism in vain.

2016-08-26 07:17:21.424+0000 ERROR [o.n.b.v.r.i.ErrorReporter] Client triggered an unexpected error [UnknownError]: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset. See debug.log for more details, reference 13601142-61db-498b-a73d-75fd98e27672.
2016-08-26 07:17:21.424+0000 ERROR [o.n.b.v.r.i.ErrorReporter] Client triggered an unexpected error [UnknownError]: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset, reference 13601142-61db-498b-a73d-75fd98e27672. Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset
at sun.security.ssl.SSLSocketImpl.checkEOF(Unknown Source)
at sun.security.ssl.AppInputStream.available(Unknown Source)
at java.io.BufferedInputStream.available(Unknown Source)
at sun.net.www.MeteredStream.available(Unknown Source)
at sun.net.www.http.KeepAliveStream.close(Unknown Source)
at java.io.FilterInputStream.close(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source)
at java.io.PushbackInputStream.close(Unknown Source)
at sun.nio.cs.StreamDecoder.implClose(Unknown Source)
at sun.nio.cs.StreamDecoder.close(Unknown Source)
at java.io.InputStreamReader.close(Unknown Source)
at org.neo4j.csv.reader.Readables$3.close(Readables.java:134)
at org.neo4j.csv.reader.ThreadAhead.close(ThreadAhead.java:66)
at org.neo4j.csv.reader.BufferedCharSeeker.close(BufferedCharSeeker.java:302)
at org.neo4j.cypher.internal.compiler.v3_0.spi.CSVResources$$anonfun$getCsvIterator$1.apply(CSVResources.scala:71)
at org.neo4j.cypher.internal.compiler.v3_0.spi.CSVResources$$anonfun$getCsvIterator$1.apply(CSVResources.scala:70)
at org.neo4j.cypher.internal.compiler.v3_0.TaskCloser$$anonfun$1.apply(TaskCloser.scala:43)
at org.neo4j.cypher.internal.compiler.v3_0.TaskCloser$$anonfun$1.apply(TaskCloser.scala:41)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
at scala.collection.immutable.List.flatMap(List.scala:344)
at org.neo4j.cypher.internal.compiler.v3_0.TaskCloser.close(TaskCloser.scala:40)
at org.neo4j.cypher.internal.compiler.v3_0.executionplan.DefaultExecutionResultBuilderFactory$ExecutionWorkflowBuilder.build(DefaultExecutionResultBuilderFactory.scala:75)
at org.neo4j.cypher.internal.compiler.v3_0.executionplan.InterpretedExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1.apply(ExecutionPlanBuilder.scala:142)
at org.neo4j.cypher.internal.compiler.v3_0.executionplan.InterpretedExecutionPlanBuilder$$anonfun$getExecutionPlanFunction$1.apply(ExecutionPlanBuilder.scala:126)
at org.neo4j.cypher.internal.compiler.v3_0.executionplan.InterpretedExecutionPlanBuilder$$anon$1.run(ExecutionPlanBuilder.scala:101)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor3_0$ExecutionPlanWrapper$$anonfun$run$1.apply(CompatibilityFor3_0.scala:224)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor3_0$ExecutionPlanWrapper$$anonfun$run$1.apply(CompatibilityFor3_0.scala:224)
at org.neo4j.cypher.internal.compatibility.exceptionHandlerFor3_0$.runSafely(CompatibilityFor3_0.scala:139)
at org.neo4j.cypher.internal.compatibility.CompatibilityFor3_0$ExecutionPlanWrapper.run(CompatibilityFor3_0.scala:223)
at org.neo4j.cypher.internal.PreparedPlanExecution.execute(PreparedPlanExecution.scala:27)
at org.neo4j.cypher.internal.ExecutionEngine.execute(ExecutionEngine.scala:111)
at org.neo4j.cypher.internal.javacompat.ExecutionEngine.executeQuery(ExecutionEngine.java:65)
at org.neo4j.bolt.v1.runtime.internal.CypherStatementRunner.run(CypherStatementRunner.java:73)
at org.neo4j.bolt.v1.runtime.internal.StandardStateMachineSPI.run(StandardStateMachineSPI.java:110)
at org.neo4j.bolt.v1.runtime.internal.SessionStateMachine$State$2.runStatement(SessionStateMachine.java:122)
at org.neo4j.bolt.v1.runtime.internal.SessionStateMachine.run(SessionStateMachine.java:653)
at org.neo4j.bolt.v1.runtime.internal.concurrent.SessionWorkerFacade.lambda$run$3(SessionWorkerFacade.java:68)
at org.neo4j.bolt.v1.runtime.internal.concurrent.SessionWorker.execute(SessionWorker.java:116)
at org.neo4j.bolt.v1.runtime.internal.concurrent.SessionWorker.run(SessionWorker.java:77)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLException: java.net.SocketException: Connection reset
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at java.io.PushbackInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at org.neo4j.csv.reader.SectionedCharBuffer.readFrom(SectionedCharBuffer.java:134)
at org.neo4j.csv.reader.SectionedCharBuffer.readFrom(SectionedCharBuffer.java:123)
at org.neo4j.csv.reader.Readables$3.read(Readables.java:126)
at org.neo4j.csv.reader.ThreadAheadReadable.readAhead(ThreadAheadReadable.java:76)
at org.neo4j.csv.reader.ThreadAhead.run(ThreadAhead.java:106)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
... 17 more

Allow props setting use case

Hello,

I was trying to set multiple properties on a node using a "props" parameter (as it is done here http://neo4j.com/docs/developer-manual/current/cypher/syntax/parameters/#cypher-parameters-create-node-with-properties).
I tried with the following anonymous parameter:

var props = new { id = ..., name = ... }
var parameters = new { props }
session.Run("...", parameters)

The Run with "object" parameters does not support this use case since the ToDictionary extension (from Internal/Extensions/CollectionsExtensions.cs) transform only the first level and do not go deeper (in the "props" anonymous object).

I agree it is probably useful only in the setting props use case, but would be could great to be able to do this easily. Or we could have a Props class that manage this use case and a new Run overload?

Thanks
Clรฉment

Four integration tests are failing on 1.0

Not sure why this is started. But if I clone a clean and fresh version of the driver, compile it from VS and run the unittests and integration tests. I have not changed anything on my system. Is using a VM only for Neo4j driver development and nothing else. So really not sure why thing has started to happen. Then 2 tests fails with the following:

Neo4j.Driver.IntegrationTests.ConnectionIT.ShouldEstablishConnectionWhenAuthEnabled [FAIL]
      System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\Source\neo4j\temp\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\bin\target\neo4j\neo4j-community-3.0.0-RC1\data\dbms\auth'.
      Stack Trace:
           at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
           at System.IO.File.InternalDelete(String path, Boolean checkHost)
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\ConnectionIT.cs(108,0): at Neo4j.Driver.IntegrationTests.ConnectionIT.ShouldEstablishConnectionWhenAuthEnabled()

Neo4j.Driver.IntegrationTests.ConnectionIT.ShouldDoHandShake [FAIL]
      Neo4j.Driver.Exceptions.ClientException : Authentication token must contain: 'scheme : basic' (ID:3F430025A6B8848B03FBF94CBF4355A29D7EC42E0AC454665A746D84DBBBA868)
      Stack Trace:
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketConnection.cs(76,0): at Neo4j.Driver.Internal.Connector.SocketConnection.Sync()
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Session.cs(79,0): at Neo4j.Driver.Internal.Session.<>c__DisplayClass7_0.<Run>b__0()
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs(54,0): at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func)
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Session.cs(73,0): at Neo4j.Driver.Internal.Session.Run(String statement, IDictionary`2 statementParameters)
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\ConnectionIT.cs(57,0): at Neo4j.Driver.IntegrationTests.ConnectionIT.ShouldDoHandShake()

Neo4j.Driver.IntegrationTests.ConnectionIT.ShouldBeAbleToRunMultiStatementsInOneTransaction [FAIL]
      Neo4j.Driver.Exceptions.ClientException : Authentication token must contain: 'scheme : basic' (ID:3F430025A6B8848B03FBF94CBF4355A29D7EC42E0AC454665A746D84DBBBA868)
      Stack Trace:
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketConnection.cs(76,0): at Neo4j.Driver.Internal.Connector.SocketConnection.Sync()
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Transaction.cs(119,0): at Neo4j.Driver.Internal.Transaction.<>c__DisplayClass10_0.<Run>b__0()
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs(54,0): at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func)
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Transaction.cs(104,0): at Neo4j.Driver.Internal.Transaction.Run(String statement, IDictionary`2 parameters)
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\ConnectionIT.cs(136,0): at Neo4j.Driver.IntegrationTests.ConnectionIT.ShouldBeAbleToRunMultiStatementsInOneTransaction()

Neo4j.Driver.IntegrationTests.ConnectionIT.BuffersResultsOfOneQuerySoTheyCanBeReadAfterAnotherSubsequentQueryHasBeenParsed [FAIL]
      Neo4j.Driver.Exceptions.ClientException : Authentication token must contain: 'scheme : basic' (ID:3F430025A6B8848B03FBF94CBF4355A29D7EC42E0AC454665A746D84DBBBA868)
      Stack Trace:
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketConnection.cs(76,0): at Neo4j.Driver.Internal.Connector.SocketConnection.Sync()
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Session.cs(79,0): at Neo4j.Driver.Internal.Session.<>c__DisplayClass7_0.<Run>b__0()
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs(54,0): at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func)
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Session.cs(73,0): at Neo4j.Driver.Internal.Session.Run(String statement, IDictionary`2 statementParameters)
        neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver.IntegrationTests\ConnectionIT.cs(155,0): at Neo4j.Driver.IntegrationTests.ConnectionIT.BuffersResultsOfOneQuerySoTheyCanBeReadAfterAnotherSubsequentQueryHasBeenParsed()

If I try to fix the first failing test (System.IO.DirectoryNotFoundException) by ckecking that the file exist before trying to delete it, then all but 1 test is working. Here is the exception:

Neo4j.Driver.IntegrationTests.ConnectionIT.ShouldEstablishConnectionWhenAuthEnabled [FAIL]
      FluentAssertions.Execution.AssertionFailedException : Expected string to start with
      "The credentials you provided were valid", but
      "The client is unauthorized due to authentication failure. (ID:4E78524151A93F700683E0A3681E0A623F19EF1A2DB2D9F8B9532BFF10BB4B50)" differs near "lie" (index 5).

I tried to reintroduce my WindowsProcessBasedNeo4jInstaller just to see if that would fix the issue. But it fails with the same test failings.

WindowsProcessBasedNeo4jInstaller: https://github.com/IngvarKofoed/neo4j-dotnet-driver/blob/making-the-intergration-test-fixture-os-independed/Neo4j.Driver/Neo4j.Driver.IntegrationTests/Internals/WindowsProcessBasedNeo4jInstaller.cs

Help :)

Occasionally failing unit tests

As previously discussed in #52 I see unit tests that are occasionally failing when I check out the 1.1 branch and repeatedly run the unit tests (from Visual Studio 2015).

The tests are failing with a System.NullReferenceException. The exceptions occur at different places but they all originate from the Neo4j.Driver.Internal.Packstream.PackStream.Unpacker class and are related to the _private static BitConverterBase bitConverter variable. Here's the relevant code from that class:

public class Unpacker
{
    private readonly IInputStream _in;
    private static BitConverterBase _bitConverter;

    public Unpacker(IInputStream inputStream, BitConverterBase converter)
    {
        _in = inputStream;
        _bitConverter = converter;
    }
}

This looks a bit weird since the constructor sets a static variable, not an instance variable. Then again this might be by design.

Will neo4j .net driver support .net framework version 3.5?

I try to involve neo4j using Unity but I find the highest .net framework version of Unity is 3.5, which is unable to use this driver. Therefore, I wonder whether there are any ways to solve this problem? I would be very appreciate if you could help me. Thanks!

Username property

We are writing custom APIs using the Kerberos plugin. Neo4j does a great job tagging the person doing the work and can be seen using dbms.listQueries, but sometimes I want to capture that username and pass to other methods in my c# code.

Can the driver team add a method that returns the username. For example:
IAuthToken token = AuthTokens.Kerberos(sBearer);
driver = GraphDatabase.Driver(boltAddress, token);
return driver.getUsername()
AND/OR
ISession session = driver.Session()
return session.getUsername()

In other words, I would like to capture the username out of the Kerberos ticket like Neo4j sees it in listQueries.

listquery

Session how big should be the scope

When looking at the conecpt of a session. how long is it intended to exists?

for example when I import a lot of data, would I create one session covering the whole process ? Or should I create a session for each import step (e.g. each kind of node).

Furthermore is a session meant to be threadsafe?

As comparison I currently use the dotnet client nuget package and there I create one transaction for the whole impor process to have better performance, there for I would assume to get one session for the import process. but as this works currently in a async way the session should be threadsafe or I need to create some kind of producer / consumer scenario

System.ArgumentOutOfRangeException: Expected a struct, but got: A1 Parameter name: markerByte Actual value was 161.

System.ArgumentOutOfRangeException: Expected a struct, but got: A1
Parameter name: markerByte
Actual value was 161.
  at Neo4j.Driver.Internal.Packstream.PackStream+Unpacker.UnpackStructHeader () [0x00075] in <9150069943ec4fab840358b2a188b25d>:0
  at Neo4j.Driver.Internal.Packstream.PackStreamMessageFormatV1+ReaderV1.Read (Neo4j.Driver.Internal.Messaging.IMessageResponseHandler responseHandler) [0x00000] in <9150069943ec4fab840358b2a188b25d>:0
  at Neo4j.Driver.Internal.Connector.SocketClient.ReceiveOne (Neo4j.Driver.Internal.Messaging.IMessageResponseHandler responseHandler) [0x00000] in <9150069943ec4fab840358b2a188b25d>:0

Too many dependencies when using net framework.

Hi, I am using the neo4j driver on a .net 4.6 project and when I use nuget to pull in the neo driver I also pull in a lot of dependencies with the .netstandard library that are unecessary.

I've looked at the nuspec file and I can remove a lot of those dependencies by adding

   <dependencies>
          <group targetFramework="net">
            <dependency id="System.Net.Security" version="4.0.0" />
            <dependency id="System.Net.Sockets" version="4.1.0" />
          </group>

and

    <files>
        <file src="Neo4j.Driver\bin\$configuration$\Neo4j.Driver.dll" target="lib\net" />
        <file src="Neo4j.Driver\bin\$configuration$\Neo4j.Driver.pdb" target="lib\net" />
        <file src="Neo4j.Driver\bin\$configuration$\Neo4j.Driver.xml" target="lib\net" />

So that only needed dependencies are pulled in. Would it be possible to make changes to the nuspec file in the project?

Spencer.

Very high memory usage when loading MATCH results

With #83 fixed session.Run("MATCH (n) RETURN n") ran to completion, but it used 11.4 GB RAM by the end. That seems like far too much considering that the original CSV data was only about 700-800 MB. The database contained just under 10M nodes, each with 3 string properties and 1 int property. (The Neo4j server process used 3.5 GB RAM, by the way, which still seems like a lot.)

What is the idea of how to read values values out of PackStreamStruct?

Consider the following statement:

MATCH (p:Person)-[r:OWNS]->(n) 
WITH p, collect(n) as products
WHERE id(p) = {id} RETURN p, products

Here the products key will point to a List<object> whose elements are Nodes, fair enough.

Now, suppose I also need relationship info and do something like this:

MATCH (p:Person)-[r:OWNS]->(n) 
WITH p, collect({ rel: r, product: n }) as products
WHERE id(p) = {id} RETURN p, products

What I now get is

((Dictionary<string,object>)((List<object>)result[0]["products"])[0]).Values
Count = 2
    [0]: {Neo4j.Driver.Internal.IO.PackStreamStruct}
    [1]: {Neo4j.Driver.Internal.IO.PackStreamStruct}

And here I cannot sensibly access the values of rel and product anymore because the value is represented with an internal object.

If you tell me that this is a fairly stable API I can drill holes into it to extract the values, but maybe you tell me that you will actually make those items public?

Looking forward to any pointers

Integration Tests require access to enterprise database and cluster

I was trying to run tests on my local machine and encountered few issues

  1. Test setup by default is trying to install enterprise database which can be overridden by creating environment variable NeoctrlArgs = 3.2.1
  2. Test setup is trying to install Neo4j cluster which is only enterprise. These tests can be manually skipped by changing [RequireClusterFact] to [RequireClusterFact(Skip = "No cluster")] and [RequireClusterTheory] to [RequireClusterTheory(Skip = "No cluster")]
  3. Another thing which is required is JRE and JAVA_HOME environment variable

After all these changes I get authentication issues and I realized that create user is not working so I changed it to only set initial password (neotctrl-set-initial-password has its own issues but it is not related to this repo) and it worked.

You can find all my changes in this commit

Parse only the parameters needed to run statement

Good morning Sirs,

Sometimes I have a type with many fields. And sometimes, it's much easier to just pass the type to the statement and execute the command.

The main problem is that the driver tries to read and parse all the parameters, even when I'm not using them on the query itself. For example, I want to create and user with Id as string and name as string. But the type itself also has more fields like Date of Birth, that won't be used inside the statement but can throw errors like "cannot understandvalue with type System.DateTime" and so on.

Of course, I can use many strategies to prepare the statements of the parameter. But, is there a way to just try to parse the parameters that actually will be used, ignoring additional parameters that actually won't be used?

Does not support TLS1.2

I can not use GrapheneDB services because they does not support TLS 1.0 for security reasons. They require TLS 1.1 and TLS 1.2. GrapheneDB services (with bolt protocol) can not be used while "Neo4j .NET Driver" supports only TLS 1.0.

Asp dot net core bolt driver can't connect on *nix

When trying to run an app on *nix with dot net core, I get This platform does not support connecting sockets to DNS endpoints via the instance Connect and ConnectAsync methods, due to the potential for a host name to map to multiple IP addresses and sockets becoming invalid for use after a failed connect attempt. Use the static ConnectAsync method, or provide to the instance methods the specific IPAddress desired. This is related to https://github.com/dotnet/corefx/issues/8768 and StackExchange/StackExchange.Redis#463. There is a work around but currently the issue seems to be in the driver.

Unable to retrieve CREATE / RETURN nodes and parse out their values

Technically, when I call IStatementResult results = session.Run(...), the results.Keys array is being populated with the variable names of the nodes in the RETURN clause but I can't find a way to return the Nodes themselves.

Attached is a very simple .NET 1.5.2 console app using the current version of the .NET Client bolt driver.

Neo4jClientTest2.zip

NOTE: The credentials are for one of the Neo4j sandboxes.

dotnet run fails on ubuntu 16 and dotnet-dev-1.0.0-preview2-003131

I have created a simple test application with visual studio 2015
then referenced Neo4j driver version 1.1.0-m02 (using Nuget pre-release)
I copied the test program from another project using Mono and driver version 1.1.0-m1.
I am able to successfully compile and execute the new binary in windows.
On linux I get this error after "dotnet run" command:

genesio@neo01:/opt/neo4jtest/netcore/src/Neo4jTestNetCore$ dotnet run
Project Neo4jTestNetCore (.NETCoreApp,Version=v1.0) will be compiled because the version or bitness of the CLI changed since the last build
Compiling Neo4jTestNetCore for .NETCoreApp,Version=v1.0
/opt/neo4jtest/netcore/src/Neo4jTestNetCore/project.json(12,31): error NU1001: The dependency Neo4j.Driver >= 1.1.0-M02 could not be resolved.

Compilation failed.
    0 Warning(s)
    1 Error(s)

Executing "dotnet restore" does not fix the problem:

genesio@neo01:/opt/neo4jtest/netcore/src/Neo4jTestNetCore$ dotnet restore
log  : Restoring packages for /opt/neo4jtest/netcore/src/Neo4jTestNetCore/project.json...
log  : Lock file has not changed. Skipping lock file write. Path: /opt/neo4jtest/netcore/src/Neo4jTestNetCore/project.lock.json
log  : /opt/neo4jtest/netcore/src/Neo4jTestNetCore/project.json
log  : Restore completed in 683ms.

I had to open manually edit the "project.json" file and change the dependency section from this

"dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0"
    },
    "Neo4j.Driver": "1.1.0-M02"
  },

to this:

"dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0"
    },
    "Neo4j.Driver": "1.1.0-m02"
  },

please note UPPERCASE 1.1.0-M02 in original project.json file

then it works

Exception on Neo4j.Driver.Internal.Connector.ChunkedInputStream.ReadSpecifiedSize- "Expected X got Y"

Fairly persistent issue but sometime it works without problems

Exception - "Error - Expect 471, but got 265" where both # changes depending when I run the query. Using Driver v1 with Neo4j 3.0.1

[My code]
using (var driver =
GraphDatabase.Driver(
"bolt://server",
GetAuthToken()))
{
using (var session = driver.Session())
{
try
{

                    var result = session.Run(query);  <-- Fails here

Query
match (admins:User)-[:SERVICE_ADMIN]->(service:Service)-[:RESOURCES]->(f:File)
WITH service, collect(f.name) as files, collect(admins.accountname) as admins
return service.name, admins, files;

Stacktrace
at Neo4j.Driver.Internal.Connector.ChunkedInputStream.ReadSpecifiedSize(Byte[] buffer) in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\ChunkedInputStream.cs:line 131
at Neo4j.Driver.Internal.Connector.ChunkedInputStream.Ensure(Int32 size) in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\ChunkedInputStream.cs:line 114
at Neo4j.Driver.Internal.Connector.ChunkedInputStream.ReadByte() in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\ChunkedInputStream.cs:line 52
at Neo4j.Driver.Internal.Packstream.PackStream.Unpacker.UnpackStructHeader() in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Packstream\PackStream.cs:line 556
at Neo4j.Driver.Internal.Packstream.PackStreamMessageFormatV1.ReaderV1.Read(IMessageResponseHandler responseHandler) in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Packstream\PackStreamMessageFormatV1.cs:line 54
at Neo4j.Driver.Internal.Connector.SocketClient.Receive(IMessageResponseHandler responseHandler) in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketClient.cs:line 107
at Neo4j.Driver.Internal.Connector.SocketConnection.Sync() in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketConnection.cs:line 68
at Neo4j.Driver.Internal.Session.<>c__DisplayClass8_0.b__0() in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\Session.cs:line 83
at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func) in C:\BuildAgent\work\9ae188c903d07190\Neo4j.Driver\Neo4j.Driver\Internal\LoggerBase.cs:line 54

"The Neo4j Server doesn't support this client."

I'm getting an error when trying to connect: "The Neo4j Server doesn't support this client." Debugging through the Neo4j.Driver code, I see the 'DoHandshake()' call to the TCPSocketClient is returning version value of "1213486160" instead of the expected "1".
I am using

  • Neo4J-CE, version 3.0.0.
  • Neo4j.Server, version 1.0.0
  • Windows 10 Pro, 64-bit

Internals in MessageResponseHandler for testing only is a code smell

The class MessageResponseHandler : https://github.com/neo4j/neo4j-dotnet-driver/blob/1.0/Neo4j.Driver/Neo4j.Driver/Internal/Connector/MessageResponseHandler.cs
Has the following internals:

internal Queue<IResultBuilder> ResultBuilders => new Queue<IResultBuilder>(_resultBuilders);
internal Queue<IRequestMessage> SentMessages => new Queue<IRequestMessage>(_sentMessages); 

This is a code smell that the OOP design is not complete and I think this should be refactored so that there is no need for internals for testing.

If you agree Ill happily create a PR for how to fix this code smell :)

Unittests made with MSTest which is not supported in Xamarin

I suggest using NUnit instead of MSTest for the unittest projects. This would make it possible for developers to open and run tests using Xamarin when developing on non Windows platforms.

If you agree, then I can make a pull request where the projects have been changed to use NUnit and tested in both Visual Studio and Xamarin :)

Excessive Open Connections

We are having some major issues with the .NET Neo driver (v1.1). When running tests from a console app, the connections are managed as expected. However, the same code on IIS and exercised via JMeter is completely different. When the code hits an exception, in our case "Neo4j.Driver.V1.ClientException: Failed to connect to the server [some ip]:7687 within connection timeout 5000ms" the connection is not closed and they keep on rising and rising up in to the 1000's.

I have tried setting MaxIdleSessionPoolSize anywhere between 10 and 100 with no difference.

Here is my code:

string username = ConfigurationManager.AppSettings["NeoUser"]; ;
string password = ConfigurationManager.AppSettings["NeoPass"]; ;
string boltUri = ConfigurationManager.AppSettings["boltUri"];
string PooledConns = ConfigurationManager.AppSettings["PooledCons"];

var config = new Config { };
config.MaxIdleSessionPoolSize = int.Parse(PooledConns);

try
{
	using (IDriver driver = GraphDatabase.Driver(boltUri, AuthTokens.Basic(username, password), config))
	{
		using (var session = driver.Session())
		{

			var setGUID = Guid.NewGuid().ToString();

			IDictionary<string, object> param = new Dictionary<string, object>();
			param.Add("0", "User-" + setGUID);
			param.Add("1", "Display-" + setGUID);
			param.Add("2", "Name=" + setGUID);

			session.Run("CREATE(a: User { id: {0}, displayName: {1}, identity: {2}})", param).Consume();

			return Request.CreateResponse(HttpStatusCode.OK, "User successfully added!");

		}
	}
}
catch (Exception ex)
{
	Logger.Write("---------------------------------------");
	Logger.Write(ex.ToString());

	return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.ToString());
}

}

Big requests do not complete

On my solution if I run:
session.Run("match(n) return n limit 5000").ToList()
It works

if I run:
session.Run("match(n) return n limit 10000").ToList()
It never completes

It works with 1.5.0-alpha01 (result comes very quickly) but not with the upper versions (final 1.5.0 included).

(test with dotnet core 2 in xunit unit test)

Namespaces and internals

The things below are just my opinion, but I hope you will read it and think about it :) Also I apologies for creating this as an issue, but this is the only way on Github.

I think you should think more about which types are internal and which are public. Only make types public if the client of the code needs to know about them. Examples of types that currently are public but maybe should be internal: Node, Path, ByteExtensions, CollectionExtensions, Throw and there is a lot more.

I also think you should think more about the use of namespace. Example: The type Neo4jException is something that most of the clients of the Neo4j driver should care about, so having this type in a sub namespace just creates more work to the user of the Neo4j driver. So I think that Neo4jException should be in the root namespace. This is just one example, there are many more types I think should be moved around.

The namespace Neo4j.Driver.Internal hints that types in here are internal, but most of the types are public. So I think they either should be moved or made internal :) The internal namespace should not pop-up in the intellicense when using the Neo4j driver.

If changes are made in this area, the will be compatible breaking and I think they should be included in 1.0.

I you like, I can come up with a suggestion, as a PR, for how I would organise the types in namespaces and which should be public. Just let me know and Ill happy make it ASAP :)

neo4j driver from powershell fails

using assembly "C:\Program Files\NuGet\Packages\Neo4j.Driver.1.1.0-M01\lib\dotnet\Neo4j.Driver.dll"
using assembly "C:\Program Files\NuGet\Packages\rda.SocketsForPCL.2.0.1-pre\lib\net45\Sockets.Plugin.Abstractions.dll"
using assembly "C:\Program Files\NuGet\Packages\rda.SocketsForPCL.2.0.1-pre\lib\net45\Sockets.Plugin.dll"

using namespace Neo4j.Driver.V1

$driver = [GraphDatabase]::Driver('bolt://192.168.0.104'),[authtokens]::Basic('neo4j','somepass#'))

$driver.Session()

and what I get is

Exception calling "Session" with "0" argument(s): "One or more errors occurred."
At line:1 char:1

  • $driver.Session()
  • - CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    - FullyQualifiedErrorId : AggregateException
    

there are some additional details, if I do this right after call fails i see

PS C:\Windows\system32> $Error[0].Exception.InnerException.InnerExceptions
Method not found: 'System.Threading.Tasks.Task Sockets.Plugin.Abstractions.ITcpSocketClient.ConnectAsync(System.String, Int32, Boolean)'.

PS: neo4j community edition running on ubuntu

"Expected X, but got Y" exception when reading results

Using the latest code on the 1.0 branch I tried returning all nodes, like this:

session.Run("MATCH (n) RETURN n")

Every time I get an exception like this:

Expect 99, but got 44
   at Neo4j.Driver.Internal.Connector.ChunkedInputStream.ReadSpecifiedSize(Byte[] buffer) in C:\G it\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Connector\ChunkedInputStream.cs:line 131
   at Neo4j.Driver.Internal.Connector.ChunkedInputStream.Ensure(Int32 size) in C:\G it\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Connector\ChunkedInputStream.cs:line 113
   at Neo4j.Driver.Internal.Connector.ChunkedInputStream.ReadByte() in C:\G it\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Connector\ChunkedInputStream.cs:line 51
   at Neo4j.Driver.Internal.Packstream.PackStream.Unpacker.UnpackStructHeader() in C:\G it\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Packstream\PackStream.cs:line 556
   at Neo4j.Driver.Internal.Packstream.PackStreamMessageFormatV1.ReaderV1.Read(IMessageResponseHandler responseHandler) in C:\G it\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Packstream\PackStreamMessageFormatV1.cs:line 53
   at Neo4j.Driver.Internal.Connector.SocketClient.Receive(IMessageResponseHandler responseHandler) in C:\G it\neo4j-dotnet-driver\Neo4j.Driver\Neo4j.Driver\Internal\Connector\SocketClient.cs:line 107

(The numbers differ from run to run.)

.Net is not fully supported

I tried to create a VC++ CLR project which still falls under .Net and I got the error "Could not install package 'Neo4j.Driver 1.2.0'. You are trying to install this package into a project that targets 'native,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author." when trying to install the package.

Driver throwing Sockets exception

I have an ASP.NET Core project setup and I'm trying to get connected to my Neo4j server. I have the following references:

"dependencies": {
  "Microsoft.AspNetCore.Mvc": "1.0.0",
  "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
  "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
  "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
  "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
  "Microsoft.Extensions.Configuration.Json": "1.0.0",
  "Microsoft.Extensions.Logging": "1.0.0",
  "Microsoft.Extensions.Logging.Console": "1.0.0",
  "Microsoft.Extensions.Logging.Debug": "1.0.0",
  "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
  "Microsoft.NETCore.App": {
    "version": "1.0.0",
    "type": "platform"
  },
  "Neo4j.Driver": "1.0.0",
  "Newtonsoft.Json": "9.0.1",
  "rda.SocketsForPCL": "1.2.2"
}

I'm building a driver like this inside the WebApiConfig class:

var url = config["ConnectionStrings:Neo4j"];
var driver = GraphDatabase.Driver(url, AuthTokens.Basic(config["Neo4j:Username"], config["Neo4j:Password"]));

Neo4jDriver = driver;

I'm then using the driver like this:

using (var session = WebApiConfig.Neo4jDriver.Session())
{
    session.Run("CREATE (a:Person {name:'Arthur', title:'King'})");
    return session.Run("MATCH (a:Person) WHERE a.name = 'Arthur' RETURN a.name AS name, a.title AS title");
}

However, this WebApiConfig.Neo4jDriver.Session() is throwing an exception:

An exception of type 'System.NotImplementedException' occurred in Neo4j.Driver.dll but was not handled in user code

Additional information: The empty PCL implementation for Sockets was loaded. Ensure you have added the Sockets nuget package to each of your platform projects.

"Win32Exception: The token supplied to the function is invalid" on default configuration

I tried the following code:

    class Program
    {
        static void Main(string[] args)
        {
            // tried both 127.0.0.1 and localhost
            var rawDriver  = GraphDatabase.Driver("bolt://127.0.0.1:7687");
            using (var session = rawDriver.Session())
            {
                var result = session.Run("MATCH (n:Root) RETURN labels(n) AS labels");
                foreach (var row in result)
                {
                    Console.WriteLine(row["labels"].As<string[]>().FirstOrDefault());
                }
            }
     }

Over a Neo4j 3.2.0 Community Edition with default settings as follows:

#***************************************************************
# Server configuration
#***************************************************************

# This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or uncomment it to
# allow files to be loaded from anywhere in filesystem; this introduces possible security problems. See the `LOAD CSV`
# section of the manual for details.
dbms.directories.import=import
dbms.allow_format_migration=true
# Require (or disable the requirement of) auth to access Neo4j
dbms.security.auth_enabled=false

#
# Bolt connector
#
dbms.connector.bolt.type=BOLT
dbms.connector.bolt.enabled=true
dbms.connector.bolt.tls_level=REQUIRED
# To have Bolt accept non-local connections, uncomment this line:
# dbms.connector.bolt.address=0.0.0.0:7687

#
# HTTP Connector
#
dbms.connector.http.type=HTTP
dbms.connector.http.enabled=true
#dbms.connector.http.encryption=NONE
# To have HTTP accept non-local connections, uncomment this line:
#dbms.connector.http.address=0.0.0.0:#{default.http.port}

#
# HTTPS Connector
#
# To enable HTTPS, uncomment these lines:
#dbms.connector.https.type=HTTP
#dbms.connector.https.enabled=true
#dbms.connector.https.encryption=TLS
#dbms.connector.https.address=localhost:#{default.https.port}

# Certificates directory
# dbms.directories.certificates=certificates

#*****************************************************************
# Administration client configuration
#*****************************************************************


# Comma separated list of JAX-RS packages containing JAX-RS resources, one
# package name for each mountpoint. The listed package names will be loaded
# under the mountpoints specified. Uncomment this line to mount the
# org.neo4j.examples.server.unmanaged.HelloWorldResource.java from
# neo4j-examples under /examples/unmanaged, resulting in a final URL of
# http://localhost:${default.http.port}/examples/unmanaged/helloworld/{nodeId}
#dbms.unmanaged_extension_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged

#*****************************************************************
# HTTP logging configuration
#*****************************************************************

# HTTP logging is disabled. HTTP logging can be enabled by setting this
# property to 'true'.
dbms.logs.http.enabled=false

# Logging policy file that governs how HTTP log output is presented and
# archived. Note: changing the rollover and retention policy is sensible, but
# changing the output format is less so, since it is configured to use the
# ubiquitous common log format
#org.neo4j.server.http.log.config=neo4j-http-logging.xml

# Enable this to be able to upgrade a store from an older version.
#dbms.allow_format_migration=true

# The amount of memory to use for mapping the store files, in bytes (or
# kilobytes with the 'k' suffix, megabytes with 'm' and gigabytes with 'g').
# If Neo4j is running on a dedicated server, then it is generally recommended
# to leave about 2-4 gigabytes for the operating system, give the JVM enough
# heap to hold all your transaction state and query context, and then leave the
# rest for the page cache.
# The default page cache memory assumes the machine is dedicated to running
# Neo4j, and is heuristically set to 50% of RAM minus the max Java heap size.
#dbms.memory.pagecache.size=10g

# Enable this to specify a parser other than the default one.
#cypher.default_language_version=2.0

# Keep logical logs, helps debugging but uses more disk space, enabled for
# legacy reasons To limit space needed to store historical logs use values such
# as: "7 days" or "100M size" instead of "true".
#dbms.tx_log.rotation.retention_policy=7 days

# Enable shell server so that remote clients can connect via Neo4j shell.
#dbms.shell.enabled=true
# The network interface IP the shell will listen on (use 0.0.0.0 for all interfaces).
#dbms.shell.host=127.0.0.1
# The port the shell will listen on, default is 1337.
#dbms.shell.port=1337

And my packages.config after Install-Package Neo4j.Driver -Pre is modified as follows (no other nuget package is installed):

<packages>
  <package id="Neo4j.Driver" version="1.3.0" targetFramework="net461" />
  <package id="System.Net.NameResolution" version="4.0.0" targetFramework="net461" />
  <package id="System.Net.Security" version="4.0.0" targetFramework="net461" />
  <package id="System.Net.Sockets" version="4.1.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Algorithms" version="4.2.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Encoding" version="4.0.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Primitives" version="4.0.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.X509Certificates" version="4.1.0" targetFramework="net461" />
</packages>

.NET target framework is 4.6.1.

And I get the following exception during Session.Run():

System.AggregateException occurred
  HResult=0x80131500
  Message=One or more errors occurred.
  Source=Neo4j.Driver
  StackTrace:
   at Neo4j.Driver.Internal.Connector.PooledConnection.OnError(Exception error)
   at Neo4j.Driver.Internal.Connector.DelegatedConnection.Init()
   at Neo4j.Driver.Internal.ConnectionPool.CreateNewPooledConnection()
   at Neo4j.Driver.Internal.ConnectionPool.<Acquire>b__21_0()
   at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func)
   at Neo4j.Driver.Internal.ConnectionPool.Acquire()
   at Neo4j.Driver.Internal.ConnectionPool.Acquire(AccessMode mode)
   at Neo4j.Driver.Internal.Session.<>c__DisplayClass14_0.<Run>b__0()
   at Neo4j.Driver.Internal.LoggerBase.TryExecute[T](Func`1 func)
   at Neo4j.Driver.Internal.Session.Run(String statement, IDictionary`2 statementParameters)
   at TestNeoBolt.Program.Main(String[] args) in C:\Users\Administrator\Documents\Visual Studio 2017\Projects\TestNeoBolt\TestNeoBolt\Program.cs:line 19

Inner Exception 1:
SecurityException: Failed to establish encrypted connection with server bolt://127.0.0.1:7687/.

Inner Exception 2:
AuthenticationException: A call to SSPI failed, see inner exception.

Inner Exception 3:
Win32Exception: The token supplied to the function is invalid

With the following binding redirect:

      <dependentAssembly>
        <assemblyIdentity name="System.Security.Cryptography.X509Certificates" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>

It seems to be related to X509 handshake.

Is there a misconfiguration I'm missing or is it an issue within Neo4j or the driver?

IStatementResult needs to be IDisposable because of IPeekingEnumerator

I think you should reconsider if IStatementResult has to be IDisposable because it makes the client code that uses the Neo4j driver more complex and possible needless harder to use.

I suggest to refactor the IPeekingEnumerator or the use of it so IStatementResult does not have to be IDisposable to make the user code less complex.

If you agree, Ill be happy to make a PR for a suggestion on how to do this :)

handle dependency with correct "rda.SocketsForPCL" nuget package

Current Neo4j.Driver nuget package (1.1.0-M01) has a dependency on rda.SocketsForPCL (>= 1.2.2)
Unfortunately, latest rda.SocketsForPCL version (2.0.2) is not compatible and the driver throws a MissingMethodException at runtime.

Please fix the dependency or upgrade to latest rda.SocketsForPCL version

Socket Errors after Idle

When we are running load tests against Neo using the .NET 1.1.1 driver, there are no issues. We can push thousands of requests through as expected. However, if we let our application sit idle and then try a connect, we get the following below. In this case, I let Neo and the client application sit over night with no activity. Yesterday, before leaving everything was working great, but throwing these errors this morning. After a restart of the client side application, things were again working as intended. It seems as if the driver is leaving something open and expecting the socket to be alive when it is not.

Client Side:
2017-02-14 13:17:08,584 [18] ERROR NeoDrivergFileAppender - Unable to unpack message from server, connection has been terminated.
System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at Neo4j.Driver.Internal.Connector.SocketExtensions.Read(Stream stream, Byte[] bytes)
at Neo4j.Driver.Internal.Connector.ChunkedInputStream.ReadSpecifiedSize(Byte[] buffer)
at Neo4j.Driver.Internal.Connector.ChunkedInputStream.Ensure(Int32 size)
at Neo4j.Driver.Internal.Connector.ChunkedInputStream.ReadByte()
at Neo4j.Driver.Internal.Packstream.PackStream.Unpacker.UnpackStructHeader()
at Neo4j.Driver.Internal.Packstream.PackStreamMessageFormatV1.ReaderV1.Read(IMessageResponseHandler responseHandler)
at Neo4j.Driver.Internal.Connector.SocketClient.ReceiveOne(IMessageResponseHandler responseHandler)

Server Side:
2017-02-14 13:16:59.567+0000 ERROR [o.n.b.t.SocketTransportHandler] Fatal error occurred when handling a client connection: Connection reset by peer Connection reset by peer
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:366)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:118)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:651)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:574)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:488)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:450)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
at java.lang.Thread.run(Thread.java:745)

It takes the Neo driver exactly 18 seconds before the client side error is generated, which is odd. It is exactly 18 seconds every time. Again, it seems as if the driver never closes a connection and is expecting it to be open when it clearly is not. This is simply a theory though.

Driver cannot handle Guid values

Version used: 1.0.0

Error message:

Cannot understandvalue with type System.Guid
Parameter name: value
Actual value was System.Guid.

Easiest way to replicate:

txn.Run("CREATE (person:Person {name: {name}})", new Dictionary<string, object> { { "name", Guid.NewGuid() } });

All public types should be documented

When #38 has been resolved, then all public types should be documented to make the driver more user friendly and help developers not make less mistakes and use lesser time on getting starting with the driver.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.