File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 3
3
4
4
from django .core .exceptions import ImproperlyConfigured
5
5
from django .db .backends .base .base import BaseDatabaseWrapper
6
+ from django .db .backends .utils import debug_transaction
6
7
from django .utils .asyncio import async_unsafe
7
8
from django .utils .functional import cached_property
8
9
from pymongo .collection import Collection
@@ -194,21 +195,24 @@ def _commit(self):
194
195
if not self .features .supports_transactions :
195
196
return
196
197
if self .session :
197
- self .session .commit_transaction ()
198
+ with debug_transaction (self , "session.commit_transaction()" ):
199
+ self .session .commit_transaction ()
198
200
self .session .end_session ()
199
201
self .session = None
200
202
201
203
def _rollback (self ):
202
204
if not self .features .supports_transactions :
203
205
return
204
206
if self .session :
205
- self .session .abort_transaction ()
207
+ with debug_transaction (self , "session.abort_transaction()" ):
208
+ self .session .abort_transaction ()
206
209
self .session = None
207
210
208
211
def _start_session (self ):
209
212
if self .session is None :
210
213
self .session = self .connection .start_session ()
211
- self .session .start_transaction ()
214
+ with debug_transaction (self , "session.start_transaction()" ):
215
+ self .session .start_transaction ()
212
216
213
217
def _start_transaction_under_autocommit (self ):
214
218
if not self .features .supports_transactions :
You can’t perform that action at this time.
0 commit comments