|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 | |
boolean |
executeAsSessionUser(java.sql.Connection conn,
java.lang.String statement)
Execute a statement as a session user rather then the effective user. |
java.lang.Object |
getAttribute(java.lang.String attributeName)
Obtain an attribute from the current session. |
ObjectPool |
getObjectPool(java.lang.Class cls)
Return an object pool for the given class. |
java.lang.String |
getSessionUserName()
Return the name of the user that owns the current session. |
java.lang.String |
getUserName()
Return the name of the effective user. |
void |
removeAttribute(java.lang.String attributeName)
Remove an attribute previously stored in the session. |
void |
setAttribute(java.lang.String attributeName,
java.lang.Object value)
Set an attribute to a value in the current session. |
Method Detail |
public java.lang.Object getAttribute(java.lang.String attributeName)
attributeName
- The name of the attribute
public ObjectPool getObjectPool(java.lang.Class cls)
PooledObject
.
cls
-
public java.lang.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()
.
public java.lang.String getSessionUserName()
public boolean executeAsSessionUser(java.sql.Connection conn, java.lang.String statement) throws java.sql.SQLException
SECURITY DEFINER
wants to give up the definer
rights.
conn
- The connection used for the executionstatement
- The statement to execute
java.sql.SQLException
- if something goes wrong when executing.Statement.execute(java.lang.String)
public void removeAttribute(java.lang.String attributeName)
attributeName
- The name of the attribute.public void setAttribute(java.lang.String attributeName, java.lang.Object value)
attributeName
- value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |