|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
A Session maintains transaction coordinated in-memory data. The data added since the last commit will be lost on a transaction rollback, i.e. the Session state is synchronized with the transaction. Please note that if nested objects (such as lists and maps) are stored in the session, changes internal to those objects are not subject to the session semantics since the session is unaware of them.
Method Summary | |
---|---|
void |
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 |
executeAsSessionUser(Connection conn,
String statement)
Execute a statement as a session user rather then the effective user. |
Object |
getAttribute(String attributeName)
Obtain an attribute from the current session. |
ObjectPool |
getObjectPool(Class cls)
Return an object pool for the given class. |
String |
getSessionUserName()
Return the name of the user that owns the current session. |
String |
getUserName()
Return the name of the effective user. |
void |
removeAttribute(String attributeName)
Remove an attribute previously stored in the session. |
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)
Set an attribute to a value in the current session. |
Method Detail |
---|
void addSavepointListener(SavepointListener listener)
listener
to the list of listeners that will
receive savepoint events. This method does nothing if the listener
was already added.
listener
- The listener to be added.void addTransactionListener(TransactionListener listener)
listener
to the list of listeners that will
receive transactional events. This method does nothing if the listener
was already added.
listener
- The listener to be added.Object getAttribute(String attributeName)
attributeName
- The name of the attribute
ObjectPool getObjectPool(Class cls)
PooledObject
.
cls
-
String getUserName()
SECURITY DEFINER
,
then this method returns the name of the user that defined
the function, otherwise, this method will return the same
as getSessionUserName()
.
String getSessionUserName()
void executeAsSessionUser(Connection conn, String statement) throws SQLException
SECURITY DEFINER
wants to give up the definer
rights.
conn
- The connection used for the executionstatement
- The statement to execute
SQLException
- if something goes wrong when executing.Statement.execute(java.lang.String)
void removeAttribute(String attributeName)
attributeName
- The name of the attribute.void removeSavepointListener(SavepointListener listener)
listener
from the list of listeners that will
receive savepoint events. This method does nothing unless the listener is
found.
listener
- The listener to be removed.void removeTransactionListener(TransactionListener listener)
listener
from the list of listeners that will
receive transactional events. This method does nothing unless the listener is
found.
listener
- The listener to be removed.void setAttribute(String attributeName, Object value)
attributeName
- value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |