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.
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.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
GetSessionCallback |
The callback function. |
getSessionForReadWrite(callback)
Retrieves a session for read/write operations.
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.
Returns:
| Type | Description |
|---|---|
| boolean |
Always returns |
isMultiplexedEnabledForRW() → {boolean}
Checks whether multiplexed session is enabled for read/write transactions.
Returns:
| Type | Description |
|---|---|
| boolean |
Always returns |
release(_session)
No-op release method retained for backwards compatibility.
Parameters:
| Name | Type | Description |
|---|---|---|
_session |
Session |
The session object. |