org.objectweb.telosys.dal.dao
Class StandardDatabaseSession

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.dal.dao.StandardDatabaseSession
All Implemented Interfaces:
DatabaseSession

public class StandardDatabaseSession
extends TelosysObject
implements DatabaseSession


Constructor Summary
StandardDatabaseSession(int iDatabaseId, java.sql.Connection con)
          Constructor for a real database dession
 
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
 boolean isDummy()
          Returns true if the session is a "dummy session" (without real connection)
 void rollback()
          Do a rollback on the session connection
 
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, toString, wait, wait, wait
 

Constructor Detail

StandardDatabaseSession

public StandardDatabaseSession(int iDatabaseId,
                               java.sql.Connection con)
                        throws TelosysException
Constructor for a real database dession

Parameters:
iDatabaseId -
con -
Throws:
TelosysException
Method Detail

isDummy

public boolean isDummy()
Description copied from interface: DatabaseSession
Returns true if the session is a "dummy session" (without real connection)

Specified by:
isDummy in interface DatabaseSession
Returns:

getDatabaseId

public int getDatabaseId()
Description copied from interface: DatabaseSession
Returns the database id of the session
0 to N for a real session
-1 for a dummy session

Specified by:
getDatabaseId in interface DatabaseSession
Returns:

getConnection

public java.sql.Connection getConnection()
Description copied from interface: DatabaseSession
Returns the database connection of the session
A dummy session returns null

Specified by:
getConnection in interface DatabaseSession
Returns:

commit

public void commit()
            throws TelosysException
Description copied from interface: DatabaseSession
Do a commit on the session connection

Specified by:
commit in interface DatabaseSession
Throws:
TelosysException

rollback

public void rollback()
              throws TelosysException
Description copied from interface: DatabaseSession
Do a rollback on the session connection

Specified by:
rollback in interface DatabaseSession
Throws:
TelosysException

close

public void close()
           throws TelosysException
Description copied from interface: DatabaseSession
Close the session connection

Specified by:
close in interface DatabaseSession
Throws:
TelosysException