File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class IsolationLevel(str, Enum):
3030
3131
3232class _IsolationSettings (NamedTuple ):
33- ydb_mode : ydb .BaseQueryTxMode | None
33+ ydb_mode : ydb .BaseQueryTxMode
3434 interactive : bool
3535
3636
@@ -187,16 +187,19 @@ def wait_ready(self, timeout: int = 10) -> None:
187187
188188 self ._session = self ._session_pool .acquire ()
189189
190+ @handle_ydb_errors
190191 def commit (self ) -> None :
191192 if self ._tx_context and self ._tx_context .tx_id :
192193 self ._tx_context .commit ()
193194 self ._tx_context = None
194195
196+ @handle_ydb_errors
195197 def rollback (self ) -> None :
196198 if self ._tx_context and self ._tx_context .tx_id :
197199 self ._tx_context .rollback ()
198200 self ._tx_context = None
199201
202+ @handle_ydb_errors
200203 def close (self ) -> None :
201204 self .rollback ()
202205
@@ -311,16 +314,19 @@ async def wait_ready(self, timeout: int = 10) -> None:
311314
312315 self ._session = await self ._session_pool .acquire ()
313316
317+ @handle_ydb_errors
314318 async def commit (self ) -> None :
315319 if self ._tx_context and self ._tx_context .tx_id :
316320 await self ._tx_context .commit ()
317321 self ._tx_context = None
318322
323+ @handle_ydb_errors
319324 async def rollback (self ) -> None :
320325 if self ._tx_context and self ._tx_context .tx_id :
321326 await self ._tx_context .rollback ()
322327 self ._tx_context = None
323328
329+ @handle_ydb_errors
324330 async def close (self ) -> None :
325331 await self .rollback ()
326332
You can’t perform that action at this time.
0 commit comments