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):
30
30
31
31
32
32
class _IsolationSettings (NamedTuple ):
33
- ydb_mode : ydb .BaseQueryTxMode | None
33
+ ydb_mode : ydb .BaseQueryTxMode
34
34
interactive : bool
35
35
36
36
@@ -187,16 +187,19 @@ def wait_ready(self, timeout: int = 10) -> None:
187
187
188
188
self ._session = self ._session_pool .acquire ()
189
189
190
+ @handle_ydb_errors
190
191
def commit (self ) -> None :
191
192
if self ._tx_context and self ._tx_context .tx_id :
192
193
self ._tx_context .commit ()
193
194
self ._tx_context = None
194
195
196
+ @handle_ydb_errors
195
197
def rollback (self ) -> None :
196
198
if self ._tx_context and self ._tx_context .tx_id :
197
199
self ._tx_context .rollback ()
198
200
self ._tx_context = None
199
201
202
+ @handle_ydb_errors
200
203
def close (self ) -> None :
201
204
self .rollback ()
202
205
@@ -311,16 +314,19 @@ async def wait_ready(self, timeout: int = 10) -> None:
311
314
312
315
self ._session = await self ._session_pool .acquire ()
313
316
317
+ @handle_ydb_errors
314
318
async def commit (self ) -> None :
315
319
if self ._tx_context and self ._tx_context .tx_id :
316
320
await self ._tx_context .commit ()
317
321
self ._tx_context = None
318
322
323
+ @handle_ydb_errors
319
324
async def rollback (self ) -> None :
320
325
if self ._tx_context and self ._tx_context .tx_id :
321
326
await self ._tx_context .rollback ()
322
327
self ._tx_context = None
323
328
329
+ @handle_ydb_errors
324
330
async def close (self ) -> None :
325
331
await self .rollback ()
326
332
You can’t perform that action at this time.
0 commit comments