Skip to content
Snippets Groups Projects
Commit fefe33eb authored by Simon Künzel's avatar Simon Künzel
Browse files

Remove outdated method from database

parent 90401b7c
No related branches found
No related tags found
1 merge request!6Feedback page & Misc
......@@ -715,31 +715,6 @@ class DbConnectionPool:
pass
self._on_connection_released(True, connection)
@contextmanager
def start_read_transaction(self) -> ReadTransaction:
"""
Starts a read-only transaction.
May raise :class:`NoAvailableConnectionError`
"""
transaction = None
try:
if self._factory.supports_per_transaction_writeable_flag():
connection = self._cache.get_connection()
else:
connection = self._read_cache.get_connection()
transaction = ReadTransaction(lambda: self._on_connection_released(False, connection), connection)
yield transaction
if not transaction.is_closed():
print("Warning: Rolling open transaction back after execution but there was no exception (Always "
"close the transaction explicitly)")
transaction.close()
except Exception:
if transaction is not None and not transaction.is_closed():
_COUNTERS_TRANSACTION_ABORTED_BY_USER["read"].trigger()
transaction.on_error_close_transaction()
raise
def execute_read_statement_in_transaction(self,
statement: PreparedStatement or str,
*values: DbValueType) -> DbResultSet:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment