public final class SQLProviderSession implements AutoClosable:
Non-thread-safe SQL session owned by one EntityManager.
The low-level connection is opened lazily and reused for the manager lifetime. This removes repeated connection setup from managed query hot paths and guarantees that all transaction work uses one connection.
session = SQLProviderSession(configuration) try lease = session.openConnection(): print(lease.connection.url) session.close()
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | openopen as Boolean: |
Indicates whether this session accepts provider operations. |
| public readonly property | transactionActivetransactionActive as Boolean: |
Indicates whether a low-level SQL transaction is active. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | SQLProviderSessionSQLProviderSession(configuration as SQLConfiguration): |
Creates a lazy provider session. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | assertOpenassertOpen() as Void: |
Verifies that the owning EntityManager remains open. |
| public | beginTransactionbeginTransaction() as Void: |
Begins a transaction on the manager connection. |
| public | closeclose() as Void: |
Rolls back unfinished work and closes the manager connection. |
| public | commitTransactioncommitTransaction() as Void: |
Commits the active transaction and restores auto-commit. |
| public | openConnectionopenConnection() as SQLConnectionLease: |
Borrows the lazily opened manager connection. |
| public | rollbackTransactionrollbackTransaction() as Void: |
Rolls back the active transaction and restores auto-commit. |