Table of Contents

Class Config

Namespace
Neo4j.Driver
Assembly
Neo4j.Driver.dll

Use this class to configure the IDriver.

public class Config
Inheritance
Config
Inherited Members
Extension Methods

Remarks

Fields

Infinite

This const defines the value of infinite in terms of configuration properties.

InfiniteInterval

This const defines the value of infinite interval in terms of configuration properties.

Properties

ClientCertificateProvider

A certificate provider that will be used to provide the client certificate when a new connection is established.

ConnectionAcquisitionTimeout

The maximum waiting time to either acquire an idle connection from the pool when connection pool is full or create a new connection when pool is not full.

Note that if there is a client certificate provider set, the time taken to fetch the certificate will be included in the connection acquisition timeout, so if fetching the certificate is particularly slow, it might be necessary to increase the timeout.
ConnectionIdleTimeout

The idle timeout on pooled connections. A connection that has been idled in connection pool for longer than the given timeout is stale and will be closed once it is seen. Use InfiniteInterval to disable idle time checking.

ConnectionLivenessThreshold

Pooled connections that have been idle in the pool for longer than this timeout will be tested before they are used again, to ensure they are still live. If this option is set too low, an additional network call will be incurred when acquiring a connection, which causes a performance hit.

If this is set high, you may receive sessions that are backed by no longer live connections, which will lead to exceptions in your application. Assuming the database is running, these exceptions will go away if you retry acquiring sessions.

Hence, this parameter tunes a balance between the likelihood of your application seeing connection problems, and performance.

You normally should not need to tune this parameter. No connection liveness check is done by default. Value 0 means connections will always be tested for validity. Values less than 0 are not allowed.
ConnectionTimeout

The connection timeout when establishing a connection with a server.

DefaultReadBufferSize

The default read buffer size which the driver allocates for its internal buffers.

DefaultWriteBufferSize

The default write buffer size which the driver allocates for its internal buffers.

EncryptionLevel

The use of encryption for all the connections created by the IDriver.

FetchSize

The default fetch size. Since Bolt v4 (Neo4j 4.0+), the query running result (records) are pulled from server in batches. This fetch size defines how many records to pull in each batch. Use Infinite to disable batching and always pull all records in one batch instead.

Ipv6Enabled

The connections to support ipv6 addresses.

Logger

The ILogger instance to be used to receive all logs produced by this driver.

MaxConnectionLifetime

The maximum connection lifetime on pooled connections. A connection that has been created for longer than the given time will be closed once it is seen. Use InfiniteInterval to disable connection lifetime checking.

MaxConnectionPoolSize

The max connection pool size.

MaxIdleConnectionPoolSize

The max idle connection pool size. If the value of this is not internal set, then it will default to be the same as MaxConnectionPoolSize

MaxReadBufferSize

The size when internal read buffers reach, will be released for garbage collection. If reading large records (nodes, relationships or paths) and experiencing too much garbage collection consider increasing this size to a reasonable amount depending on your data.

MaxTransactionRetryTime

The maximum transaction retry timeout.

MaxWriteBufferSize

The size when internal write buffers reach, will be released for garbage collection. If writing large values and experiencing too much garbage collection consider increasing this size to a reasonable amount depending on your data.

MessageReaderConfig

The configuration for the driver's underlying message reading from the network.

NotificationsConfig

The configuration for setting which notifications the server should send to the client.
This configuration is used for all queries executed by the driver unless otherwise overriden by SessionConfigBuilder for the scope of a single session.

Resolver

Gets or internal sets a custom server address resolver used by the routing driver to resolve the initial address used to create the driver. Such resolution happens: 1) during the very first rediscovery when driver is created. 2) when all the known routers from the current routing table have failed and driver needs to fallback to the initial address.

SocketKeepAlive

The socket keep alive option.

TelemetryDisabled

The configuration for whether the driver attempts to send telemetry data.
The telemetry collected covers high level usage of the driver and does not include any queries or parameters.
Current collected metrics:

  • Which method was used to start a transaction.
Telemetry metrics are sent via Bolt to the uri provided when creating the driver instance or servers that make up the cluster members and Neo4j makes no attempt to collect these usage metrics from outside of AuraDB (Neo4j's cloud offering).
Users can configure Neo4j server's collection collection behavior of client drivers telemetry data and log the telemetry data for diagnostics purposes.
By default the driver allows the collection of this telemetry.
TlsNegotiator

The negotiator to use when establishing a TLS connection. If this is null, the driver will use the default negotiator.|

TlsVersion

The TLS version to use when establishing a connection.

TrustManager

Specifies which TrustManager implementation should be used while establishing trust via TLS.

UserAgent

Used to get and set the User Agent string. If not used the default will be "neo4j-dotnet/x.y" where x is the major version and y is the minor version.