Handling database transactions
See original GitHub issueI noticed that graphene-django doesn’t handle database transactions. I believe this is a issue that people should know or be careful about.
The same logic of DRF could be implemented as in the lines below that run in the dispatch method.
Basically on one exception runs:
atomic_requests = settings.get('ATOMIC_REQUESTS', False)
if atomic_requests and connection.in_atomic_block:
transaction.set_rollback(True)
In implementing this in graphene-django as we do not have the exception could run the rollback in the error checking of the execution result as in line 171.
What do you think about this implementation?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Handling Transactions - Documentation - Telerik
A transaction is an ordered sequence of operations that transforms a database from one state of consistency to another state of consistency. The...
Read more >Understanding how database transactions are handled
Understanding how database transactions are handled. Introduction; Handling transactions explicitly with execute(); Warning – conn begin(), commit() and ...
Read more >Handling Transactions - OutSystems 11 Documentation
Handling Transactions. While processing a web request, OutSystems begins a database transaction on its first access to the database.
Read more >Transaction Management - GeeksforGeeks
A transaction usually means that the data in the database has changed. One of the major uses of DBMS is to protect the...
Read more >SQL - Transactions - Tutorialspoint
Properties of Transactions · Atomicity − ensures that all operations within the work unit are completed successfully. · Consistency − ensures that the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, any progress on this issue or PR?
@jkimbo I tried wrapping
mutate
method in Django’stransaction.atomic
decorator and it worked. Why can’t we use it ? Just curious