SQLProviderSession
class in package klyn.data.sql.internal

    public final class SQLProviderSession implements AutoClosable:

SQLProviderSession
All Implemented Interfaces: 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()

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | open `open as Boolean:` | Indicates whether this session accepts provider operations.
public readonly property | transactionActive `transactionActive as Boolean:` | Indicates whether a low-level SQL transaction is active.

Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | SQLProviderSession `SQLProviderSession(configuration as SQLConfiguration):` | Creates a lazy provider session.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | assertOpen `assertOpen() as Void:` | Verifies that the owning EntityManager remains open.
public | beginTransaction `beginTransaction() as Void:` | Begins a transaction on the manager connection.
public | close `close() as Void:` | Rolls back unfinished work and closes the manager connection.
public | commitTransaction `commitTransaction() as Void:` | Commits the active transaction and restores auto-commit.
public | openConnection `openConnection() as SQLConnectionLease:` | Borrows the lazily opened manager connection.
public | rollbackTransaction `rollbackTransaction() as Void:` | Rolls back the active transaction and restores auto-commit.

Inherited Methods
method Inherited Methods from AutoClosable: close