java.lang.Objectorg.objectweb.telosys.common.TelosysObject
org.objectweb.telosys.dal.dao.StandardDatabaseSession
Standard implementation of DatabaseSession
Constructor Summary | |
StandardDatabaseSession(int iDatabaseId,
java.sql.Connection con)
Constructor for a real database session Since v 1.0.2, the instance created is stored as a thread-local variables accessible via the class CurrentDatabaseSession. |
Method Summary | |
void |
close()
Close the session connection |
void |
commit()
Do a commit on the session connection |
java.sql.Connection |
getConnection()
Returns the database connection of the session A dummy session returns null |
int |
getDatabaseId()
Returns the database id of the session 0 to N for a real session -1 for a dummy session |
long |
getId()
Returns the database session unique id |
boolean |
isDummy()
Returns true if the session is a "dummy session" (without real connection) |
void |
rollback()
Do a rollback on the session connection |
java.lang.String |
toString()
|
Methods inherited from class org.objectweb.telosys.common.TelosysObject |
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StandardDatabaseSession(int iDatabaseId, java.sql.Connection con) throws TelosysException
iDatabaseId
- con
-
TelosysException
Method Detail |
public long getId()
DatabaseSession
getId
in interface DatabaseSession
public boolean isDummy()
DatabaseSession
isDummy
in interface DatabaseSession
public int getDatabaseId()
DatabaseSession
getDatabaseId
in interface DatabaseSession
public java.sql.Connection getConnection()
DatabaseSession
getConnection
in interface DatabaseSession
public void commit() throws TelosysException
DatabaseSession
commit
in interface DatabaseSession
TelosysException
public void rollback() throws TelosysException
DatabaseSession
rollback
in interface DatabaseSession
TelosysException
public void close() throws TelosysException
DatabaseSession
close
in interface DatabaseSession
TelosysException
public java.lang.String toString()