Skip navigation links
oracle.toplink.publicinterface
Class DatabaseSession
java.lang.Object
AbstractSession
oracle.toplink.publicinterface.DatabaseSession
- All Implemented Interfaces:
- DatabaseSession, Session
Deprecated. since OracleAS TopLink 10g (10.1.3). This class is replaced by DatabaseSession
, and oracle.toplink.internal.sessions.DatabaseSessionImpl
- public class DatabaseSession
- extends AbstractSession
- implements DatabaseSession
Implementation of oracle.toplink.sessions.DatabaseSession The public interface should be used.
- See Also:
-
Purpose: Define the implementation for a single user/single connection TopLink session.
Description: The session is the primary interface into TopLink, the application should do all of its reading and writing of objects through the session. The session also manages transactions and units of work. The database session is intended for usage in two-tier client-server applications. Although it could be used in a server situation, it is limitted to only having a single database connection and only allows a single open database transaction.
Responsibilities:
- Connecting/disconnecting.
- Reading and writing objects.
- Transaction and unit of work support.
- Identity maps and caching.
, Serialized Form
Method Summary |
void |
addDescriptor(Descriptor descriptor)
Deprecated. PUBLIC: Add the descriptor to the session. |
void |
addDescriptors(Project project)
Deprecated. PUBLIC: Add the descriptors to the session from the Project. |
void |
addDescriptors(java.util.Vector descriptors)
Deprecated. PUBLIC: Add the descriptors to the session. |
long |
getConnectedTime()
Deprecated. PUBLIC: Answer the time that this session got connected. |
Sequencing |
getSequencing()
Deprecated. PUBLIC: Return the Sequencing object used by the session. |
SequencingControl |
getSequencingControl()
Deprecated. PUBLIC: Return SequencingControl which used for sequencing setup and customization including management of sequencing preallocation. |
ServerPlatform |
getServerPlatform()
Deprecated. PUBLIC: Answer the server platform to handle server specific behaviour for WLS, Oc4j, etc. |
void |
initializeConnectedTime()
Deprecated. PUBLIC: Initialize the time that this session got connected. |
void |
login()
Deprecated. PUBLIC: Connect to the database using the predefined login. |
void |
login(Login login)
Deprecated. PUBLIC: Connect to the database using the given login. |
void |
login(java.lang.String userName, java.lang.String password)
Deprecated. PUBLIC: Connect to the database using the given user name and password. |
void |
logout()
Deprecated. PUBLIC: Disconnect from the database. |
void |
setServerPlatform(ServerPlatform newServerPlatform)
Deprecated. PUBLIC: Set the server platform to handle server specific behaviour for WLS, Oc4j, etc This is not permitted after the session is logged in. |
void |
writeAllObjects(java.util.Collection domainObjects)
Deprecated. PUBLIC: Write all of the objects and all of their privately owned parts in the database. |
void |
writeAllObjects(java.util.Vector domainObjects)
Deprecated. PUBLIC: Write all of the objects and all of their privately owned parts in the database. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.toplink.sessions.DatabaseSession |
beginTransaction, commitTransaction, deleteAllObjects, deleteAllObjects, deleteObject, getCommandManager, insertObject, isInTransaction, refreshAndLockObject, refreshAndLockObject, rollbackTransaction, setCommandManager, setDatasourceLogin, setExternalTransactionController, setLogin, setShouldPropagateChanges, shouldPropagateChanges, updateObject, writeObject |
Methods inherited from interface oracle.toplink.sessions.Session |
acquireHistoricalSession, acquireUnitOfWork, addQuery, clearIntegrityChecker, clearProfile, containsObjectInIdentityMap, containsObjectInIdentityMap, containsQuery, copyObject, copyObject, doesObjectExist, dontLogMessages, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, getActiveSession, getActiveUnitOfWork, getAllFromIdentityMap, getAllFromIdentityMap, getAsOfClause, getCacheSynchronizationManager, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getDatasourceLogin, getDescriptor, getDescriptor, getDescriptorForAlias, getDescriptors, getEventManager, getExceptionHandler, getExternalTransactionController, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getIdentityMapAccessor, getIntegrityChecker, getLog, getLogin, getLogLevel, getLogLevel, getName, getNextSequenceNumberValue, getProfiler, getProject, getProperties, getProperty, getQueries, getQuery, getQuery, getSessionLog, getWriteLockValue, getWriteLockValue, handleException, handleSevere, hasCacheSynchronizationManager, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, initializeAllIdentityMaps, initializeIdentityMap, initializeIdentityMaps, isClientSession, isConnected, isDistributedSession, isInProfile, isRemoteSession, isRemoteUnitOfWork, isServerSession, isSessionBroker, isUnitOfWork, keyFromObject, log, log, logDebug, logDebug, logException, logMessage, logMessage, logMessages, printIdentityMap, printIdentityMaps, putInIdentityMap, putInIdentityMap, putInIdentityMap, readAllObjects, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, readObject, refreshObject, release, removeFromIdentityMap, removeFromIdentityMap, removeProperty, removeQuery, setCacheSynchronizationManager, setExceptionHandler, setIntegrityChecker, setLog, setLogLevel, setName, setProfiler, setProperty, setSessionLog, setSessionLog, setShouldLogMessages, shouldLog, shouldLogMessages, updateWriteLockValue, updateWriteLockValue, usesExternalTransactionController, validateCache |
DatabaseSession
public DatabaseSession(Login login)
- Deprecated.
- PUBLIC: Create and return a new session. By giving the login information on creation this allows the session to initialize itself to the platform given in the login. This constructor does not return a connected session. To connect the session to the database login() must be sent to it. The login(userName, password) method may also be used to connect the session, this allows for the user name and password to be given at login but for the other database information to be provided when the session is created.
DatabaseSession
public DatabaseSession(Project project)
- Deprecated.
- PUBLIC: Create and return a new session. This constructor does not return a connected session. To connect the session to the database login() must be sent to it. The login(userName, password) method may also be used to connect the session, this allows for the user name and password to be given at login but for the other database information to be provided when the session is created.
getSequencingControl
public SequencingControl getSequencingControl()
- Deprecated.
- PUBLIC: Return SequencingControl which used for sequencing setup and customization including management of sequencing preallocation.
getSequencing
public Sequencing getSequencing()
- Deprecated.
- PUBLIC: Return the Sequencing object used by the session.
addDescriptor
public void addDescriptor(Descriptor descriptor)
- Deprecated.
- PUBLIC: Add the descriptor to the session. All persistent classes must have a descriptor registered for them with the session. It is best to add the descriptors before login, if added after login the order in which descriptors are added is dependant on inheritice and references unless the addDescriptors method is used.
-
- Specified by:
addDescriptor
in interface DatabaseSession
-
- See Also:
addDescriptors(Vector)
, addDescriptors(oracle.toplink.sessions.Project)
addDescriptors
public void addDescriptors(java.util.Vector descriptors)
- Deprecated.
- PUBLIC: Add the descriptors to the session. All persistent classes must have a descriptor registered for them with the session. This method allows for a batch of descriptors to be added at once so that TopLink can resolve the dependancies between the descriptors and perform initialization optimially.
-
- Specified by:
addDescriptors
in interface DatabaseSession
addDescriptors
public void addDescriptors(Project project)
- Deprecated.
- PUBLIC: Add the descriptors to the session from the Project. This can be used to combine the descriptors from multiple projects into a single session. This can be called after the session has been connected as long as there are no external dependencies.
-
- Specified by:
addDescriptors
in interface DatabaseSession
getServerPlatform
public ServerPlatform getServerPlatform()
- Deprecated.
- PUBLIC: Answer the server platform to handle server specific behaviour for WLS, Oc4j, etc. If the user wants a different external transaction controller class or to provide some different behaviour than the provided ServerPlatform(s), we recommend subclassing oracle.toplink.platform.server.ServerPlatformBase (or a subclass), and overriding: ServerPlatformBase.getExternalTransactionControllerClass() ServerPlatformBase.registerMBean() ServerPlatformBase.unregisterMBean() for the desired behaviour.
-
- Specified by:
getServerPlatform
in interface DatabaseSession
-
- See Also:
ServerPlatformBase
setServerPlatform
public void setServerPlatform(ServerPlatform newServerPlatform)
- Deprecated.
- PUBLIC: Set the server platform to handle server specific behaviour for WLS, Oc4j, etc This is not permitted after the session is logged in. If the user wants a different external transaction controller class or to provide some different behaviour than the provided ServerPlatform(s), we recommend subclassing oracle.toplink.platform.server.ServerPlatformBase (or a subclass), and overriding: ServerPlatformBase.getExternalTransactionControllerClass() ServerPlatformBase.registerMBean() ServerPlatformBase.unregisterMBean() for the desired behaviour.
-
- Specified by:
setServerPlatform
in interface DatabaseSession
-
- See Also:
ServerPlatformBase
login
public void login()
throws DatabaseException
- Deprecated.
- PUBLIC: Connect to the database using the predefined login. The login must have been assigned when or after creating the session.
-
- Specified by:
login
in interface DatabaseSession
-
- Throws:
DatabaseException
- See Also:
login(Login)
login
public void login(java.lang.String userName,
java.lang.String password)
throws DatabaseException
- Deprecated.
- PUBLIC: Connect to the database using the given user name and password. The additional login information must have been preset in the session's login attribute. This is the login that should be used if each user has their own id, but all users share the same database configuration.
-
- Specified by:
login
in interface DatabaseSession
-
- Throws:
DatabaseException
login
public void login(Login login)
throws DatabaseException
- Deprecated.
- PUBLIC: Connect to the database using the given login. The login may also the preset and the login() protocol called. This is the login should only be used if each user has their own database configuration.
-
- Specified by:
login
in interface DatabaseSession
-
- Throws:
DatabaseException
logout
public void logout()
throws DatabaseException
- Deprecated.
- PUBLIC: Disconnect from the database.
-
- Specified by:
logout
in interface DatabaseSession
-
- Throws:
TopLinkException
- if a transaction is active, you must rollback any active transaction before logout.
DatabaseException
- the database will also raise an error if their is an active transaction, or a general error occurs.
initializeConnectedTime
public void initializeConnectedTime()
- Deprecated.
- PUBLIC: Initialize the time that this session got connected. This can help determine how long a session has been connected.
getConnectedTime
public long getConnectedTime()
- Deprecated.
- PUBLIC: Answer the time that this session got connected. This can help determine how long a session has been connected.
writeAllObjects
public void writeAllObjects(java.util.Collection domainObjects)
throws DatabaseException,
OptimisticLockException
- Deprecated.
- PUBLIC: Write all of the objects and all of their privately owned parts in the database. The objects will be commited through a single transaction.
-
- Specified by:
writeAllObjects
in interface DatabaseSession
-
- Throws:
DatabaseException
- if an error occurs on the database, these include constraint violations, security violations and general database erros.
OptimisticLockException
- if the object's descriptor is using optimistic locking and the object has been updated or deleted by another user since it was last read.
writeAllObjects
public void writeAllObjects(java.util.Vector domainObjects)
throws DatabaseException,
OptimisticLockException
- Deprecated.
- PUBLIC: Write all of the objects and all of their privately owned parts in the database. The objects will be commited through a single transaction.
-
- Specified by:
writeAllObjects
in interface DatabaseSession
-
- Throws:
DatabaseException
- if an error occurs on the database, these include constraint violations, security violations and general database erros.
OptimisticLockException
- if the object's descriptor is using optimistic locking and the object has been updated or deleted by another user since it was last read.
Skip navigation links