org.neodatis.odb.core.transaction
Interface ITransaction

All Known Implementing Classes:
DefaultTransaction

public interface ITransaction


Method Summary
 void clear()
          clear the transaction
 void commit()
          Execute the commit process of the transaction
 java.lang.String getName()
           
 int getNumberOfWriteActions()
           
 boolean isArchiveLog()
           
 boolean isCommited()
           
 void manageWriteAction(long position, byte[] bytes)
          The public method to add a write action to the transaction.
 void reset()
          Reset the transaction
 void rollback()
           
 void setArchiveLog(boolean archiveLog)
           
 void setFsiToApplyWriteActions(IFileSystemInterface fsi)
           
 void setWritePosition(long position)
          Set the write position (position in main database file).
 

Method Detail

clear

void clear()
clear the transaction


getName

java.lang.String getName()

isCommited

boolean isCommited()

rollback

void rollback()

commit

void commit()
Execute the commit process of the transaction

Throws:
java.lang.Exception

setFsiToApplyWriteActions

void setFsiToApplyWriteActions(IFileSystemInterface fsi)

isArchiveLog

boolean isArchiveLog()
Returns:
Returns the archiveLog.

setArchiveLog

void setArchiveLog(boolean archiveLog)
Parameters:
archiveLog - The archiveLog to set.

manageWriteAction

void manageWriteAction(long position,
                       byte[] bytes)
The public method to add a write action to the transaction. If first checks if the new write action action can be appended to the current write action. It is done by checking the currentWritePositioninWA. If yes (position==currentPositioninWA, just append the WA. If not, adds the current one to the transaction and creates a new one (as current)

Parameters:
position -
bytes -

getNumberOfWriteActions

int getNumberOfWriteActions()
Returns:
Returns the numberOfWriteActions.

setWritePosition

void setWritePosition(long position)
Set the write position (position in main database file). This is used to know if the next write can be appended to the previous one (in the same current Write Action) or not.

Parameters:
position -

reset

void reset()
Reset the transaction