You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4.0 remove success flag in transaction usage pattern (#355)
* Updated API docs, removed Transaction.success attribute
* Changed transaction.success to be an internal flag
Using the tx.commit() and tx.rollback() where the success flag was being
used before.
* Changed transaction.close method to be an internal method.
The user should only use tx.commit() or tx.rollback() for explicit
transactions.
* Fixed integration test and added comment about usage.
The integration test uses old pattern for doing a roll back for now.
Added pydocs for the
session.read_transaction
and
session.write_transaction
how the unit of work patterns should be used with these methods.
.. [1] While a COMMIT will be attempted in this scenario, it will likely fail if the exception originated from Cypher execution within that transaction.
101
-
102
-
.. automethod:: close
103
-
104
84
.. automethod:: closed
105
85
106
86
.. automethod:: commit
107
87
108
88
.. automethod:: rollback
109
89
110
-
Closing an explicit transaction can either happen automatically at the end of a ``with`` block, using the :attr:`.Transaction.success` attribute to determine success,
90
+
Closing an explicit transaction can either happen automatically at the end of a ``with`` block,
111
91
or can be explicitly controlled through the :meth:`.Transaction.commit` and :meth:`.Transaction.rollback` methods.
112
92
Explicit transactions are most useful for applications that need to distribute Cypher execution across multiple functions for the same transaction.
0 commit comments