aschn / drf-tracking

Utils to track requests to Django Rest Framework API views
http://drf-tracking.readthedocs.org/
ISC License
366 stars 95 forks source link

Transactions breaking on creation if logging. #23

Closed solvire closed 6 years ago

solvire commented 8 years ago

I am getting an error with logging on write operations.

The DB is PostgreSQL 9.5 and using latest Django Rest Framework.

TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.

Has anyone else run into this issue. I didn't notice anything in the issues.

Jerry49Taylor commented 8 years ago

I get this too.

LoggingMixin.finalize_response needs last line changed to use on_commit

transaction.on_commit(self.request.log.save)

xgenvn commented 7 years ago

I meet this too on MySQL, I have set ATOMIC_REQUESTS to True, is there any way to fix this? I'm not familiar with transaction (so better to give up performance for safety).