Class SessionContext

java.lang.Object
dev.frostlake.http.SessionContext

public class SessionContext extends Object
Per-session context tracking user state Each HTTP session has its own database/schema context
  • Constructor Details

    • SessionContext

      public SessionContext()
    • SessionContext

      public SessionContext(String sessionId)
    • SessionContext

      public SessionContext(String sessionId, String defaultDatabase, String defaultSchema)
      A session starting where the server's configured defaults point.
  • Method Details

    • touch

      public void touch()
    • isExpired

      public boolean isExpired(long timeoutMs)
    • getSessionId

      public String getSessionId()
    • getCreatedAt

      public long getCreatedAt()
    • getLastAccessTime

      public long getLastAccessTime()
    • getCurrentDatabase

      public String getCurrentDatabase()
    • setCurrentDatabase

      public void setCurrentDatabase(String currentDatabase)
    • getCurrentSchema

      public String getCurrentSchema()
    • setCurrentSchema

      public void setCurrentSchema(String currentSchema)
    • getMultiStatementCount

      public int getMultiStatementCount()
      How many statements a request may hold when it declares no count of its own; 0 means any.
    • followStatementCount

      public void followStatementCount(String sql)
      Follow an exact ALTER SESSION SET/UNSET MULTI_STATEMENT_COUNT this session just ran, so the next request that declares no count of its own is gated by what the client asked for. Any other statement leaves the value alone.
    • isAutoCommit

      public boolean isAutoCommit()
    • setAutoCommit

      public void setAutoCommit(boolean autoCommit)
    • followClientAutoCommit

      public void followClientAutoCommit(Boolean declared)
      Follow the autocommit mode a request declares. A declared mode that differs from the one the session's previous declaring request carried — or the first one the session sees — becomes the session's AUTOCOMMIT setting, exactly as ALTER SESSION SET AUTOCOMMIT would set it. A request that declares nothing, or repeats the mode already declared, leaves the setting where it stands: a client that sends its mode on every request switches the session exactly when that mode switches, and an ALTER SESSION SET AUTOCOMMIT it runs in between stays in force.
      Parameters:
      declared - the request's autocommit mode, or null when it declares none
    • isInTransaction

      public boolean isInTransaction()
    • setInTransaction

      public void setInTransaction(boolean inTransaction)
    • getTransactionId

      public Long getTransactionId()
    • setTransactionId

      public void setTransactionId(Long transactionId)
    • getVariable

      public Object getVariable(String name)
    • setVariable

      public void setVariable(String name, Object value)
    • clearVariables

      public void clearVariables()