public interface DatabaseSession extends Session
Purpose: Add login and configuration API to that of Session. This interface is to be used during the creation and login of the session only. The Session interface should be used after login for normal reading/writing.
Modifier and Type | Method and Description |
---|---|
void |
addDescriptor(ClassDescriptor descriptor)
PUBLIC:
Add the descriptor to the session.
|
void |
addDescriptors(Project project)
PUBLIC:
Add the descriptors to the session from the Project.
|
void |
addDescriptors(Vector descriptors)
PUBLIC:
Add the descriptors to the session.
|
void |
beginTransaction()
PUBLIC:
Begin a transaction on the database.
|
void |
commitTransaction()
PUBLIC:
Commit the active database transaction.
|
void |
deleteAllObjects(Collection domainObjects)
PUBLIC:
delete all of the objects and all of their privately owned parts in the database.
|
void |
deleteAllObjects(Vector domainObjects)
PUBLIC:
delete all of the objects and all of their privately owned parts in the database.
|
Object |
deleteObject(Object domainObject)
PUBLIC:
Delete the object and all of its privately owned parts from the database.
|
SequencingControl |
getSequencingControl()
PUBLIC:
Return SequencingControl which used for sequencing setup and
customization including management of sequencing preallocation.
|
ServerPlatform |
getServerPlatform()
PUBLIC:
Answer the server platform defining server-specific behaviour for the receiver (Oc4j, WLS, ...).
|
Object |
insertObject(Object domainObject)
PUBLIC:
Insert the object and all of its privately owned parts into the database.
|
boolean |
isInTransaction()
PUBLIC:
Return if the session is currently in the progress of a database transaction.
|
void |
login()
PUBLIC:
Connect to the database using the predefined login.
|
void |
login(Login login)
PUBLIC:
Connect to the database using the given login.
|
void |
login(String userName,
String password)
PUBLIC:
Connect to the database using the given user name and password.
|
void |
logout()
PUBLIC:
Disconnect from the database.
|
Object |
refreshAndLockObject(Object object)
PUBLIC:
Refresh the attributes of the object and of all of its private parts from the database.
|
Object |
refreshAndLockObject(Object object,
short lockMode)
PUBLIC:
Refresh the attributes of the object and of all of its private parts from the database.
|
void |
rollbackTransaction()
PUBLIC:
Rollback the active database transaction.
|
void |
setDatasourceLogin(Login login)
PUBLIC:
Set the login.
|
void |
setExternalTransactionController(ExternalTransactionController etc)
PUBLIC:
Used for JTS integration.
|
void |
setLogin(Login login)
PUBLIC:
Set the login.
|
void |
setServerPlatform(ServerPlatform newServerPlatform)
PUBLIC:
Set the server platform defining server-specific behaviour for the receiver (Oc4j, WLS, ...
|
Object |
updateObject(Object domainObject)
PUBLIC:
Update the object and all of its privately owned parts in the database.
|
void |
writeAllObjects(Collection domainObjects)
PUBLIC:
Write all of the objects and all of their privately owned parts in the database.
|
void |
writeAllObjects(Vector domainObjects)
PUBLIC:
Write all of the objects and all of their privately owned parts in the database.
|
Object |
writeObject(Object domainObject)
PUBLIC:
Write the object and all of its privately owned parts in the database.
|
acquireUnitOfWork, addEjbqlPlaceHolderQuery, addQuery, clearIntegrityChecker, clearProfile, containsQuery, copyObject, copyObject, doesObjectExist, dontLogMessages, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, getActiveSession, getActiveUnitOfWork, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getDatasourceLogin, getDatasourcePlatform, getDescriptor, getDescriptor, getDescriptorForAlias, getDescriptors, getEjbqlPlaceHolderQueries, getEventManager, getExceptionHandler, getExternalTransactionController, getIdentityMapAccessor, getIntegrityChecker, getLog, getLogin, getLogLevel, getLogLevel, getName, getNextSequenceNumberValue, getPlatform, getProfiler, getProject, getProperties, getProperty, getQueries, getQuery, getQuery, getSessionLog, handleException, handleSevere, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, isClientSession, isConnected, isDatabaseSession, isDistributedSession, isInProfile, isRemoteSession, isRemoteUnitOfWork, isServerSession, isSessionBroker, isUnitOfWork, keyFromObject, log, log, logMessage, logThrowable, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, refreshObject, release, removeProperty, removeQuery, setExceptionHandler, setIntegrityChecker, setLog, setLogLevel, setName, setProfiler, setProperty, setSessionLog, shouldLog, shouldLogMessages
void addDescriptor(ClassDescriptor descriptor)
addDescriptors(Vector)
,
addDescriptors(Project)
void addDescriptors(Vector descriptors)
void addDescriptors(Project project)
void beginTransaction() throws DatabaseException
DatabaseException
- if the database connection is lost or the begin is rejected.isInTransaction()
void commitTransaction() throws DatabaseException
DatabaseException
- most databases validate changes as they are done,
normally errors do not occur on commit unless the disk fails or the connection is lost.ConcurrencyException
- if this session is not within a transaction.void deleteAllObjects(Collection domainObjects)
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.void deleteAllObjects(Vector domainObjects)
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.Object deleteObject(Object domainObject) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
DeleteObjectQuery
Object insertObject(Object domainObject) throws DatabaseException
DatabaseException
InsertObjectQuery
,
writeObject(Object)
boolean isInTransaction()
void setServerPlatform(ServerPlatform newServerPlatform)
ServerPlatformBase
ServerPlatform getServerPlatform()
ServerPlatformBase
SequencingControl getSequencingControl()
void login() throws DatabaseException
DatabaseException
login(Login)
void login(String userName, String password) throws DatabaseException
DatabaseException
void login(Login login) throws DatabaseException
DatabaseException
void logout() throws DatabaseException
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.Object refreshAndLockObject(Object object)
#refreshAndLockObject(Object, lockMode)
Object refreshAndLockObject(Object object, short lockMode)
Lock Modes: ObjectBuildingQuery.NO_LOCK, LOCK, LOCK_NOWAIT
void rollbackTransaction() throws DatabaseException
DatabaseException
- if the database connection is lost or the rollback fails.ConcurrencyException
- if this session is not within a transaction.void setExternalTransactionController(ExternalTransactionController etc)
setExternalTransactionController
in interface Session
JTATransactionController
,
CustomServerPlatform
void setLogin(Login login)
void setDatasourceLogin(Login login)
Object updateObject(Object domainObject) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
UpdateObjectQuery
,
writeObject(Object)
void writeAllObjects(Collection domainObjects)
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.void writeAllObjects(Vector domainObjects)
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.Object writeObject(Object domainObject) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
WriteObjectQuery
,
insertObject(Object)
,
updateObject(Object)
Copyright © 2024. All rights reserved.