|
DODS 7.6 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.appserver.server.sql.standard.StandardDBTransaction
public class StandardDBTransaction
Standard implementation of SQL database transaction.
DBTransaction
Nested Class Summary | |
---|---|
protected class |
StandardDBTransaction.DOAction
|
Field Summary | |
---|---|
protected boolean |
_preventCacheQueries
|
protected boolean |
aggregateModifications
|
protected DOCache |
cache
|
protected int |
CACHE_SIZE
|
protected int |
COMPLEX_QUERY_CACHE_SIZE
|
protected DBConnection |
conn
|
protected java.lang.String |
databaseName
Name of used database |
protected int |
dbLockCounter
|
protected static int |
DELETE
|
protected java.util.Vector |
deletedRefs
|
protected boolean |
firstWrite
|
protected java.util.HashMap |
hmpObjectTransaction
|
protected int |
id
|
protected static int |
INSERT
|
protected boolean |
isAutoWrite
|
protected boolean |
isTransactionCaches
|
protected static int |
nextId
|
protected static int |
NONE
|
protected boolean |
released
|
protected int |
SIMPLE_QUERY_CACHE_SIZE
|
protected int |
SIZE_DELTA
|
protected boolean |
sqlBatch
|
protected Transaction[] |
trans
|
protected int[] |
transAction
|
protected int |
transIdx
|
protected static int |
UPDATE
|
protected java.util.Vector |
vecAlreadyHidden
|
protected java.util.Vector |
vecExecutedTransaction
|
protected java.util.Vector |
vecSortedTransaction
|
Constructor Summary | |
---|---|
protected |
StandardDBTransaction()
This constructor is only for use in inherited class. |
protected |
StandardDBTransaction(DBConnection conn)
Construct a transaction object for use on the supplied dB connection. |
Method Summary | |
---|---|
void |
addDeletedDO(CoreDO DO)
|
java.util.List |
checkChanged(java.lang.String tableName,
QueryCacheItem queryItem,
Transaction[] array)
|
void |
commit()
Method to commit upates. |
DBQuery |
createQuery()
Return a query for use with this TRANSACTION please!!! |
void |
delete(Transaction transaction)
Method to delete an object in the database. |
void |
dontAggregateDOModifications()
|
protected void |
finalize()
If this object has not been released, this method ensures that garbage collection does so. |
boolean |
getAutoWrite()
Method returns value of a data member. |
java.lang.String |
getDatabaseName()
Method return name of used database |
java.util.Vector |
getDeletedDOs()
|
Transaction |
getDO(Transaction transaction)
|
Transaction |
getDO(Transaction transaction,
int action)
Method find a DO in the transaction |
CoreDO[] |
getDOs()
Gets an array of DOs. |
DOCache |
getTransactionCache()
Method return transaction Cache |
boolean |
handleException(java.sql.SQLException e)
Exception handeler. |
boolean |
hideCacheEntries()
|
void |
insert(Transaction transaction)
Method to insert an object in the database. |
boolean |
isFirstWrite()
|
boolean |
isHolding()
|
boolean |
isReleased()
Method to ensure this object is still valid. |
boolean |
isSQLbatch()
|
boolean |
isTableModified(java.lang.String tableName)
Returns indicator whether the table defined with tableName parameter was changed in the transaction (if there were any inserts and/or deletes and/or updates). |
void |
lockDO(Transaction cdo)
|
protected void |
logDebug(java.lang.String str)
Logging. |
boolean |
preventCacheQueries()
|
protected void |
readConfigValues()
|
void |
release()
Frees all resources consumed by this transaction Connections are returned to the connection pool. |
void |
resetDeletedDOs()
|
void |
revealCacheEntries()
|
void |
rollback()
Method to rollback changes. |
void |
saveDirtyDOs()
|
void |
setDatabaseName(java.lang.String dbName)
Method set name of used database |
void |
setFirstWrite(boolean newfw)
|
void |
update(Transaction transaction)
Method to update an object in the database. |
protected void |
validate()
Method to ensure this object is still valid. |
boolean |
wasReadOnly()
Although it's internally used to skip uneccessary commits against the database, this information is made publicly accessible through this method. |
void |
write()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int id
protected static int nextId
protected DBConnection conn
protected boolean released
protected boolean _preventCacheQueries
protected java.util.Vector vecAlreadyHidden
protected java.util.Vector vecExecutedTransaction
protected java.util.Vector vecSortedTransaction
protected java.util.HashMap hmpObjectTransaction
protected Transaction[] trans
protected int[] transAction
protected int transIdx
protected int dbLockCounter
protected final int SIZE_DELTA
protected final int CACHE_SIZE
protected final int COMPLEX_QUERY_CACHE_SIZE
protected final int SIMPLE_QUERY_CACHE_SIZE
protected DOCache cache
protected java.util.Vector deletedRefs
protected static final int INSERT
protected static final int UPDATE
protected static final int DELETE
protected boolean isTransactionCaches
protected boolean isAutoWrite
protected boolean sqlBatch
protected boolean firstWrite
protected static final int NONE
protected java.lang.String databaseName
protected boolean aggregateModifications
Constructor Detail |
---|
protected StandardDBTransaction(DBConnection conn) throws java.sql.SQLException
conn
- The database connection to use.
java.sql.SQLException
- If a database access error
occurs.protected StandardDBTransaction()
Method Detail |
---|
public Transaction getDO(Transaction transaction)
getDO
in interface DBTransaction
public Transaction getDO(Transaction transaction, int action)
getDO
in interface DBTransaction
transaction
- Object that implements transaction interface.action
- if not NONE=0, the DO is found only woth the
matching action
public void update(Transaction transaction)
update
in interface DBTransaction
transaction
- Object that implements transaction interface.public void delete(Transaction transaction)
delete
in interface DBTransaction
transaction
- Object that implements transaction interface.public void insert(Transaction transaction)
insert
in interface DBTransaction
transaction
- Object that implements transaction interface.public void commit() throws java.sql.SQLException
Contains WebDocWf bug fix, transaction needs to be cleared
commit
in interface DBTransaction
java.sql.SQLException
- If a database access error
occurs.
DBRowUpdateException
- If a version error occurs.public boolean hideCacheEntries() throws java.sql.SQLException
java.sql.SQLException
public void revealCacheEntries()
public void rollback() throws java.sql.SQLException
Contains WebDocWf bug fix, transaction needs to be cleared
rollback
in interface DBTransaction
java.sql.SQLException
- If a database access error
occurs.public void release()
release
in interface DBTransaction
public boolean handleException(java.sql.SQLException e)
handleException
in interface DBTransaction
protected void validate() throws java.sql.SQLException
java.sql.SQLException
- If a database access error
occurs.public boolean isReleased()
isReleased
in interface CachedDBTransaction
protected void finalize()
finalize
in class java.lang.Object
protected void logDebug(java.lang.String str)
str
- The data to log.public java.lang.String getDatabaseName()
getDatabaseName
in interface DBTransaction
public void setDatabaseName(java.lang.String dbName)
setDatabaseName
in interface DBTransaction
dbName
- name of used databasepublic CoreDO[] getDOs()
getDOs
in interface CachedDBTransaction
public void saveDirtyDOs()
saveDirtyDOs
in interface CachedDBTransaction
public void write() throws java.sql.SQLException
write
in interface DBTransaction
java.sql.SQLException
- If a database access error
occurs.
DBRowUpdateException
- If a version error occurs.public DOCache getTransactionCache()
getTransactionCache
in interface CachedDBTransaction
public java.util.Vector getDeletedDOs()
getDeletedDOs
in interface CachedDBTransaction
public void addDeletedDO(CoreDO DO)
addDeletedDO
in interface CachedDBTransaction
public void resetDeletedDOs()
resetDeletedDOs
in interface CachedDBTransaction
public void lockDO(Transaction cdo) throws java.sql.SQLException
lockDO
in interface DBTransaction
java.sql.SQLException
public boolean preventCacheQueries()
preventCacheQueries
in interface DBTransaction
public DBQuery createQuery() throws java.sql.SQLException
createQuery
in interface DBTransaction
java.sql.SQLException
- if a SQL error occurs.public void dontAggregateDOModifications()
dontAggregateDOModifications
in interface CachedDBTransaction
protected void readConfigValues()
public boolean getAutoWrite()
getAutoWrite
in interface CachedDBTransaction
public boolean isSQLbatch()
public boolean isFirstWrite()
isFirstWrite
in interface CachedDBTransaction
public void setFirstWrite(boolean newfw)
setFirstWrite
in interface CachedDBTransaction
public boolean wasReadOnly()
CachedDBTransaction
wasReadOnly
in interface CachedDBTransaction
public boolean isHolding()
isHolding
in interface CachedDBTransaction
public java.util.List checkChanged(java.lang.String tableName, QueryCacheItem queryItem, Transaction[] array)
checkChanged
in interface CachedDBTransaction
public boolean isTableModified(java.lang.String tableName)
isTableModified
in interface CachedDBTransaction
|
DODS 7.6 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |