org.objectweb.cjdbc.controller.requestmanager.distributed
Class DistributedRequestManager

java.lang.Object
  extended byjavax.management.StandardMBean
      extended byorg.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
          extended byorg.objectweb.cjdbc.controller.requestmanager.RequestManager
              extended byorg.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, RequestManagerMBean, XmlComponent
Direct Known Subclasses:
RAIDb1DistributedRequestManager, RAIDb2DistributedRequestManager

public abstract class DistributedRequestManager
extends RequestManager

This class defines a Distributed Request Manager.

The DRM is composed of a Request Scheduler, an optional Query Cache, and a Load Balancer and an optional Recovery Log. Unlike a non-dsitributed Request Manager, this implementation is responsible for synchronizing the different controllers components (schedulers, ...). Functions that are RAIDb level dependent are implemented in sub-classes.

Version:
1.0
Author:
Emmanuel Cecchet , Jean-Bernard van Zuylen

Nested Class Summary
 
Nested classes inherited from class javax.management.StandardMBean
 
Field Summary
static long CONTROLLER_ID_BIT_MASK
          Effective controllerIds are on the upper 16 bits of a long (64 bits).
static long CONTROLLER_ID_BITS
           
static int CONTROLLER_ID_SHIFT_BITS
           
private  long controllerId
          Unique controller identifier
private  java.util.ArrayList distributedTransactions
          List of transactions that have executed on multiple controllers
protected  DistributedVirtualDatabase dvdb
           
private  java.util.Vector failedOnAllBackends
          List of queries that failed on all backends
protected static int NO_RESULT
           
static long TRANSACTION_ID_BIT_MASK
          TRANSACTION_ID_BIT_MASK is used to get the transaction id local to the originating controller
 
Fields inherited from class org.objectweb.cjdbc.controller.requestmanager.RequestManager
backupManager, beginTimeout, commitTimeout, dbs, loadBalancer, logger, parsingCache, recoveryLog, requiredParsingGranularity, resultCache, rollbackTimeout, scheduler, schedulerParsingranularity, tidLoginTable, tidSavepoints, vdb
 
Fields inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
 
Fields inherited from class javax.management.StandardMBean
 
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent
DOCTYPE_CONTROLLER, DOCTYPE_DB, XML_VERSION
 
Constructor Summary
DistributedRequestManager(DistributedVirtualDatabase vdb, AbstractScheduler scheduler, AbstractResultCache cache, AbstractLoadBalancer loadBalancer, RecoveryLog recoveryLog, long beginTimeout, long commitTimeout, long rollbackTimeout)
          Builds a new DistributedRequestManager instance without cache.
 
Method Summary
 void addFailedOnAllBackends(AbstractRequest request)
          Add a request that failed on all backends.
 long begin(java.lang.String login)
          Begin a new transaction and return the corresponding transaction identifier.
 void commit(long transactionId, boolean logCommit)
          Commit a transaction given its id.
 void completeFailedOnAllBackends(AbstractRequest request, boolean success)
          Notify completion of a request that failed on all backends.
 void disableBackend(DatabaseBackend db)
          Disable a backend that is currently enabled on this virtual database.
 void disableBackendForCheckpoint(DatabaseBackend db, java.lang.String checkpointName)
          The backend must belong to this virtual database and be in the enabled state.
abstract  void distributedCommit(java.lang.String login, long transactionId)
          Distributed implementation of a commit
abstract  void distributedReleaseSavepoint(long transactionId, java.lang.String name)
          Distributed implementation of releasing a savepoint from a transaction
abstract  void distributedRollback(long transactionId, java.lang.String savepointName)
          Distributed implementation of a rollback to a savepoint
abstract  void distributedRollback(java.lang.String login, long transactionId)
          Distributed implementation of a rollback
abstract  void distributedSetSavepoint(long transactionId, java.lang.String name)
          Distributed implementation of setting a savepoint to a transaction
 void enableBackend(DatabaseBackend db)
          Enable a backend that has been previously added to this virtual database and that is in the disabled state.
abstract  ControllerResultSet execDistributedReadStoredProcedure(StoredProcedure proc)
          Distributed implementation of a read stored procedure execution.
abstract  int execDistributedWriteRequest(AbstractWriteRequest request)
          Distributed implementation of a write request execution.
abstract  ControllerResultSet execDistributedWriteRequestWithKeys(AbstractWriteRequest request)
          Distributed implementation of a write request execution that returns auto-generated keys.
