com.jdbaccess.session
Class DBSessionImpl

java.lang.Object
  extended by com.jdbaccess.session.DBSessionImpl
All Implemented Interfaces:
DBSession, DBSessionHome

public class DBSessionImpl
extends java.lang.Object
implements DBSession, DBSessionHome

stateful session bean because of appId, which has to be set by client (server data access have to use the appId of the client) Synchronized: If an application server is used synchronized keyword has to be removed on all methods. Then the methods of class statement and subclasses have to get the synchronized keyword


Field Summary
protected static int RECONNECT_TIME
           
 
Constructor Summary
DBSessionImpl()
           
 
Method Summary
 void commit(com.jdbaccess.daimpl.TransactionImpl t)
           
 DBSession create()
           
 void deleteStmtsAndConnectionsFromPools(com.jdbaccess.daimpl.TransactionImpl transaction)
           
 DBSession ejbCreate()
           
 void end(com.jdbaccess.daimpl.DataAccessImpl da)
           
 void end(com.jdbaccess.daimpl.QueryTransactionImpl t)
          queries use the same connection more than once in a transaction
 void end(com.jdbaccess.daimpl.TransactionImpl t)
          This method is called only by transactions (not by query transactions)
 java.lang.Object execute(com.jdbaccess.daimpl.DataAccessImpl da)
           
 java.util.ArrayList getAllElements(com.jdbaccess.daimpl.ResultImpl result)
           
 TransferObject getElement(com.jdbaccess.daimpl.ResultImpl result)
           
 int getNewConnectionId()
           
 int getNewQueryConnectionId()
          queries use the same connection more than once in a transaction
 int getNewStatementId(com.jdbaccess.daimpl.DataAccessImpl da)
           
 java.util.ArrayList getNextElements(com.jdbaccess.daimpl.ResultImpl result, long count)
           
 java.util.ArrayList getOutputParams(com.jdbaccess.daimpl.CallImpl call)
           
 CallResult getResult(com.jdbaccess.daimpl.ProcedureImpl p, int resultPosition)
           
 java.lang.Long getSize(com.jdbaccess.daimpl.DataAccessImpl da)
          for queries: return size of result for insert, update, delete, function, procedure: return count of inserts, updates or deletes
 boolean hasNetworkProblems(com.jdbaccess.daimpl.TransactionImpl transaction)
           
 boolean newConnectionIsPossible()
           
 void ping(long appId)
           
 void rollback(com.jdbaccess.daimpl.TransactionImpl t)
           
 void setAppId(long appId)
           
 long setPosition(com.jdbaccess.daimpl.SelectImpl q, long pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RECONNECT_TIME

protected static int RECONNECT_TIME
Constructor Detail

DBSessionImpl

public DBSessionImpl()
Method Detail

setAppId

public void setAppId(long appId)
Specified by:
setAppId in interface DBSession

create

public DBSession create()
                 throws ApplicationException
Specified by:
create in interface DBSessionHome
Throws:
ApplicationException

ejbCreate

public DBSession ejbCreate()
                    throws ApplicationException
Throws:
ApplicationException

getNewConnectionId

public int getNewConnectionId()
                       throws ApplicationException
Specified by:
getNewConnectionId in interface DBSession
Throws:
ApplicationException

end

public void end(com.jdbaccess.daimpl.TransactionImpl t)
         throws ApplicationException
This method is called only by transactions (not by query transactions)

Specified by:
end in interface DBSession
Throws:
ApplicationException

getNewQueryConnectionId

public int getNewQueryConnectionId()
                            throws ApplicationException
queries use the same connection more than once in a transaction

Specified by:
getNewQueryConnectionId in interface DBSession
Throws:
ApplicationException

end

public void end(com.jdbaccess.daimpl.QueryTransactionImpl t)
         throws ApplicationException
queries use the same connection more than once in a transaction

Specified by:
end in interface DBSession
Throws:
ApplicationException

commit

public void commit(com.jdbaccess.daimpl.TransactionImpl t)
            throws ApplicationException
Specified by:
commit in interface DBSession
Throws:
ApplicationException

rollback

public void rollback(com.jdbaccess.daimpl.TransactionImpl t)
              throws ApplicationException
Specified by:
rollback in interface DBSession
Throws:
ApplicationException

getNewStatementId

public int getNewStatementId(com.jdbaccess.daimpl.DataAccessImpl da)
                      throws ApplicationException
Specified by:
getNewStatementId in interface DBSession
Throws:
ApplicationException

end

public void end(com.jdbaccess.daimpl.DataAccessImpl da)
         throws ApplicationException
Specified by:
end in interface DBSession
Throws:
ApplicationException

execute

public java.lang.Object execute(com.jdbaccess.daimpl.DataAccessImpl da)
                         throws ApplicationException
Specified by:
execute in interface DBSession
Throws:
ApplicationException

getAllElements

public java.util.ArrayList getAllElements(com.jdbaccess.daimpl.ResultImpl result)
                                   throws ApplicationException
Specified by:
getAllElements in interface DBSession
Throws:
ApplicationException

getNextElements

public java.util.ArrayList getNextElements(com.jdbaccess.daimpl.ResultImpl result,
                                           long count)
                                    throws ApplicationException
Specified by:
getNextElements in interface DBSession
Throws:
ApplicationException

getElement

public TransferObject getElement(com.jdbaccess.daimpl.ResultImpl result)
                          throws ApplicationException
Specified by:
getElement in interface DBSession
Throws:
ApplicationException

setPosition

public long setPosition(com.jdbaccess.daimpl.SelectImpl q,
                        long pos)
                 throws ApplicationException
Specified by:
setPosition in interface DBSession
Throws:
ApplicationException

getResult

public CallResult getResult(com.jdbaccess.daimpl.ProcedureImpl p,
                            int resultPosition)
                     throws ApplicationException
Specified by:
getResult in interface DBSession
Throws:
ApplicationException

getOutputParams

public java.util.ArrayList getOutputParams(com.jdbaccess.daimpl.CallImpl call)
                                    throws ApplicationException
Specified by:
getOutputParams in interface DBSession
Throws:
ApplicationException

getSize

public java.lang.Long getSize(com.jdbaccess.daimpl.DataAccessImpl da)
                       throws ApplicationException
for queries: return size of result for insert, update, delete, function, procedure: return count of inserts, updates or deletes

Specified by:
getSize in interface DBSession
Throws:
ApplicationException

ping

public void ping(long appId)
          throws ApplicationException
Specified by:
ping in interface DBSession
Throws:
ApplicationException

newConnectionIsPossible

public boolean newConnectionIsPossible()
Specified by:
newConnectionIsPossible in interface DBSession

hasNetworkProblems

public boolean hasNetworkProblems(com.jdbaccess.daimpl.TransactionImpl transaction)
Specified by:
hasNetworkProblems in interface DBSession

deleteStmtsAndConnectionsFromPools

public void deleteStmtsAndConnectionsFromPools(com.jdbaccess.daimpl.TransactionImpl transaction)
                                        throws ApplicationException
Specified by:
deleteStmtsAndConnectionsFromPools in interface DBSession
Throws:
ApplicationException