public class DbTransaction extends StoreTransaction
Modifier and Type | Method and Description |
---|---|
void |
addAddInode(Inode inode)
Adds inode which should be deleted on a rollback.
|
void |
addDeleteInode(Inode inode)
Adds inode which should be deleted on a commit.
|
void |
addUpdateBlock(Block block)
Adds a block for update.
|
Block |
allocateRow(BlockStore store)
Returns a modified block.
|
void |
autoCommit() |
void |
autoCommitRead(DatabaseLock lock)
If auto-commit, commit the read
|
void |
autoCommitWrite(DatabaseLock lock)
If auto-commit, commit the write
|
void |
commit() |
static DbTransaction |
create() |
static DbTransaction |
create(ConnectionImpl conn) |
void |
deallocateBlock(Block block)
Returns a modified block.
|
long |
getTimeout() |
boolean |
hasReadLock(DatabaseLock lock)
Acquires a new read lock.
|
boolean |
isAutoCommit()
Returns true for an auto-commit transaction.
|
Block |
loadBlock(BlockStore store,
long blockAddress)
Returns a read block.
|
void |
lockRead(DatabaseLock lock)
Acquires a new write lock.
|
void |
lockReadAndWrite(DatabaseLock lock)
Acquires a new write lock.
|
boolean |
lockReadAndWriteNoWait(DatabaseLock lock)
Conditionally a new write lock, if no contention exists.
|
Block |
readBlock(BlockStore store,
long blockAddress)
Returns a read block.
|
void |
rollback() |
void |
setAutoCommit(boolean autoCommit)
Returns true for an auto-commit transaction.
|
void |
setRollbackOnly() |
void |
setRollbackOnly(java.sql.SQLException e) |
void |
setTimeout(long timeout)
Sets the transaction timeout.
|
void |
unlockRead(DatabaseLock lock) |
void |
unlockReadAndWrite(DatabaseLock lock) |
void |
writeData() |
addUpdateFragmentBlock
public static DbTransaction create(ConnectionImpl conn)
public static DbTransaction create()
public void setTimeout(long timeout)
public long getTimeout()
public boolean hasReadLock(DatabaseLock lock)
public boolean isAutoCommit()
public void setAutoCommit(boolean autoCommit)
public void lockRead(DatabaseLock lock) throws java.sql.SQLException
java.sql.SQLException
public void lockReadAndWrite(DatabaseLock lock) throws java.sql.SQLException
java.sql.SQLException
public boolean lockReadAndWriteNoWait(DatabaseLock lock) throws java.sql.SQLException
java.sql.SQLException
public void addUpdateBlock(Block block)
addUpdateBlock
in class StoreTransaction
public void autoCommitRead(DatabaseLock lock) throws java.sql.SQLException
java.sql.SQLException
public void unlockRead(DatabaseLock lock) throws java.sql.SQLException
java.sql.SQLException
public void autoCommitWrite(DatabaseLock lock) throws java.sql.SQLException
java.sql.SQLException
public void unlockReadAndWrite(DatabaseLock lock) throws java.sql.SQLException
java.sql.SQLException
public Block readBlock(BlockStore store, long blockAddress) throws java.io.IOException
readBlock
in class StoreTransaction
java.io.IOException
public Block loadBlock(BlockStore store, long blockAddress) throws java.io.IOException
java.io.IOException
public Block allocateRow(BlockStore store) throws java.io.IOException
java.io.IOException
public void deallocateBlock(Block block) throws java.io.IOException
java.io.IOException
public void addDeleteInode(Inode inode)
public void addAddInode(Inode inode)
public void autoCommit() throws java.sql.SQLException
java.sql.SQLException
public void setRollbackOnly(java.sql.SQLException e)
public void setRollbackOnly()
public void commit() throws java.sql.SQLException
java.sql.SQLException
public void writeData() throws java.sql.SQLException
java.sql.SQLException
public void rollback() throws java.sql.SQLException
java.sql.SQLException