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
Any reason we can't have nested transaction blocks? Currently this is a SystemError:
from config, db
config.DATABASE_URL = 'bolt://neo4j:password@localhost:7687'
with db.transaction:
with db.transaction:
pass
Output:
Traceback (most recent call last):
File "test.py", line 7, in <module>
with db.transaction:
File "{..}/neomodel/util.py", line 127, in __enter__
self.db.begin()
File "{..}/neomodel/util.py", line 28, in wrapper
return func(self, *args, **kwargs)
File "{..}/neomodel/util.py", line 73, in begin
raise SystemError("Transaction in progress")
SystemError: Transaction in progress
The text was updated successfully, but these errors were encountered:
I might understand this solution to nested transactions, like having a read_transaction might conflict with an inner write one (here an exception must be thrown), but for an outter write_transactions (or a general transaction) with an inner read_transaction (or a general one) wouldn't the inner transaction reuse the outter one? Having write/read transactions is only relevant when having a neo4j cluster (as in my case).
Giving a peek at Neo4j High Performance, nested transactions are "part of the scope of the highest-level transaction", thus if an inner transaction fails, the outter one fails too. This behavior could be simulated having one transaction at all, the outter one.
@aanastasiou The solution of this issue brings code reusability, which is highly important for big projects. I find Neomodel a great solution among OGMs, but there has not been too much activity in this repo, even though Neo4j 4.0 brought new exciting features. If you need help with this or other issues I'll be happy to help in my free time.
Any reason we can't have nested transaction blocks? Currently this is a
SystemError
:Output:
The text was updated successfully, but these errors were encountered: