SessionFactory

SessionFactory

Creates a SessionFactory object to manage the creation of multiplexed session.

Constructor

new SessionFactory(database, name)

Parameters:
Name Type Description
database Database

Database object.

name String

Name of the database.

Methods

close()

Closes the session factory and stops background maintenance.

getPool() → {SessionPoolInterface}

Returns the regular session pool object.

Deprecated: Session pool is deprecated and will be removed in a future release.

Returns:
Type Description
SessionPoolInterface

The session pool used by current instance.

getSession(callback)

Retrieves a multiplexed session.

Parameters:
Name Type Description
callback GetSessionCallback

The callback function.

getSessionForPartitionedOps(callback)

Retrieves a session for partitioned operations.

Deprecated: Use SessionFactory#getSession instead.

Parameters:
Name Type Description
callback GetSessionCallback

The callback function.

getSessionForReadWrite(callback)

Retrieves a session for read/write operations.

Deprecated: Use SessionFactory#getSession instead.

Parameters:
Name Type Description
callback GetSessionCallback

The callback function.

getSessionSync() → {Session|null}

Synchronously returns a cached multiplexed session if available, otherwise null.

Returns:
Type Description
Session | null

The cached multiplexed session or null.

isMultiplexedEnabled() → {boolean}

Checks whether multiplexed session is enabled.

Deprecated: Multiplexed sessions are always enabled.

Returns:
Type Description
boolean

Always returns true.

isMultiplexedEnabledForRW() → {boolean}

Checks whether multiplexed session is enabled for read/write transactions.

Deprecated: Multiplexed sessions are always enabled for read/write transactions.

Returns:
Type Description
boolean

Always returns true.

release(_session)

No-op release method retained for backwards compatibility.

Deprecated: Multiplexed sessions do not require releasing back to a pool.

Parameters:
Name Type Description
_session Session

The session object.