java.lang.Object
org.postgresql.pljava.internal.Session
- All Implemented Interfaces:
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 Summary
Modifier and TypeMethodDescriptionvoid
addSavepointListener
(SavepointListener listener) Adds the specified listener to the list of listeners that will receive savepoint events.void
addTransactionListener
(TransactionListener listener) Adds the specified listener to the list of listeners that will receive transactional events.void
executeAsOuterUser
(Connection conn, String statement) void
executeAsSessionUser
(Connection conn, String statement) Deprecated, for removal: This API element is subject to removal in a future version.getAttribute
(String attributeName) Deprecated, for removal: This API element is subject to removal in a future version.<T extends PooledObject>
ObjectPool<T> getObjectPool
(Class<T> cls) Return current_schema() as the outer user would see it.Deprecated, for removal: This API element is subject to removal in a future version.static Session
provider()
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 ordinaryMap
(that forbids nulls).void
removeSavepointListener
(SavepointListener listener) Removes the specified listener from the list of listeners that will receive savepoint events.void
removeTransactionListener
(TransactionListener listener) Removes the specified listener from the list of listeners that will receive transactional events.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 ordinaryMap
(that forbids nulls).
-
Method Details
-
provider
-
addTransactionListener
Adds the specified listener to the list of listeners that will receive transactional events.- Specified by:
addTransactionListener
in interfaceSession
-
addSavepointListener
Adds the specified listener to the list of listeners that will receive savepoint events.- Specified by:
addSavepointListener
in interfaceSession
-
getAttribute
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 ordinaryMap
(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 aTransactionListener
.Get an attribute from the session's attribute store.- Specified by:
getAttribute
in interfaceSession
-
getObjectPool
- Specified by:
getObjectPool
in interfaceSession
-
getUserName
- Specified by:
getUserName
in interfaceSession
-
getOuterUserName
- Specified by:
getOuterUserName
in interfaceSession
-
getSessionUserName
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getSessionUserName
in interfaceSession
-
removeAttribute
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 ordinaryMap
(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 aTransactionListener
.Remove an attribute from the session's attribute store.- Specified by:
removeAttribute
in interfaceSession
-
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 ordinaryMap
(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 aTransactionListener
.Set an attribute in the session's attribute store.- Specified by:
setAttribute
in interfaceSession
-
removeTransactionListener
Removes the specified listener from the list of listeners that will receive transactional events.- Specified by:
removeTransactionListener
in interfaceSession
-
removeSavepointListener
Removes the specified listener from the list of listeners that will receive savepoint events.- Specified by:
removeSavepointListener
in interfaceSession
-
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 interfaceSession
- Throws:
SQLException
-
executeAsOuterUser
- Specified by:
executeAsOuterUser
in interfaceSession
- Throws:
SQLException
-
getOuterUserSchema
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
-
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 ordinaryMap
(that forbids nulls).