java.lang.Object
org.postgresql.pljava.internal.Session
All Implemented Interfaces:
Session

public class Session extends Object implements Session
An instance of this interface reflects the current session. The attribute store is deprecated. It had interesting transactional behavior until PL/Java 1.2.0, but since then it has behaved as any (non-null-allowing) Map. Anyone needing any sort of attribute store with transactional behavior will need to implement one and use a TransactionListener to keep it sync'd.
Author:
Thomas Hallgren
  • Method Details

    • provider

      public static Session provider()
    • addTransactionListener

      public void addTransactionListener(TransactionListener listener)
      Adds the specified listener to the list of listeners that will receive transactional events.
      Specified by:
      addTransactionListener in interface Session
    • addSavepointListener

      public void addSavepointListener(SavepointListener listener)
      Adds the specified listener to the list of listeners that will receive savepoint events.
      Specified by:
      addSavepointListener in interface Session
    • getAttribute

      @Deprecated(since="1.5.3", forRemoval=true) public Object getAttribute(String attributeName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Session's attribute store once had a special, and possibly useful, transactional behavior, but since PL/Java 1.2.0 it has lacked that, and offers nothing you don't get with an ordinary Map (that forbids nulls). If some kind of store with transactional behavior is needed, it should be implemented in straight Java and kept in sync by using a TransactionListener.
      Get an attribute from the session's attribute store.
      Specified by:
      getAttribute in interface Session
    • getObjectPool

      public <T extends PooledObject> ObjectPool<T> getObjectPool(Class<T> cls)
      Specified by:
      getObjectPool in interface Session
    • getUserName

      public String getUserName()
      Specified by:
      getUserName in interface Session
    • getOuterUserName

      public String getOuterUserName()
      Specified by:
      getOuterUserName in interface Session
    • getSessionUserName

      @Deprecated(since="1.5.0", forRemoval=true) public String getSessionUserName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getSessionUserName in interface Session
    • removeAttribute

      @Deprecated(since="1.5.3", forRemoval=true) public void removeAttribute(String attributeName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Session's attribute store once had a special, and possibly useful, transactional behavior, but since PL/Java 1.2.0 it has lacked that, and offers nothing you don't get with an ordinary Map (that forbids nulls). If some kind of store with transactional behavior is needed, it should be implemented in straight Java and kept in sync by using a TransactionListener.
      Remove an attribute from the session's attribute store.
      Specified by:
      removeAttribute in interface Session
    • setAttribute

      @Deprecated(since="1.5.3", forRemoval=true) public void setAttribute(String attributeName, Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Session's attribute store once had a special, and possibly useful, transactional behavior, but since PL/Java 1.2.0 it has lacked that, and offers nothing you don't get with an ordinary Map (that forbids nulls). If some kind of store with transactional behavior is needed, it should be implemented in straight Java and kept in sync by using a TransactionListener.
      Set an attribute in the session's attribute store.
      Specified by:
      setAttribute in interface Session
    • removeTransactionListener

      public void removeTransactionListener(TransactionListener listener)
      Removes the specified listener from the list of listeners that will receive transactional events.
      Specified by:
      removeTransactionListener in interface Session
    • removeSavepointListener

      public void removeSavepointListener(SavepointListener listener)
      Removes the specified listener from the list of listeners that will receive savepoint events.
      Specified by:
      removeSavepointListener in interface Session
    • executeAsSessionUser

      @Deprecated(since="1.5.0", forRemoval=true) public void executeAsSessionUser(Connection conn, String statement) throws SQLException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      executeAsSessionUser in interface Session
      Throws:
      SQLException
    • executeAsOuterUser

      public void executeAsOuterUser(Connection conn, String statement) throws SQLException
      Specified by:
      executeAsOuterUser in interface Session
      Throws:
      SQLException
    • getOuterUserSchema

      public Lexicals.Identifier.Simple getOuterUserSchema() throws SQLException
      Return current_schema() as the outer user would see it. Currently used only in Commands.java. Not made visible API yet because there has to be a more general way to do this.
      Throws:
      SQLException