|
Oracle Fusion Middleware Java API Reference for Oracle TopLink (Deprecated) 11g Release 1 (11.1.1) B32476-04 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DatabaseSession
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.
| Method Summary | |
|---|---|
void |
addDescriptor(ClassDescriptor descriptor)
Add the descriptor to the session. |
void |
addDescriptors(Project project)
Add the descriptors to the session from the Project. |
void |
addDescriptors(java.util.Vector descriptors)
Add the descriptors to the session. |
void |
beginTransaction()
Begin a transaction on the database. |
void |
commitTransaction()
Commit the active database transaction. |
void |
deleteAllObjects(java.util.Collection domainObjects)
delete all of the objects and all of their privately owned parts in the database. |
void |
deleteAllObjects(java.util.Vector domainObjects)
delete all of the objects and all of their privately owned parts in the database. |
java.lang.Object |
deleteObject(java.lang.Object domainObject)
Delete the object and all of its privately owned parts from the database. |
CommandManager |
getCommandManager()
ADVANCED: Return the CommandManager that allows this session to act as a CommandProcessor and receive or propagate commands from/to the TopLink cluster. |
SequencingControl |
getSequencingControl()
Return SequencingControl which used for sequencing setup and customization including management of sequencing preallocation. |
ServerPlatform |
getServerPlatform()
Answer the server platform defining server-specific behaviour for the receiver (Oc4j, WLS, ...). |
java.lang.Object |
insertObject(java.lang.Object domainObject)
Insert the object and all of its privately owned parts into the database. |
boolean |
isInTransaction()
Return if the session is currently in the progress of a database transaction. |
void |
login()
Connect to the database using the predefined login. |
void |
login(Login login)
Connect to the database using the given login. |
void |
login(java.lang.String userName,
java.lang.String password)
Connect to the database using the given user name and password. |
void |
logout()
Disconnect from the database. |
java.lang.Object |
refreshAndLockObject(java.lang.Object object)
Refresh the attributes of the object and of all of its private parts from the database. |
java.lang.Object |
refreshAndLockObject(java.lang.Object object,
short lockMode)
Refresh the attributes of the object and of all of its private parts from the database. |
void |
rollbackTransaction()
Rollback the active database transaction. |
void |
setCommandManager(CommandManager commandManager)
ADVANCED: Set the CommandManager that allows this session to act as a CommandProcessor and receive or propagate commands from/to the TopLink cluster. |
void |
setDatasourceLogin(Login login)
Set the login. |
void |
setExternalTransactionController(ExternalTransactionController etc)
Used for JTS integration. |
void |
setLogin(Login login)
Set the login. |
void |
setServerPlatform(ServerPlatform newServerPlatform)
Set the server platform defining server-specific behaviour for the receiver (Oc4j, WLS, ... ). |
void |
setShouldPropagateChanges(boolean choice)
ADVANCED: Set if cache changes should be propagated to other sessions or applications in a TopLink cluster through the Remote Command Manager mechanism. |
boolean |
shouldPropagateChanges()
ADVANCED: Return whether changes should be propagated to other sessions or applications in a TopLink cluster through the Remote Command Manager mechanism. |
java.lang.Object |
updateObject(java.lang.Object domainObject)
Update the object and all of its privately owned parts in the database. |
void |
writeAllObjects(java.util.Collection domainObjects)
Write all of the objects and all of their privately owned parts in the database. |
void |
writeAllObjects(java.util.Vector domainObjects)
Write all of the objects and all of their privately owned parts in the database. |
java.lang.Object |
writeObject(java.lang.Object domainObject)
Write the object and all of its privately owned parts in the database. |
| Method Detail |
|---|
void addDescriptor(ClassDescriptor descriptor)
addDescriptors(Vector),
addDescriptors(Project)void addDescriptors(java.util.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(java.util.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(java.util.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.
java.lang.Object deleteObject(java.lang.Object domainObject)
throws DatabaseException,
OptimisticLockException
DatabaseException
OptimisticLockExceptionDeleteObjectQuery
java.lang.Object insertObject(java.lang.Object domainObject)
throws DatabaseException
DatabaseExceptionInsertObjectQuery,
writeObject(Object)boolean isInTransaction()
void setServerPlatform(ServerPlatform newServerPlatform)
ServerPlatformBaseServerPlatform getServerPlatform()
getServerPlatform in interface SessionServerPlatformBaseSequencingControl getSequencingControl()
void login()
throws DatabaseException
DatabaseExceptionlogin(Login)
void login(java.lang.String userName,
java.lang.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.java.lang.Object refreshAndLockObject(java.lang.Object object)
#refreshAndLockObject(Object, lockMode)
java.lang.Object refreshAndLockObject(java.lang.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 SessionJTATransactionController,
oracle.toplink.platform.server.CustomServerPlatformCommandManager getCommandManager()
CommandManagervoid setCommandManager(CommandManager commandManager)
commandManager - The CommandManager instance to control the remote command
service for this session.setShouldPropagateChanges(boolean),
CommandManagervoid setShouldPropagateChanges(boolean choice)
choice - If true (and the CommandManager is set) then propagation will occur.setCommandManager(CommandManager)boolean shouldPropagateChanges()
setCommandManager(CommandManager)void setLogin(Login login)
void setDatasourceLogin(Login login)
java.lang.Object updateObject(java.lang.Object domainObject)
throws DatabaseException,
OptimisticLockException
DatabaseException
OptimisticLockExceptionUpdateObjectQuery,
writeObject(Object)void writeAllObjects(java.util.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(java.util.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.
java.lang.Object writeObject(java.lang.Object domainObject)
throws DatabaseException,
OptimisticLockException
DatabaseException
OptimisticLockExceptionWriteObjectQuery,
insertObject(Object),
updateObject(Object)
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||