Package dev.frostlake
Class ConcurrentDatabaseEngine
java.lang.Object
dev.frostlake.ConcurrentDatabaseEngine
Thread-safe wrapper around DatabaseEngine for concurrent multi-user access
Manages sessions and ensures proper isolation between concurrent requests
-
Constructor Summary
ConstructorsConstructorDescriptionConcurrentDatabaseEngine(EngineConfig config) A concurrent wrapper honoring the given configuration (database.default / schema.default). -
Method Summary
Modifier and TypeMethodDescriptionexecute(String sql, SessionContext session) Execute SQL in a session contextexecute(String sql, SessionContext session, Boolean clientAutoCommit) Execute SQL in a session context, the session first following the autocommit mode the client declares for this request (seeSessionContext.followClientAutoCommit(Boolean)).executeQuery(String sql, SessionContext session) Execute query and return single result setintgetOrCreateSession(String sessionId) getSession(String sessionId) voidremoveSession(String sessionId) voidshutdown()Shutdown the concurrent engine
-
Constructor Details
-
ConcurrentDatabaseEngine
public ConcurrentDatabaseEngine() -
ConcurrentDatabaseEngine
A concurrent wrapper honoring the given configuration (database.default / schema.default).
-
-
Method Details
-
execute
Execute SQL in a session context -
execute
Execute SQL in a session context, the session first following the autocommit mode the client declares for this request (seeSessionContext.followClientAutoCommit(Boolean)).- Parameters:
sql- the statement textsession- the session to run inclientAutoCommit- the request's autocommit mode, or null when it declares none- Returns:
- the statement's result
-
executeQuery
Execute query and return single result set -
createSession
-
getOrCreateSession
-
getSession
-
removeSession
-
getActiveSessionCount
public int getActiveSessionCount() -
getEngine
-
getSessionManager
-
shutdown
public void shutdown()Shutdown the concurrent engine
-