abstract  int execDistributedWriteStoredProcedure(StoredProcedure proc)
          Distributed implementation of a write stored procedure execution.
 int execDistributedWriteStoredProcedureLocally(StoredProcedure proc)
          Once the request has been dispatched, it can be executed using the code from RequestManager
 ControllerResultSet execLocalReadRequest(SelectRequest request)
          Performs a local read operation, as opposed to execReadRequest() which attempts to use distributed reads when there is NoMoreBackendException.
 ControllerResultSet execReadRequest(SelectRequest request)
          Perform a read request and return the reply.
 ControllerResultSet execReadStoredProcedure(StoredProcedure proc)
          Call a stored procedure that returns a ResultSet.
 ControllerResultSet execReadStoredProcedureLocally(StoredProcedure proc)
          Once the request has been dispatched, it can be executed using the code from RequestManager
abstract  ControllerResultSet execRemoteReadRequest(SelectRequest request)
          Execute a read request on some remote controller - one in the group.
 int execWriteRequest(AbstractWriteRequest request)
          Perform a write request and return the number of rows affected Call first the scheduler (if defined), then notify the cache (if defined) and finally call the load balancer.
 ControllerResultSet execWriteRequestWithKeys(AbstractWriteRequest request)
          Perform a write request and return the auto generated keys.
 int execWriteStoredProcedure(StoredProcedure proc)
          Call a stored procedure that performs an update.
 long getControllerId()
          Returns the unique controller identifier.
 Trace getLogger()
          Get the trace logger of this DistributedRequestManager
 VirtualDatabase getVirtualDatabase()
          Returns the vdb value.
 void lazyTransactionStart(AbstractRequest request)
          Check if the transaction corresponding to the given query has been started remotely and start the transaction locally in a lazy manner if needed.
 void releaseSavepoint(long transactionId, java.lang.String name)
          Releases a savepoint given its name from a transaction given its id.
 void removeFailedCommitFromRecoveryLog(TransactionMarkerMetaData tm)
          Remove a commit call that was logged because no backend was available locally to execute it but that finally ended up in failing at all other controllers.
 void removeFailedRequestFromRecoveryLog(AbstractWriteRequest request, long recoveryLogId)
          Remove a request that was logged because no backend was available locally to execute it but that finally ended up in failing at all other controllers.
 void removeFailedRollbackFromRecoveryLog(TransactionMarkerMetaData tm)
          Remove a rollback call that was logged because no backend was available locally to execute it but that finally ended up in failing at all other controllers.
 void removeFailedStoredProcedureFromRecoveryLog(StoredProcedure proc)
          Remove a stored procedure call that was logged because no backend was available locally to execute it but that finally ended up in failing at all other controllers.
 void rollback(long transactionId, boolean logRollback)
          Rollback a transaction given its id.
 void rollback(long transactionId, java.lang.String savepointName)
          Rollback a transaction given its id to a savepoint given its name.
 void scheduleExecWriteRequest(AbstractWriteRequest request)
          Schedule a request for execution.
 void setControllerId(long id)
          Sets the controller identifier value (this id must be unique).
 int setSavepoint(long transactionId)
          Sets a unnamed savepoint to a transaction given its id.
 void setSavepoint(long transactionId, java.lang.String name)
          Sets a savepoint given its desired name to a transaction given its id.
 void setScheduler(AbstractScheduler scheduler)
          Set the Request Scheduler to use in this Request Controller.
 
Methods inherited from class org.objectweb.cjdbc.controller.requestmanager.RequestManager
abort, addSavepoint, backupBackend, completeTransaction, disableBackendsForCheckpoint, enableBackendFromCheckpoint, flushCacheAndLogStoredProcedure, getAssociatedString, getBackendStateListener, getBackupManager, getBeginTimeout, getCacheParsingranularity, getCommitTimeout, getDatabaseSchema, getLoadBalancer, getLoadBalancerParsingranularity, getMetadataCache, getRecoveryLog, getRequiredParsingGranularity, getResultCache, getRollbackTimeout, getScheduler, getSchedulerParsingranularity, getTransactionMarker, getXml, hasSavepoint, isCaseSensitiveParsing, isSchemaIsStatic, loadBalanceExecWriteRequest, loadBalanceExecWriteRequestWithKeys, loadBalanceReadStoredProcedure, loadBalanceWriteStoredProcedure, logLazyTransactionBegin, mergeDatabaseSchema, removeCheckpoint, removeSavepoint, removeSavepoints, restoreBackendFromBackupCheckpoint, scheduleStoredProcedure, setBackupManager, setBeginTimeout, setCacheParsingranularity, setCaseSensitiveParsing, setCommitTimeout, setDatabaseSchema, setLoadBalancer, setLoadBalancerParsingranularity, setMetadataCache, setParsingCache, setRecoveryLog, setRequiredParsingGranularity, setResultCache, setRollbackTimeout, setSchedulerParsingranularity, setSchemaIsDirty, setSchemaIsStatic, storeBackendsInfo, updateAndNotifyExecWriteRequest
 
Methods inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
addNotificationListener, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getNotificationInfo, getParameterName, getParameterName, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dvdb

protected DistributedVirtualDatabase dvdb

failedOnAllBackends

private java.util.Vector failedOnAllBackends
List of queries that failed on all backends


controllerId

private long controllerId
Unique controller identifier


distributedTransactions

private java.util.ArrayList distributedTransactions
List of transactions that have executed on multiple controllers


NO_RESULT

protected static final int NO_RESULT
See Also:
Constant Field Values

CONTROLLER_ID_BIT_MASK

public static final long CONTROLLER_ID_BIT_MASK
Effective controllerIds are on the upper 16 bits of a long (64 bits). Distributed transaction ids (longs) are layed out as [ControllerId(16bits) | LocalTransactionId(64bits)].
This constant used in DistributedVirtualDatabase.

See Also:
Constant Field Values

TRANSACTION_ID_BIT_MASK

public static final long TRANSACTION_ID_BIT_MASK
TRANSACTION_ID_BIT_MASK is used to get the transaction id local to the originating controller

See Also:
Constant Field Values

CONTROLLER_ID_SHIFT_BITS

public static final int CONTROLLER_ID_SHIFT_BITS
See Also:
CONTROLLER_ID_BIT_MASK, Constant Field Values

CONTROLLER_ID_BITS

public static final long CONTROLLER_ID_BITS
See Also:
CONTROLLER_ID_BIT_MASK, Constant Field Values
Constructor Detail

DistributedRequestManager

public DistributedRequestManager(DistributedVirtualDatabase vdb,
                                 AbstractScheduler scheduler,
                                 AbstractResultCache cache,
                                 AbstractLoadBalancer loadBalancer,
                                 RecoveryLog recoveryLog,
                                 long beginTimeout,
                                 long commitTimeout,
                                 long rollbackTimeout)
                          throws java.sql.SQLException,
                                 javax.management.NotCompliantMBeanException
Builds a new DistributedRequestManager instance without cache.

Parameters:
vdb - the virtual database this request manager belongs to
scheduler - the Request Scheduler to use
cache - a Query Cache implementation
loadBalancer - the Request Load Balancer to use
recoveryLog - the Log Recovery to use
beginTimeout - timeout in seconds for begin
commitTimeout - timeout in seconds for commit
rollbackTimeout - timeout in seconds for rollback
Throws:
java.sql.SQLException - if an error occurs
javax.management.NotCompliantMBeanException - if this class is not a compliant JMX MBean
Method Detail

getControllerId

public long getControllerId()
Returns the unique controller identifier.

Returns:
Returns the controllerId.

setControllerId

public void setControllerId(long id)
Sets the controller identifier value (this id must be unique). Parameter id must hold on 16 bits (< 0xffff), otherwise an exception is thrown. Effective this.controllerId is not set to passed parameter id, but to id << ControllerIdShiftBits. The reason for all this is that controllerIds are to be carried into ditributed transactions ids, in the upper 16 bits.

Parameters:
id - The controllerId to set.

getLogger

public Trace getLogger()
Get the trace logger of this DistributedRequestManager

Returns:
a Trace object

getVirtualDatabase

public VirtualDatabase getVirtualDatabase()
Returns the vdb value.

Overrides:
getVirtualDatabase in class RequestManager
Returns:
Returns the vdb.

setScheduler

public void setScheduler(AbstractScheduler scheduler)
Description copied from class: RequestManager
Set the Request Scheduler to use in this Request Controller.

Overrides:
setScheduler in class RequestManager
Parameters:
scheduler - a Request Scheduler implementation
See Also:
RequestManager.setScheduler(org.objectweb.cjdbc.controller.scheduler.AbstractScheduler)

enableBackend

public void enableBackend(DatabaseBackend db)
                   throws java.sql.SQLException
Enable a backend that has been previously added to this virtual database and that is in the disabled state. We check we the other controllers if this backend must be enabled in read-only or read-write. The current policy is that the first one to enable this backend will have read-write access to it and others will be in read-only.

Overrides:
enableBackend in class RequestManager
Parameters:
db - The database backend to enable
Throws:
java.sql.SQLException - if an error occurs

disableBackend

public void disableBackend(DatabaseBackend db)
                    throws java.sql.SQLException
Description copied from class: RequestManager
Disable a backend that is currently enabled on this virtual database.

The backend is disabled without further check.

The load balancer disabled method is called on the specified backend.

Overrides:
disableBackend in class RequestManager
Parameters:
db - The database backend to disable
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.disableBackend(org.objectweb.cjdbc.controller.backend.DatabaseBackend)

disableBackendForCheckpoint

public void disableBackendForCheckpoint(DatabaseBackend db,
                                        java.lang.String checkpointName)
                                 throws java.sql.SQLException
The backend must belong to this virtual database and be in the enabled state.

The backend is disabled once all the pending write queries are executed. A checkpoint is inserted in the recovery log.

Overrides:
disableBackendForCheckpoint in class RequestManager
Parameters:
db - The database backend to enable
checkpointName - The checkpoint name to restart from
Throws:
java.sql.SQLException - if an error occurs

addFailedOnAllBackends

public void addFailedOnAllBackends(AbstractRequest request)
Add a request that failed on all backends.

Parameters:
request - the request that failed
See Also:
completeFailedOnAllBackends(AbstractRequest, boolean)

completeFailedOnAllBackends

public void completeFailedOnAllBackends(AbstractRequest request,
                                        boolean success)
Notify completion of a request that failed on all backends. If completion was successful, all local backends are disabled.

Parameters:
request - request that completed
success - true if completion is successful
See Also:
addFailedOnAllBackends(AbstractRequest)

removeFailedRequestFromRecoveryLog

public void removeFailedRequestFromRecoveryLog(AbstractWriteRequest request,
                                               long recoveryLogId)
Remove a request that was logged because no backend was available locally to execute it but that finally ended up in failing at all other controllers.

Parameters:
request - request that was logged but failed at all controllers
recoveryLogId - request identifier in the recovery log on controller where the request should be unlogged

removeFailedStoredProcedureFromRecoveryLog

public void removeFailedStoredProcedureFromRecoveryLog(StoredProcedure proc)
Remove a stored procedure call that was logged because no backend was available locally to execute it but that finally ended up in failing at all other controllers.

Parameters:
proc - stored procedure that was logged but failed at all controllers

removeFailedCommitFromRecoveryLog

public void removeFailedCommitFromRecoveryLog(TransactionMarkerMetaData tm)
Remove a commit call that was logged because no backend was available locally to execute it but that finally ended up in failing at all other controllers.

Parameters:
tm - the identifier of the transaction that failed to commit

removeFailedRollbackFromRecoveryLog

public void removeFailedRollbackFromRecoveryLog(TransactionMarkerMetaData tm)
Remove a rollback call that was logged because no backend was available locally to execute it but that finally ended up in failing at all other controllers.

Parameters:
tm - the identifier of the transaction that failed to rollback

begin

public long begin(java.lang.String login)
           throws java.sql.SQLException
Description copied from class: RequestManager
Begin a new transaction and return the corresponding transaction identifier. This method is called from the driver when setAutoCommit(false) is called.

Note that the transaction begin is not logged in the recovery log by this method, you will have to call logLazyTransactionBegin.

Overrides:
begin in class RequestManager
Parameters:
login - the login used by the connection
Returns:
int a unique transaction identifier
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.begin(java.lang.String)

lazyTransactionStart

public void lazyTransactionStart(AbstractRequest request)
                          throws java.sql.SQLException
Check if the transaction corresponding to the given query has been started remotely and start the transaction locally in a lazy manner if needed.

Parameters:
request - query to execute
Throws:
java.sql.SQLException - if an error occurs

commit

public void commit(long transactionId,
                   boolean logCommit)
            throws java.sql.SQLException
Description copied from class: RequestManager
Commit a transaction given its id.

Overrides:
commit in class RequestManager
Parameters:
transactionId - the transaction id
logCommit - true if the commit should be logged in the recovery log
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.commit(long, boolean)

rollback

public void rollback(long transactionId,
                     boolean logRollback)
              throws java.sql.SQLException
Description copied from class: RequestManager
Rollback a transaction given its id.

Overrides:
rollback in class RequestManager
Parameters:
transactionId - the transaction id
logRollback - true if the rollback should be logged in the recovery log
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.rollback(long, boolean)

rollback

public void rollback(long transactionId,
                     java.lang.String savepointName)
              throws java.sql.SQLException
Description copied from class: RequestManager
Rollback a transaction given its id to a savepoint given its name.

Overrides:
rollback in class RequestManager
Parameters:
transactionId - the transaction id
savepointName - the name of the savepoint
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.rollback(long, String)

setSavepoint

public int setSavepoint(long transactionId)
                 throws java.sql.SQLException
Description copied from class: RequestManager
Sets a unnamed savepoint to a transaction given its id.

Overrides:
setSavepoint in class RequestManager
Parameters:
transactionId - the transaction id
Returns:
the generated id of the new savepoint
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.setSavepoint(long)

setSavepoint

public void setSavepoint(long transactionId,
                         java.lang.String name)
                  throws java.sql.SQLException
Description copied from class: RequestManager
Sets a savepoint given its desired name to a transaction given its id.

Overrides:
setSavepoint in class RequestManager
Parameters:
transactionId - the transaction id
name - the desired name of the savepoint
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.setSavepoint(long, String)

releaseSavepoint

public void releaseSavepoint(long transactionId,
                             java.lang.String name)
                      throws java.sql.SQLException
Description copied from class: RequestManager
Releases a savepoint given its name from a transaction given its id.

Overrides:
releaseSavepoint in class RequestManager
Parameters:
transactionId - the transaction id
name - the name of the savepoint
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.releaseSavepoint(long, String)

scheduleExecWriteRequest

public void scheduleExecWriteRequest(AbstractWriteRequest request)
                              throws java.sql.SQLException
Description copied from class: RequestManager
Schedule a request for execution.

Overrides:
scheduleExecWriteRequest in class RequestManager
Parameters:
request - the request to execute
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.scheduleExecWriteRequest(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)

execReadRequest

public ControllerResultSet execReadRequest(SelectRequest request)
                                    throws java.sql.SQLException
Description copied from class: RequestManager
Perform a read request and return the reply. Call first the scheduler, then the cache (if defined) and finally the load balancer.

Overrides:
execReadRequest in class RequestManager
Parameters:
request - the request to execute
Returns:
a ControllerResultSet value
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.execReadRequest(org.objectweb.cjdbc.common.sql.SelectRequest)

execRemoteReadRequest

public abstract ControllerResultSet execRemoteReadRequest(SelectRequest request)
                                                   throws java.sql.SQLException
Execute a read request on some remote controller - one in the group. Used when the local controller has no backend available to execute the request.

Parameters:
request - the request to execute
Returns:
the query ResultSet
Throws:
java.sql.SQLException - in case of bad request

execWriteRequest

public int execWriteRequest(AbstractWriteRequest request)
                     throws java.sql.SQLException
Description copied from class: RequestManager
Perform a write request and return the number of rows affected Call first the scheduler (if defined), then notify the cache (if defined) and finally call the load balancer.

Overrides:
execWriteRequest in class RequestManager
Parameters:
request - the request to execute
Returns:
number of rows affected
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.execWriteRequest(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)

execWriteRequestWithKeys

public ControllerResultSet execWriteRequestWithKeys(AbstractWriteRequest request)
                                             throws java.sql.SQLException
Description copied from class: RequestManager
Perform a write request and return the auto generated keys. Call first the scheduler (if defined), then notify the cache (if defined) and finally call the load balancer.

Overrides:
execWriteRequestWithKeys in class RequestManager
Parameters:
request - the request to execute
Returns:
auto generated keys.
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.execWriteRequestWithKeys(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)

execReadStoredProcedure

public ControllerResultSet execReadStoredProcedure(StoredProcedure proc)
                                            throws java.sql.SQLException
Description copied from class: RequestManager
Call a stored procedure that returns a ResultSet.

Overrides:
execReadStoredProcedure in class RequestManager
Parameters:
proc - the stored procedure call
Returns:
a ControllerResultSet value
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.execReadStoredProcedure(StoredProcedure)

execWriteStoredProcedure

public int execWriteStoredProcedure(StoredProcedure proc)
                             throws java.sql.SQLException
Description copied from class: RequestManager
Call a stored procedure that performs an update.

Overrides:
execWriteStoredProcedure in class RequestManager
Parameters:
proc - the stored procedure call
Returns:
number of rows affected
Throws:
java.sql.SQLException - if an error occurs
See Also:
RequestManager.execWriteStoredProcedure(org.objectweb.cjdbc.common.sql.StoredProcedure)

