Skip to content

Commit 1963ba1

Browse files
committed
Fix for #30
1 parent fcbef35 commit 1963ba1

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

Diff for: CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [1.10.3] - 2024-05-03
8+
9+
### Fixed
10+
11+
- #30 - It is not possible to start a transaction without specifying an isolation level
12+
The fix allows use of empty tpb in `TransactionManager.begin()`
13+
714
## [1.10.2] - 2024-05-03
815

916
### Fixed

Diff for: docs/changelog.txt

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Changelog
33
#########
44

5+
6+
Version 1.10.3
7+
==============
8+
9+
* Fix: #30 - It is not possible to start a transaction without specifying an isolation level
10+
The fix allows use of empty tpb in `.TransactionManager.begin()`
11+
512
Version 1.10.2
613
==============
714

Diff for: src/firebird/driver/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@
6161
Server, Statement)
6262

6363
#: Current driver version, SEMVER string.
64-
__VERSION__ = '1.10.2'
64+
__VERSION__ = '1.10.3'

Diff for: src/firebird/driver/core.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,14 @@ def temp_database(*args, **kwargs) -> Connection:
299299
class TPB: # pylint: disable=R0902
300300
"""Transaction Parameter Buffer.
301301
"""
302-
def __init__(self, *, access_mode: TraAccessMode = TraAccessMode.WRITE,
303-
isolation: Isolation = Isolation.SNAPSHOT,
304-
lock_timeout: int = -1, no_auto_undo: bool = False,
305-
auto_commit: bool = False, ignore_limbo: bool = False,
306-
at_snapshot_number: int=None, encoding: str='ascii'):
302+
def __init__(self, *, access_mode: TraAccessMode=TraAccessMode.WRITE,
303+
isolation: Isolation=Isolation.SNAPSHOT,
304+
lock_timeout: int=-1,
305+
no_auto_undo: bool=False,
306+
auto_commit: bool=False,
307+
ignore_limbo: bool=False,
308+
at_snapshot_number: int=None,
309+
encoding: str='ascii'):
307310
self.encoding: str = encoding
308311
self.access_mode: TraAccessMode = access_mode
309312
self.isolation: Isolation = isolation
@@ -2441,7 +2444,8 @@ def begin(self, tpb: bytes=None) -> None: # pylint: disable=W0621
24412444
"""
24422445
assert not self.__closed
24432446
self._finish() # Make sure that previous transaction (if any) is ended
2444-
self._tra = self._connection()._att.start_transaction(tpb or self.default_tpb)
2447+
self._tra = self._connection()._att.start_transaction(self.default_tpb if tpb is None
2448+
else tpb)
24452449
def commit(self, *, retaining: bool=False) -> None:
24462450
"""Commits the transaction managed by this instance.
24472451

0 commit comments

Comments
 (0)