|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.cjdbc.controller.scheduler.AbstractScheduler
org.objectweb.cjdbc.controller.scheduler.raidb2.RAIDb2PessimisticTransactionLevelScheduler
This scheduler provides transaction level scheduling for RAIDb-2 controllers. Each write takes a lock on the whole database. All following writes are blocked until the transaction of the first write completes.
Field Summary | |
private TransactionExclusiveLock |
lock
|
private long |
requestId
|
Fields inherited from class org.objectweb.cjdbc.controller.scheduler.AbstractScheduler |
logger, parsingGranularity, raidbLevel |
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent |
DOCTYPE_DB, XML_VERSION |
Constructor Summary | |
RAIDb2PessimisticTransactionLevelScheduler()
Creates a new Pessimistic Transaction Level Scheduler |
Method Summary | |
protected void |
commitTransaction(long transactionId)
Commit a transaction given its id. |
java.lang.String |
getXmlImpl()
|
void |
notifyWriteCompleted(AbstractWriteRequest request)
Notify the completion of a write statement. |
void |
readCompletedNotify(SelectRequest request)
Notify the completion of a read statement. |
private void |
releaseLock(long transactionId)
Release the locks we may own on the schema. |
protected void |
rollbackTransaction(long transactionId)
Rollback a transaction given its id. |
void |
scheduleNonSuspendedWriteRequest(AbstractWriteRequest request)
Note that CREATE statements are not synchronized. |
void |
scheduleReadRequest(SelectRequest request)
Additionally to scheduling the request, this method replaces the SQL Date macros such as now() with the current date. |
Methods inherited from class org.objectweb.cjdbc.controller.scheduler.AbstractScheduler |
begin, beginCompleted, commit, commitCompleted, getNumberRead, getNumberWrite, getParsingGranularity, getPendingTransactions, getPendingWrites, getRAIDbLevel, getSchedulerData, getXml, hasSQLMacros, initializeTransactionId, isSuspendedTransactions, isSuspendedWrites, mergeDatabaseSchema, readCompleted, resumeNewTransactions, resumeWrites, rollback, rollbackCompleted, scheduleWriteRequest, setDatabaseSchema, setParsingGranularity, setRAIDbLevel, suspendNewTransactionsForCheckpoint, suspendWrites, writeCompleted |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private long requestId
private TransactionExclusiveLock lock
Constructor Detail |
public RAIDb2PessimisticTransactionLevelScheduler()
Method Detail |
public final void scheduleReadRequest(SelectRequest request) throws java.sql.SQLException
scheduleReadRequest
in class AbstractScheduler
request
- Select request to schedule (SQL macros are already handled
if needed)
java.sql.SQLException
- if a timeout occursAbstractScheduler.scheduleReadRequest(SelectRequest)
public final void readCompletedNotify(SelectRequest request)
AbstractScheduler
readCompletedNotify
in class AbstractScheduler
request
- the completed requestAbstractScheduler.readCompletedNotify(SelectRequest)
public void scheduleNonSuspendedWriteRequest(AbstractWriteRequest request) throws java.sql.SQLException
scheduleNonSuspendedWriteRequest
in class AbstractScheduler
request
- Write request to schedule (SQL macros are already handled if
needed)
java.sql.SQLException
- if a timeout occursAbstractScheduler.scheduleWriteRequest(AbstractWriteRequest)
public final void notifyWriteCompleted(AbstractWriteRequest request)
AbstractScheduler
notifyWriteCompleted
in class AbstractScheduler
request
- the completed requestAbstractScheduler.notifyWriteCompleted(AbstractWriteRequest)
protected final void commitTransaction(long transactionId)
AbstractScheduler
commitTransaction
in class AbstractScheduler
transactionId
- the transaction idAbstractScheduler.commitTransaction(long)
protected final void rollbackTransaction(long transactionId)
AbstractScheduler
rollbackTransaction
in class AbstractScheduler
transactionId
- the transaction idAbstractScheduler.rollbackTransaction(long)
private void releaseLock(long transactionId)
transactionId
- id of the transaction that releases the lockpublic java.lang.String getXmlImpl()
getXmlImpl
in class AbstractScheduler
AbstractScheduler.getXmlImpl()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |