At this moment Exasol supports only one transaction isolation level: SERIALIZABLE.
This is good for data consistency, but it increases probability of transactions conflicts. You may read more about it here:
The most common locking problem is related to metadata selects from system views (tables, column, object sizes, etc.). JDBC and ODBC drivers provide special non-blocking calls for common metadata requests: getTables(), getColumns(). But there are no such calls for WebSocket drivers.
The only way to access metadata in non-blocking manner with PyEXASOL is an internal feature called "Snapshot Transactions". Details are limited, but we managed to find out a few things:
- ExaPlus client uses snapshot transactions to access system views in separate META-session;
- Snapshot transactions are read-only. Connection will crash instantly on any write attempt;
- In this mode Exasol returns last snapshot of accessed objects instead of locking in
WAIT FOR COMMIT
state;
If you want to read metadata without locks, and if strict transaction integrity is not an issue, please do the following:
- Open new connection with option
snapshot_transactions=True
. Use this connection to read metadata from system views only. - Open another connection in normal mode and use it for everything else.
Follow this pattern and you should be fine.
Please see example_23 for common locking scenario solved by this feature.