org.objectweb.telosys.dal.dao
Class DummyDatabaseSession

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

public class DummyDatabaseSession
extends TelosysObject
implements DatabaseSession

Dummy database session used when working without a real database connection


Constructor Summary
DummyDatabaseSession()
          Constructor for a "dummy database session"
(without a real database connection)
 
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

DummyDatabaseSession

public DummyDatabaseSession()
Constructor for a "dummy database session"
(without a real database connection)

Method Detail

getId

public long getId()
Description copied from interface: DatabaseSession
Returns the database session unique id

Specified by:
getId in interface DatabaseSession
Returns:

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

toString

public java.lang.String toString()