Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ Closing a driver will immediately shut down all connections in the pool.
The transformer function must **not** return the
:class:`neo4j.Result` itself.


.. warning::

N.B. the driver might retry the underlying transaction so the
transformer might get invoked more than once (with different
:class:`neo4j.Result` objects).
Therefore, it needs to be idempotent (i.e., have the same
effect, regardless if called once or many times).

Example transformer that checks that exactly one record is in the
result stream, then returns the record and the result summary::

Expand Down
8 changes: 8 additions & 0 deletions docs/source/async_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ Closing a driver will immediately shut down all connections in the pool.
The transformer function must **not** return the
:class:`neo4j.AsyncResult` itself.

.. warning::

N.B. the driver might retry the underlying transaction so the
transformer might get invoked more than once (with different
:class:`neo4j.AsyncResult` objects).
Therefore, it needs to be idempotent (i.e., have the same
effect, regardless if called once or many times).

Example transformer that checks that exactly one record is in the
result stream, then returns the record and the result summary::

Expand Down
8 changes: 8 additions & 0 deletions src/neo4j/_async/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,14 @@ async def example(driver: neo4j.AsyncDriver) -> int:
The transformer function must **not** return the
:class:`neo4j.AsyncResult` itself.

.. warning::

N.B. the driver might retry the underlying transaction so the
transformer might get invoked more than once (with different
:class:`neo4j.AsyncResult` objects).
Therefore, it needs to be idempotent (i.e., have the same
effect, regardless if called once or many times).

Example transformer that checks that exactly one record is in the
result stream, then returns the record and the result summary::

Expand Down
8 changes: 8 additions & 0 deletions src/neo4j/_sync/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,14 @@ def example(driver: neo4j.Driver) -> int:
The transformer function must **not** return the
:class:`neo4j.Result` itself.

.. warning::

N.B. the driver might retry the underlying transaction so the
transformer might get invoked more than once (with different
:class:`neo4j.Result` objects).
Therefore, it needs to be idempotent (i.e., have the same
effect, regardless if called once or many times).

Example transformer that checks that exactly one record is in the
result stream, then returns the record and the result summary::

Expand Down