distributedCommit

public abstract void distributedCommit(java.lang.String login,
                                       long transactionId)
                                throws java.sql.SQLException
Distributed implementation of a commit

Parameters:
login - login that commit the transaction
transactionId - id of the commiting transaction
Throws:
java.sql.SQLException - if an error occurs

distributedRollback

public abstract void distributedRollback(java.lang.String login,
                                         long transactionId)
                                  throws java.sql.SQLException
Distributed implementation of a rollback

Parameters:
login - login that rollback the transaction
transactionId - id of the rollbacking transaction
Throws:
java.sql.SQLException - if an error occurs

distributedRollback

public abstract void distributedRollback(long transactionId,
                                         java.lang.String savepointName)
                                  throws java.sql.SQLException
Distributed implementation of a rollback to a savepoint

Parameters:
transactionId - id of the transaction
savepointName - name of the savepoint
Throws:
java.sql.SQLException - if an error occurs

distributedSetSavepoint

public abstract void distributedSetSavepoint(long transactionId,
                                             java.lang.String name)
                                      throws java.sql.SQLException
Distributed implementation of setting a savepoint to a transaction

Parameters:
transactionId - id of the transaction
name - name of the savepoint to set
Throws:
java.sql.SQLException - if an error occurs

distributedReleaseSavepoint

public abstract void distributedReleaseSavepoint(long transactionId,
                                                 java.lang.String name)
                                          throws java.sql.SQLException
Distributed implementation of releasing a savepoint from a transaction

Parameters:
transactionId - id of the transaction
name - name of the savepoint to release
Throws:
java.sql.SQLException - if an error occurs

execDistributedWriteRequest

public abstract int execDistributedWriteRequest(AbstractWriteRequest request)
                                         throws java.sql.SQLException
Distributed implementation of a write request execution.

Parameters:
request - request to execute
Returns:
number of modified rows
Throws:
java.sql.SQLException - if an error occurs

execDistributedWriteRequestWithKeys

public abstract ControllerResultSet execDistributedWriteRequestWithKeys(AbstractWriteRequest request)
                                                                 throws java.sql.SQLException
Distributed implementation of a write request execution that returns auto-generated keys.

Parameters:
request - request to execute
Returns:
ResultSet containing the auto-generated keys.
Throws:
java.sql.SQLException - if an error occurs

execDistributedReadStoredProcedure

public abstract ControllerResultSet execDistributedReadStoredProcedure(StoredProcedure proc)
                                                                throws java.sql.SQLException
Distributed implementation of a read stored procedure execution.

Parameters:
proc - stored procedure to execute
Returns:
ResultSet corresponding to this stored procedure execution
Throws:
java.sql.SQLException - if an error occurs

execDistributedWriteStoredProcedure

public abstract int execDistributedWriteStoredProcedure(StoredProcedure proc)
                                                 throws java.sql.SQLException
Distributed implementation of a write stored procedure execution.

Parameters:
proc - stored procedure to execute
Returns:
number of modified rows
Throws:
java.sql.SQLException - if an error occurs

execReadStoredProcedureLocally

public ControllerResultSet execReadStoredProcedureLocally(StoredProcedure proc)
                                                   throws AllBackendsFailedException,
                                                          java.sql.SQLException
Once the request has been dispatched, it can be executed using the code from RequestManager

Parameters:
proc - stored procedure to execute
Returns:
ResultSet corresponding to this stored procedure execution
Throws:
AllBackendsFailedException - if all backends failed to execute the stored procedure
java.sql.SQLException - if an error occurs

execDistributedWriteStoredProcedureLocally

public int execDistributedWriteStoredProcedureLocally(StoredProcedure proc)
                                               throws AllBackendsFailedException,
                                                      java.sql.SQLException
Once the request has been dispatched, it can be executed using the code from RequestManager

Parameters:
proc - stored procedure to execute
Returns:
number of modified rows
Throws:
AllBackendsFailedException - if all backends failed to execute the stored procedure
java.sql.SQLException - if an error occurs

execLocalReadRequest

public ControllerResultSet execLocalReadRequest(SelectRequest request)
                                         throws NoMoreBackendException,
                                                java.sql.SQLException
Performs a local read operation, as opposed to execReadRequest() which attempts to use distributed reads when there is NoMoreBackendException.

Parameters:
request - the read request to perform
Returns:
a ControllerResultSet
Throws:
NoMoreBackendException - when no more local backends are available to execute the request
java.sql.SQLException - in case of error


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.