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
29 changes: 16 additions & 13 deletions neo4j/_async/work/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,12 @@ async def read_transaction(
This does not necessarily imply access control, see the session
configuration option :ref:`default-access-mode-ref`.

This transaction will automatically be committed unless an exception is thrown during query execution or by the user code.
Note, that this function perform retries and that the supplied `transaction_function` might get invoked more than once.

Managed transactions should not generally be explicitly committed
(via ``await tx.commit()``).
This transaction will automatically be committed when the function
returns, unless an exception is thrown during query execution or by
the user code. Note, that this function performs retries and that the
supplied `transaction_function` might get invoked more than once.
Therefore, it needs to be idempotent (i.e., have the same effect,
regardless if called once or many times).

Example::

Expand Down Expand Up @@ -582,8 +583,8 @@ async def get_two_tx(tx):
:param transaction_function: a function that takes a transaction as an
argument and does work with the transaction.
`transaction_function(tx, *args, **kwargs)` where `tx` is a
:class:`.AsyncTransaction`.
:param args: arguments for the `transaction_function`
:class:`.AsyncManagedTransaction`.
:param args: additional arguments for the `transaction_function`
:param kwargs: key word arguments for the `transaction_function`

:raises SessionError: if the session has been closed.
Expand All @@ -607,10 +608,12 @@ async def write_transaction(
This does not necessarily imply access control, see the session
configuration option :ref:`default-access-mode-ref`.

This transaction will automatically be committed unless an exception is thrown during query execution or by the user code.
Note, that this function perform retries and that the supplied `transaction_function` might get invoked more than once.

Managed transactions should not generally be explicitly committed (via tx.commit()).
This transaction will automatically be committed when the function
returns unless, an exception is thrown during query execution or by
the user code. Note, that this function performs retries and that the
supplied `transaction_function` might get invoked more than once.
Therefore, it needs to be idempotent (i.e., have the same effect,
regardless if called once or many times).

Example::

Expand All @@ -626,8 +629,8 @@ async def create_node_tx(tx, name):
:param transaction_function: a function that takes a transaction as an
argument and does work with the transaction.
`transaction_function(tx, *args, **kwargs)` where `tx` is a
:class:`.AsyncTransaction`.
:param args: key word arguments for the `transaction_function`
:class:`.AsyncManagedTransaction`.
:param args: additional arguments for the `transaction_function`
:param kwargs: key word arguments for the `transaction_function`

:raises SessionError: if the session has been closed.
Expand Down
29 changes: 16 additions & 13 deletions neo4j/_sync/work/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,12 @@ def read_transaction(
This does not necessarily imply access control, see the session
configuration option :ref:`default-access-mode-ref`.

This transaction will automatically be committed unless an exception is thrown during query execution or by the user code.
Note, that this function perform retries and that the supplied `transaction_function` might get invoked more than once.

Managed transactions should not generally be explicitly committed
(via ``tx.commit()``).
This transaction will automatically be committed when the function
returns, unless an exception is thrown during query execution or by
the user code. Note, that this function performs retries and that the
supplied `transaction_function` might get invoked more than once.
Therefore, it needs to be idempotent (i.e., have the same effect,
regardless if called once or many times).

Example::

Expand Down Expand Up @@ -582,8 +583,8 @@ def get_two_tx(tx):
:param transaction_function: a function that takes a transaction as an
argument and does work with the transaction.
`transaction_function(tx, *args, **kwargs)` where `tx` is a
:class:`.Transaction`.
:param args: arguments for the `transaction_function`
:class:`.ManagedTransaction`.
:param args: additional arguments for the `transaction_function`
:param kwargs: key word arguments for the `transaction_function`

:raises SessionError: if the session has been closed.
Expand All @@ -607,10 +608,12 @@ def write_transaction(
This does not necessarily imply access control, see the session
configuration option :ref:`default-access-mode-ref`.

This transaction will automatically be committed unless an exception is thrown during query execution or by the user code.
Note, that this function perform retries and that the supplied `transaction_function` might get invoked more than once.

Managed transactions should not generally be explicitly committed (via tx.commit()).
This transaction will automatically be committed when the function
returns unless, an exception is thrown during query execution or by
the user code. Note, that this function performs retries and that the
supplied `transaction_function` might get invoked more than once.
Therefore, it needs to be idempotent (i.e., have the same effect,
regardless if called once or many times).

Example::

Expand All @@ -626,8 +629,8 @@ def create_node_tx(tx, name):
:param transaction_function: a function that takes a transaction as an
argument and does work with the transaction.
`transaction_function(tx, *args, **kwargs)` where `tx` is a
:class:`.Transaction`.
:param args: key word arguments for the `transaction_function`
:class:`.ManagedTransaction`.
:param args: additional arguments for the `transaction_function`
:param kwargs: key word arguments for the `transaction_function`

:raises SessionError: if the session has been closed.
Expand Down