diff --git a/dotnet-manual/modules/ROOT/pages/client-applications.adoc b/dotnet-manual/modules/ROOT/pages/client-applications.adoc deleted file mode 100644 index 511c274b..00000000 --- a/dotnet-manual/modules/ROOT/pages/client-applications.adoc +++ /dev/null @@ -1,343 +0,0 @@ -[[dotnet-driver-client-applications]] -= Client applications - -include::{common-partial}/client-applications.adoc[tag=abstract] - - -[[dotnet-driver-driver-object]] -== The Driver Object - -include::{common-partial}/client-applications.adoc[tag=object-pt1] - -To construct a driver instance, a xref:client-applications.adoc#dotnet-driver-connection-uris[connection URI] and xref:client-applications.adoc#dotnet-driver-authentication[authentication information] must be supplied. - -include::{common-partial}/client-applications.adoc[tag=object-pt2] - -.The driver lifecycle -==== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=driver-lifecycle] ----- - -// .Import driver lifecycle -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=driver-lifecycle-import] -// ---- -==== - - -[[dotnet-driver-connection-uris]] -== Connection URIs - -include::{common-partial}/client-applications.adoc[tag=uris] - -[NOTE] -==== -https://neo4j.com/aura/[*Neo4j Aura*] is a *_secure hosted service_* backed by full certificates signed by a root certificate authority. - -To connect to *Neo4j Aura*, driver users must *_enable encryption_* and the complete set of certificate checks (the latter of which are enabled by default). - -For more information, see xref:client-applications.adoc#dotnet-driver-configuration-examples[Examples] below. -==== - - -[[dotnet-initial-address-resolution]] -=== Initial address resolution - -include::{common-partial}/client-applications.adoc[tag=initial-address-resolution] - - -[[dotnet-dns-resolution]] -==== DNS resolution - -include::{common-partial}/client-applications.adoc[tag=dns-resolution] - - -[[dotnet-custom-middleware]] -==== Custom middleware - -include::{common-partial}/client-applications.adoc[tag=custom-middleware] - - -[[dotnet-driver-resolver-function]] -==== Resolver function - -include::{common-partial}/client-applications.adoc[tag=resolver-function] - -.Custom Address Resolver -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=config-custom-resolver] ----- -====== - - -[[dotnet-driver-routing-table]] -=== Routing table - -include::{common-partial}/client-applications.adoc[tag=routing-table] - - -=== Load balancing policies - -include::{common-partial}/client-applications.adoc[tag=load-balancing-policies] - - -[[dotnet-driver-configuration-examples]] -=== Examples - -include::{common-partial}/client-applications.adoc[tag=examples-pt1] - -In a clustered environment, the URI address will resolve to one of more of the core members; for standalone installations, this will simply point to that server address. -The `policy` parameter allows for customization of the routing table and is discussed in more detail in xref:client-applications.adoc#_load_balancing_policies[load balancing policies]. - -include::{common-partial}/client-applications.adoc[tag=examples-pt2] - -.Connecting to a service -The tables below illustrate examples of how to connect to a service with routing: - -.Neo4j Aura or Neo4j >= 4.x, secured with full certificate -[cols="<15s,<85a"] -|=== -| Product -| Neo4j Aura, Neo4j >= 4.x - -| Security -| Secured with full certificate - -| Code snippet -| -[source, csharp, indent=0] ----- -GraphDatabase.Driver("neo4j+s://graph.example.com:7687", auth) ----- - -| Comments -| This is the default (and only option) for Neo4j Aura. -|=== - -.Neo4j >= 4.x, unsecured -[cols="<15s,<85a"] -|=== -| Product -| Neo4j >= 4.x - -| Security -| Unsecured - -| Code snippet -| -[source, csharp, indent=0] ----- -GraphDatabase.Driver("neo4j://graph.example.com:7687", auth); ----- - -| Comments -| This is the default for Neo4j >= 4.x series -|=== - -.Neo4j >= 4.x, secured with self-signed certificate -[cols="<15s,<85a"] -|=== -| Product -| Neo4j >= 4.x - -| Security -| Secured with self-signed certificate - -| Code snippet -| -[source, csharp, indent=0] ----- -GraphDatabase.Driver("neo4j+ssc://graph.example.com:7687", auth) ----- -|=== - -[NOTE] -To connect to a service without routing, you can replace `neo4j` with `bolt`. - - -[[dotnet-driver-authentication]] -== Authentication - -include::{common-partial}/client-applications.adoc[tag=authentication] - - -[[dotnet-driver-authentication-basic]] -=== Basic authentication - -include::{common-partial}/client-applications.adoc[tag=authentication-basic] - -.Basic authentication -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=basic-auth] ----- - -// .Import basic authentication -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=basic-auth-import] -// ---- -====== - -include::{common-partial}/client-applications.adoc[tag=authentication-basic-note] - - -[[dotnet-driver-authentication-kerberos]] -=== Kerberos authentication - -include::{common-partial}/client-applications.adoc[tag=authentication-kerberos] - -.Kerberos authentication -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=kerberos-auth] ----- - -// .Import Kerberos authentication -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=kerberos-auth-import] -// ---- -====== - -include::{common-partial}/client-applications.adoc[tag=authentication-kerberos-note] - - -[[dotnet-driver-authentication-custom]] -=== Custom authentication - -include::{common-partial}/client-applications.adoc[tag=authentication-custom] - -.Custom authentication -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=custom-auth] ----- - -// .Import custom authentication -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=custom-auth-import] -// ---- -====== - - -[[dotnet-driver-configuration]] -== Configuration - -include::{common-partial}/client-applications.adoc[tag=configuration-ConnectionAcquisitionTimeout] -+ -.Configure connection pool -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=config-connection-pool] ----- -// .Import connection pool configuration -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=config-connection-pool-import] -// ---- -====== - -include::{common-partial}/client-applications.adoc[tag=configuration-ConnectionTimeout] -+ -.Configure connection timeout -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=config-connection-timeout] ----- - -// .Import connection timeout configuration -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=config-connection-timeout-import] -// ---- -====== - -`CustomResolver`:: - -Specify a custom server address resolver used by the routing driver to resolve the initial address used to create the driver. -See xref:client-applications.adoc#dotnet-driver-resolver-function[Resolver function] for more details. - -include::{common-partial}/client-applications.adoc[tag=configuration-Encryption] -+ -.Unencrypted configuration -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=config-unencrypted] ----- -// .Import unencrypted configuration -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=config-unencrypted-import] -// ---- -====== - -include::{common-partial}/client-applications.adoc[tag=configuration-MaxConnectionLifetime] - -include::{common-partial}/client-applications.adoc[tag=configuration-MaxConnectionPoolSize] -+ -*Default:* 500 connections - - -include::{common-partial}/client-applications.adoc[tag=configuration-MaxTransactionRetryTime] -+ -.Configure maximum retry time -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=config-max-retry-time] ----- -// .Import maximum retry time configuration -// [.include-with-dotnet] -// ====== -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=config-max-retry-time-import] -// ---- -====== - -include::{common-partial}/client-applications.adoc[tag=configuration-TrustStrategy] - -* `TrustManager.CreateChainTrust()` - *[Default]* Accept any certificate that can be verified against the system store. -* `TrustManager.CreateCertTrust(new []{"/path/ca1.crt", "/path/ca2.crt"})` - Accept certificates at specified paths. -* `TrustManager.CreateInsecure()` - Accept any certificate, including self-signed ones. *Not recommended for production environments.* - -+ -.Configure trusted certificates -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=config-trust] ----- -// .Import trusted certificate configuration -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=config-trust-import] -// ---- -====== - -include::{common-partial}/client-applications.adoc[tag=configuration-KeepAlive] - - -[[dotnet-driver-logging]] -== Logging - -include::{common-partial}/client-applications.adoc[tag=logging] - -[source, csharp, indent=0] ----- -#Please note that you will have to provide your own console logger implementing the ILogger interface. -IDriver driver = GraphDatabase.Driver(..., o => o.WithLogger(logger)); ----- diff --git a/dotnet-manual/modules/ROOT/pages/cypher-workflow.adoc b/dotnet-manual/modules/ROOT/pages/cypher-workflow.adoc deleted file mode 100644 index 97ae561d..00000000 --- a/dotnet-manual/modules/ROOT/pages/cypher-workflow.adoc +++ /dev/null @@ -1,133 +0,0 @@ -[[dotnet-driver-cypher-workflow]] -= Cypher workflow - -include::{common-partial}/cypher-workflow.adoc[tag=abstract] - - -== Overview - -include::{common-partial}/cypher-workflow.adoc[tag=overview] - - -[[dotnet-driver-sessions]] -== Sessions - -include::{common-partial}/cypher-workflow.adoc[tag=sessions] - -The session classes are described in xref:session-api.adoc[The session API]. -For more details, please see the xref:get-started.adoc#dotnet-driver-api-docs[API documentation]. - - -[[dotnet-driver-transactions]] -== Transactions - -include::{common-partial}/cypher-workflow.adoc[tag=transactions] - -To learn more about how to use unmanaged transactions, see xref:get-started.adoc#dotnet-driver-api-docs[API documentation]. - - -[[dotnet-driver-queries-results]] -== Queries and results - -include::{common-partial}/cypher-workflow.adoc[tag=queries-results] - - -[[dotnet-driver-causal-chaining]] -== Causal chaining and bookmarks - -include::{common-partial}/cypher-workflow.adoc[tag=causal-chaining] - -.Pass bookmarks -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=pass-bookmarks] ----- - -// .Import bookmarks -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=pass-bookmarks-import] -// ---- -====== - - -[[dotnet-driver-access-modes-transaction]] -== Routing transactions using access modes - -include::{common-partial}/cypher-workflow.adoc[tag=access-modes-transaction] - -.Read-write transaction -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=read-write-transaction] ----- - -// .Import read write transactions -// ---- -// include::{dotnet-examples}/Examples.cs[tags=read-write-transaction-import] -// ---- -====== - - -[[dotnet-driver-databases]] -== Databases and execution context - -include::{common-partial}/cypher-workflow.adoc[tag=databases] - - -[role=enterprise-edition] -[[dotnet-database-selection]] -=== Database selection - -include::{common-partial}/cypher-workflow.adoc[tag=database-selection] - -.Database selection on session creation -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=database-selection] ----- -====== - - -[[dotnet-driver-type-mapping]] -== Type mapping - -include::{common-partial}/cypher-workflow.adoc[tag=type-mapping] - -.Map Neo4j types to .NET types -[options="header", cols="<40m,<60a"] -|=== -| Neo4j Cypher Type | .NET Type -| `NULL` | `null` -| `LIST` | `IList` -| `MAP` | `IDictionary` -| `BOOLEAN` | `bool` -| `INTEGER` | `long` -| `FLOAT` | `double` -| `STRING` | `string` -| `ByteArray` | `byte[]` -| `DATE` | *`LocalDate`* -| `ZONED TIME` | *`OffsetTime`* -| `LOCAL TIME` | *`LocalTime`* -| `ZONED DATETIME`* | *`ZonedDateTime`* -| `LOCAL DATETIME` | *`LocalDateTime`* -| `DURATION` | *`Duration`* -| `POINT` | *`Point`* -| `NODE` | *`INode`* -| `RELATIONSHIP` | *`IRelationship`* -| `PATH` | *`IPath`* -|=== - -+*+ Time zone names adhere to the https://www.iana.org/time-zones[IANA system], rather than the https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones[Windows system]. -Inbound conversion is carried out using http://cldr.unicode.org/development/development-process/design-proposals/extended-windows-olson-zid-mapping[Extended Windows-Olson zid mapping] as defined by Unicode CLDR. - - -[[dotnet-driver-exceptions-errors]] -== Exceptions and error handling - -include::{common-partial}/cypher-workflow.adoc[tag=exceptions-errors] - -The exception property `CanBeRetried` gives insights into whether a further attempt might be successful. diff --git a/dotnet-manual/modules/ROOT/pages/get-started.adoc b/dotnet-manual/modules/ROOT/pages/get-started.adoc deleted file mode 100644 index 2b5a40a2..00000000 --- a/dotnet-manual/modules/ROOT/pages/get-started.adoc +++ /dev/null @@ -1,96 +0,0 @@ -[[dotnet-driver-get-started]] -= Get started -:description: This section gives an overview of the official Neo4j .NET Driver and how to connect to a Neo4j database with a "Hello World" example. - - -[[dotnet-driver-get-started-about]] -== About the official .NET driver - -include::{common-partial}/get-started.adoc[tag=about] - -In the general case, only the xref:client-applications.adoc#dotnet-driver-connection-uris[connection URI] needs to be modified when changes are made to the topology. - -include::{common-partial}/get-started.adoc[tag=about-note] - -[[dotnet-driver-get-started-installation]] -== Driver versions and installation - -include::{common-partial}/get-started.adoc[tag=versions] - -.Acquire the driver -====== -The .NET driver is distributed via the NuGet Gallery. -To find the latest version of the driver, visit https://www.nuget.org/packages/Neo4j.Driver/. - -*Dependencies* - -* .NETStandard (^2.0) -* System.Net.NameResolution (^4.3.0) -* System.Net.Security (^4.3.2) -* System.Net.Sockets (^4.3.0) -* System.Runtime.InteropServices.RuntimeInformation (^4.3.0) -* System.Runtime.Serialization.Primitives (^4.3.0) -* System.Threading.Thread (^4.3.0) -* System.ValueTuple (^4.5.0) - -The .NET Reactive API is under package `Neo4j.Driver.Reactive`. -It is built upon https://github.com/dotnet/reactive[`System.Reactive`]. -There is no extra dependency required use .NET reactive API. - -.Installation via Install-package -======== -To install the latest version of the driver using NuGet in Visual Studio: - -[source, csharp, subs="attributes, specialcharacters", indent=0] ----- -PM> Install-Package Neo4j.Driver ----- - -It is also an option to install a certain version of the driver. - -[source, csharp, subs="attributes, specialcharacters", indent=0] ----- -PM> Install-Package Neo4j.Driver -Version $DOTNET_DRIVER_VERSION ----- - -The .Net driver uses asynchronous methods by default. -If you want to use blocking calls, the `Neo4j.Driver.Simple` NuGet package contains a set of extensions. -This can be found at https://www.nuget.org/packages/Neo4j.Driver.Simple/. -The initial examples make use of these extensions. - -In the following example we are installing driver version {dotnet-driver-version}. - -[source, csharp, subs="attributes, specialcharacters", indent=0] ----- -PM> Install-Package Neo4j.Driver -Version {dotnet-driver-version} ----- -======== - -The release notes for this driver are available https://github.com/neo4j/neo4j-dotnet-driver/releases[here]. - -====== - - -[[dotnet-driver-get-started-hello-world-example]] -== A "Hello World" example - -The example below shows the minimal configuration necessary to interact with *Neo4j* through the .NET driver: - -.Hello World -====== -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=hello-world] ----- - -// [source, csharp, indent=0] -// ---- -// include::{dotnet-examples}/Examples.cs[tags=hello-world-import] -// ---- -====== - - -[[dotnet-driver-api-docs]] -== Driver API docs - -For a comprehensive listing of all driver functionality, please see the link:{neo4j-docs-base-uri}/api/dotnet-driver/{dotnet-driver-version}/[.NET API reference documentation]. diff --git a/dotnet-manual/modules/ROOT/pages/performance.adoc b/dotnet-manual/modules/ROOT/pages/performance.adoc index e6b408bf..eeaab300 100644 --- a/dotnet-manual/modules/ROOT/pages/performance.adoc +++ b/dotnet-manual/modules/ROOT/pages/performance.adoc @@ -68,6 +68,161 @@ for (int i=0; i<1000; i++) { ---- + + +[[lazy-eager-loading]] +== Don't fetch large result sets all at once + +When submitting queries that may result in a lot of records, don't retrieve them all at once. +The Neo4j server can retrieve records in batches and stream them to the driver as they become available. +Lazy-loading a result spreads out network traffic and memory usage (both client- and server-side). + +For convenience, xref:query-simple.adoc[`.execute_query()`] always retrieves all result records at once (it is what the `Eager` in `EagerResult` stands for). +To lazy-load a result, you have to use xref:transactions.adoc#managed-transactions[`.execute_read/write()`] (or other forms of manually-handled xref:transactions.adoc[transactions]) and *not* cast the `Result` object to `list` when processing the result; iterate on it instead. + +.Comparison between eager and lazy loading +==== +[cols="1a,1a", options="header"] +|=== +|Eager loading +|Lazy loading + +| +- The server has to read all 250 records from the storage before it can send even the first one to the driver (i.e. it takes more time for the client to receive the first record). +- Before any record is available to the application, the driver has to receive all 250 records. +- The client has to hold in memory all 250 records. + +| +- The server reads the first record and sends it to the driver. +- The application can process records as soon as the first record is transferred. +- Waiting time and resource consumption for the remaining records is deferred to when the application requests more records. +- The server's fetch time can be used for client-side processing. +- Resource consumption is bounded by the driver's fetch size. + +|=== + +.Time and memory comparison between eager and lazy loading +[source, python] +---- +import neo4j +from time import sleep, time +import tracemalloc + + + +URI = "" +AUTH = ("", "") + +# Returns 250 records, each with properties +# - `output` (an expensive computation, to slow down retrieval) +# - `dummyData` (a list of 10000 ints, about 8 KB). +slow_query = ''' +UNWIND range(1, 250) AS s +RETURN reduce(s=s, x in range(1,1000000) | s + sin(toFloat(x))+cos(toFloat(x))) AS output, + range(1, 10000) AS dummyData +''' +# Delay for each processed record +sleep_time = 0.5 + + +def main(): + with neo4j.GraphDatabase.driver(URI, auth=AUTH) as driver: + driver.verify_connectivity() + + start_time = time() + log('LAZY LOADING (execute_read)') + tracemalloc.start() + lazy_loading(driver) + log(f'Peak memory usage: {tracemalloc.get_traced_memory()[1]} bytes') + tracemalloc.stop() + log('--- %s seconds ---' % (time() - start_time)) + + start_time = time() + log('EAGER LOADING (execute_query)') + tracemalloc.start() + eager_loading(driver) + log(f'Peak memory usage: {tracemalloc.get_traced_memory()[1]} bytes') + tracemalloc.stop() + log('--- %s seconds ---' % (time() - start_time)) + + +def lazy_loading(driver): + + def process_records(tx): + log('Submit query') + result = tx.run(slow_query) + + for record in result: + log(f'Processing record {int(record.get("output"))}') + sleep(sleep_time) # proxy for some expensive operation + + with driver.session(database='neo4j') as session: + processed_result = session.execute_read(process_records) + + +def eager_loading(driver): + log('Submit query') + records, _, _ = driver.execute_query(slow_query, database_='neo4j') + + for record in records: + log(f'Processing record {int(record.get("output"))}') + sleep(sleep_time) # proxy for some expensive operation + + +def log(msg): + print(f'[{round(time(), 2)}] {msg}') + + +if __name__ == '__main__': + main() +---- + +.Output +[source, output, role=nocollapse] +---- +[1718014256.98] LAZY LOADING (execute_read) +[1718014256.98] Submit query +[1718014256.21] Processing record 0 // <1> +[1718014256.71] Processing record 1 +[1718014257.21] Processing record 2 +... +[1718014395.42] Processing record 249 +[1718014395.92] Peak memory usage: 786254 bytes +[1719984711.39] --- 135.9284942150116 seconds --- + +[1718014395.92] EAGER LOADING (execute_query) +[1718014395.92] Submit query +[1718014419.82] Processing record 0 // <2> +[1718014420.33] Processing record 1 +[1718014420.83] Processing record 2 +... +[1718014544.52] Processing record 249 +[1718014545.02] Peak memory usage: 89587150 bytes // <3> +[1719984861.09] --- 149.70468592643738 seconds --- // <4> +---- + +<1> With lazy loading, the first record is quickly available. +<2> With eager loading, the first record is available ~25 seconds after the query has been submitted (i.e. after the server has retrieved all 250 records). +<3> Memory usage is larger with eager loading than with lazy loading, because the application materializes a list of 250 records. +<4> The total running time is lower with lazy loading, because while the client processes records the server can fetch the next ones. +With lazy loading, the client could also stop requesting records after some condition is met (by calling `.consume()` on the `Result`), saving time and resources. + +==== + +[TIP] +==== +The driver's link:https://neo4j.com/docs/api/python-driver/current/api.html#fetch-size-ref[fetch size] affects the behavior of lazy loading. +It instructs the server to stream an amount of records equal to the fetch size, and then wait until the client has caught up before retrieving and sending more. + +The fetch size allows to bound memory consumption on the client side. +It doesn't always bound memory consumption on the server side though: that depends on the query. +For example, a query with link:https://neo4j.com/docs/cypher-manual/current/clauses/order-by/[`ORDER BY`] requires the whole result set to be loaded into memory for sorting, before records can be streamed to the client. + +The lower the fetch size, the more messages client and server have to exchange. +Especially if the server's latency is high, a low fetch size may deteriorate performance. +==== + + [[read-mode]] == Route read queries to cluster readers diff --git a/dotnet-manual/modules/ROOT/pages/session-api.adoc b/dotnet-manual/modules/ROOT/pages/session-api.adoc deleted file mode 100644 index 351bd46c..00000000 --- a/dotnet-manual/modules/ROOT/pages/session-api.adoc +++ /dev/null @@ -1,237 +0,0 @@ -[[dotnet-driver-session-api]] -= The session API - -include::{common-partial}/session-api.adoc[tag=abstract] - - -[[dotnet-driver-simple-sessions]] -== Simple sessions - -include::{common-partial}/session-api.adoc[tag=simple-sessions] - - -[[dotnet-driver-simple-lifecycle]] -=== Lifecycle - -include::{common-partial}/session-api.adoc[tag=simple-lifecycle] - -[source, csharp , indent=0] ----- -using (var session = driver.Session(...)) { - // transactions go here - } ----- - -*_Sessions can be configured in a number of different ways_*. -This is carried out by supplying configuration inside the session constructor. -See xref:session-api.adoc#dotnet-driver-session-configuration[Session configuration] for more details. - - -[[dotnet-driver-simple-transaction-fn]] -=== Transaction functions - -include::{common-partial}/session-api.adoc[tag=simple-transaction-fn] - -[CAUTION] -The methods `ExecuteRead` and `ExecuteWrite` have replaced `ReadTransaction` and `WriteTransaction`, which are deprecated in version 5.x and will be removed in version 6.0. - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=transaction-function] ----- - - -[[dotnet-driver-simple-autocommit-transactions]] -=== Auto-commit transactions (or implicit transactions) - -include::{common-partial}/session-api.adoc[tag=simple-autocommit-transactions] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=autocommit-transaction] ----- - - -[[dotnet-driver-simple-result-consume]] -=== Consuming results - -include::{common-partial}/session-api.adoc[tag=simple-result-consume] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=result-consume] ----- - - -[[dotnet-driver-simple-result-retain]] -=== Retaining results - -include::{common-partial}/session-api.adoc[tag=simple-result-retain] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=result-retain] ----- - - -[[dotnet-driver-async-sessions]] -== Asynchronous sessions - -include::{common-partial}/session-api.adoc[tag=async-sessions] - - -[[dotnet-driver-async-lifecycle]] -=== Lifecycle - -include::{common-partial}/session-api.adoc[tag=async-lifecycle] - -See xref:session-api.adoc#dotnet-driver-session-configuration[Session configuration] for more details. - - -[[dotnet-driver-async-transaction-fn]] -=== Transaction functions - -include::{common-partial}/session-api.adoc[tag=async-transaction-fn] - -[CAUTION] -The methods `ExecuteReadAsync` and `ExecuteWriteAsync` have replaced `ReadTransactionAsync` and `WriteTransactionAsync`, which are deprecated in version 5.x and will be removed in version 6.0. - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/ExamplesAsync.cs[tags=async-transaction-function] ----- - - -[[dotnet-driver-async-autocommit-transactions]] -=== Auto-commit transactions (or implicit transactions) - -include::{common-partial}/session-api.adoc[tag=async-autocommit-transactions] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/ExamplesAsync.cs[tags=async-autocommit-transaction] ----- - -=== Combining transactions - -include::{common-partial}/session-api.adoc[tag=async-multiple-tx] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/ExamplesAsync.cs[tags=async-multiple-tx] ----- - -[[dotnet-driver-async-result-consume]] -=== Consuming results - -include::{common-partial}/session-api.adoc[tag=async-result-consume] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/ExamplesAsync.cs[tags=async-result-consume] ----- - - -[[dotnet-driver-rx-sessions]] -== Reactive sessions - -include::{common-partial}/session-api.adoc[tag=rx-sessions] - -[NOTE] --- -Reactive sessions will typically be used in a client application that is already oriented towards the reactive style; it is expected that a reactive dependency or framework is in place. - -Refer to xref:get-started.adoc[Get started] for more information on recommended dependencies. --- - - -[[dotnet-driver-rx-lifecycle]] -=== Lifecycle - -include::{common-partial}/session-api.adoc[tag=rx-lifecycle] - - -[[dotnet-driver-rx-transaction-fn]] -=== Transaction functions - -include::{common-partial}/session-api.adoc[tag=rx-transaction-fn] - -[CAUTION] -The methods `ExecuteRead` and `ExecuteWrite` have replaced `ReadTransaction` and `WriteTransaction`, which are deprecated in version 5.x and will be removed in version 6.0. - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/ExamplesRx.cs[tags=rx-transaction-function] ----- - -Sessions can be configured in a number of different ways. -This is carried out by supplying configuration inside the session constructor. -See xref:session-api.adoc#dotnet-driver-session-configuration[Session configuration] for more details. - - -[[dotnet-driver-rx-autocommit-transactions]] -=== Auto-commit transactions (or implicit transactions) - -include::{common-partial}/session-api.adoc[tag=rx-autocommit-transactions] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/ExamplesRx.cs[tags=rx-autocommit-transaction] ----- - - -[[dotnet-driver-rx-result-consume]] -=== Consuming results - -include::{common-partial}/session-api.adoc[tag=rx-result-consume] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/ExamplesRx.cs[tags=rx-result-consume] ----- - - -[[dotnet-driver-rx-cancellation]] -=== Cancellation - -include::{common-partial}/session-api.adoc[tag=rx-cancellation] - - -[[dotnet-driver-session-configuration]] -== Session configuration - -include::{common-partial}/session-api.adoc[tag=Bookmarks] - -include::{common-partial}/session-api.adoc[tag=DefaultAccessMode] - -include::{common-partial}/session-api.adoc[tag=Database] - -See more about xref:cypher-workflow.adoc#dotnet-database-selection[Database selection]. - -`Fetch Size`:: -The number of records to fetch in each batch from the server. -Neo4j 4.0 introduces the ability to pull records in batches, allowing the client application to take control of data population and apply back pressure to the server. -This `FetchSize` applies to xref:session-api.adoc#dotnet-driver-simple-sessions[simple sessions] and xref:session-api.adoc#dotnet-driver-async-sessions[async-sessions] whereas reactive sessions can be controlled directly using the request method of the subscription. -+ -*Default:* 1000 records - -include::{common-partial}/session-api.adoc[tag=ImpersonatedUser] - - -[[dotnet-driver-transaction-configuration]] - -include::{common-partial}/session-api.adoc[tag=TransactionConfiguration] - -include::{common-partial}/session-api.adoc[tag=TransactionTimeout] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=transaction-timeout-config] ----- - -include::{common-partial}/session-api.adoc[tag=TransactionMetadata] - -[source, csharp, indent=0] ----- -include::{dotnet-examples}/Examples.cs[tags=transaction-metadata-config] ----- diff --git a/dotnet-manual/modules/ROOT/pages/terminology.adoc b/dotnet-manual/modules/ROOT/pages/terminology.adoc deleted file mode 100644 index add29098..00000000 --- a/dotnet-manual/modules/ROOT/pages/terminology.adoc +++ /dev/null @@ -1,5 +0,0 @@ -[appendix] -[[dotnet-driver-terminology]] -= Driver terminology - -include::{common-partial}/terminology.adoc[tag=terminology]