|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.dyade.aaa.util.AbstractTransaction
fr.dyade.aaa.util.DBTransaction
public abstract class DBTransaction
The DBTransaction class implements a transactionnal storage through a JDBC interface. This class is designed to be specialized for different database implementation.
Be Careful, the configuration properties don't work for the transaction component: these properties are saved in the transaction repository so they can not be used to configure it.
Transaction
,
MySQLDBTransaction
,
DerbyDBTransaction
Nested Class Summary |
---|
Nested classes/interfaces inherited from class fr.dyade.aaa.util.AbstractTransaction |
---|
AbstractTransaction.Context |
Field Summary | |
---|---|
protected java.sql.Connection |
conn
|
Fields inherited from class fr.dyade.aaa.util.AbstractTransaction |
---|
dir, logmon, OOS_STREAM_HEADER, perThreadContext, phase, startTime |
Fields inherited from interface fr.dyade.aaa.util.Transaction |
---|
COMMIT, FINALIZE, FREE, GARBAGE, INIT, Kb, Mb, PhaseInfo, ROLLBACK, RUN |
Constructor Summary | |
---|---|
DBTransaction()
|
Method Summary | |
---|---|
void |
close()
Close the transaction module. |
void |
commit(boolean release)
Commit the current transaction. |
void |
delete(java.lang.String dirName,
java.lang.String name)
Deletes the specified object. |
java.lang.String[] |
getList(java.lang.String prefix)
Returns an array of strings naming the persistent objects denoted by a name that satisfy the specified prefix. |
int |
getLogThresholdOperation()
Returns the pool size for operation objects, by default 1000. |
java.lang.String |
getPersistenceDir()
Returns the path of persistence directory. |
protected abstract void |
initDB()
Instantiates the database driver and creates the table if necessary |
void |
initRepository()
|
boolean |
isPersistent()
Tests if the Transaction component is persistent. |
byte[] |
loadByteArray(java.lang.String dirName,
java.lang.String name)
Load the specified byte array. |
protected void |
saveInLog(byte[] buf,
java.lang.String dirName,
java.lang.String name,
java.util.Hashtable log,
boolean copy,
boolean first)
Register the specified object in transaction log. |
protected void |
setPhase(int newPhase)
Changes the transaction state. |
void |
stop()
Stops the transaction module. |
Methods inherited from class fr.dyade.aaa.util.AbstractTransaction |
---|
begin, create, create, createByteArray, createByteArray, delete, getPhase, getPhaseInfo, getStartTime, init, load, load, loadByteArray, release, save, save, save, saveByteArray, saveByteArray, saveByteArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fr.dyade.aaa.util.DBTransactionMBean |
---|
getPhase, getPhaseInfo |
Methods inherited from interface fr.dyade.aaa.util.TransactionMBean |
---|
getStartTime |
Field Detail |
---|
protected java.sql.Connection conn
Constructor Detail |
---|
public DBTransaction()
Method Detail |
---|
public int getLogThresholdOperation()
operation
objects, by default 1000.
getLogThresholdOperation
in interface DBTransactionMBean
operation
objects.public void initRepository() throws java.io.IOException
initRepository
in class AbstractTransaction
java.io.IOException
protected abstract void initDB() throws java.io.IOException
java.io.IOException
public java.lang.String getPersistenceDir()
protected final void setPhase(int newPhase)
AbstractTransaction
setPhase
in class AbstractTransaction
newPhase
- the new transaction state.public final java.lang.String[] getList(java.lang.String prefix)
getList
in interface Transaction
prefix
- the prefix
public boolean isPersistent()
isPersistent
in interface Transaction
isPersistent
in interface TransactionMBean
protected final void saveInLog(byte[] buf, java.lang.String dirName, java.lang.String name, java.util.Hashtable log, boolean copy, boolean first) throws java.io.IOException
AbstractTransaction
saveInLog
in class AbstractTransaction
buf
- the byte array containing the state of the object.dirName
- the directory name of the object.name
- the name of the object.log
- the log to use.copy
- the byte array can be modified, copy it.first
- the object is a new one.
java.io.IOException
public byte[] loadByteArray(java.lang.String dirName, java.lang.String name) throws java.io.IOException
Transaction
loadByteArray
in interface Transaction
dirName
- the directory name of the object.name
- the name of the object.
java.io.IOException
public void delete(java.lang.String dirName, java.lang.String name)
Transaction
delete
in interface Transaction
dirName
- the directory name of the object.name
- the name of the object.public final void commit(boolean release) throws java.io.IOException
Transaction
commit
in interface Transaction
release
- if true releases the transaction at the end of the commit.
java.io.IOException
public void stop()
stop
in interface Transaction
public void close()
close
in interface Transaction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |