org.apache.derby.iapi.store.raw
Interface RawStoreFactory

All Superinterfaces:
Corruptable
All Known Implementing Classes:
RawStore

public interface RawStoreFactory
extends Corruptable

RawStoreFactory implements a single unit of transactional storage. A RawStoreFactory contains Segments and Segments contain Containers.

Segments are identified by integer identifiers that are unique within a RawStoreFactory.

Containers are also identified by unique integer identifiers within a RawStoreFactory, but will overlap with segment identifiers.

LIMITS
This is a list of (hopefully) all limits within the raw store. Where a size has more than one limit all are documented (rather than just the most restrictive) so that the correct limit can be found if the most restictive is every removed.

Access and RawStore work together to provide the ACID properties of transactions. On a high level, RawStore deals with anything that directly impacts persistency. On a more detailed level, RawStore provides logging, rollback and recovery, data management on page, page allocation and deallocation, container allocation and deallocation.

RawStore is organized as 3 branches, transaction, data, and logging. These branches each have its own "factory", the transaction factory hands out transactions, the data factory hands out containers, and the log factory hands out logger (or log buffers) for transactions to write on. For a more detailed description on these factories, please see their corresponding javadocs. MT - Thread Safe

See Also:
ContainerHandle

Field Summary
static java.lang.String CONTAINER_INITIAL_PAGES
          Property name for container which attempts to be created with an initial size of this many pages.
static java.lang.String DATA_ENCRYPT_ALGORITHM_VERSION
          This variable is used to store the encryption scheme to allow for any future changes in encryption schemes of data This property has been introduced in version 10 Value starts at 1
static int DEFAULT_ENCRYPTION_BLOCKSIZE
          default encryption block size In old existing databases (ie 5.1.x), the default encryption block size used is 8.
static int DERBY_STORE_MAJOR_VERSION_10
          Derby 10 Store Major version
static int DERBY_STORE_MINOR_VERSION_1
          Derby Store Minor Version (1)
static java.lang.String ENCRYPTED_KEY
          If dataEncryption is true, store the encrypted key in services.properties file.
static int ENCRYPTION_ALIGNMENT
          encryption alignment requirement.
static java.lang.String ENCRYPTION_BLOCKSIZE
          encryption block size used during creation of encrypted database This property is not set by the user; it is set by the engine when RawStore boots up during creation of an encrypted database
static java.lang.String KEEP_TRANSACTION_LOG
          for debugging, keep all transaction logs intact.
static java.lang.String LOG_ENCRYPT_ALGORITHM_VERSION
          Store the encryption scheme used for logging This will allow for any future changes in encryption schemes of logs This variable has been introduced in version 10 and value starts at 1.
static short MAX_CONTAINER_INITIAL_PAGES
          Maximum number of initial pages when a container is created
static int MINIMUM_RECORD_SIZE_DEFAULT
          Default value for MINIMUM_RECORD_SIZE_PARAMETER for heap tables that allow overflow.
static int MINIMUM_RECORD_SIZE_MINIMUM
          Minimum value for MINIMUM_RECORD_SIZE_PARAMETER (1).
static java.lang.String MINIMUM_RECORD_SIZE_PARAMETER
          Property name for the default minimum record size to be used in the storage area.
static java.lang.String MODULE
          module name
static int PAGE_CACHE_SIZE_DEFAULT
          Default value for PAGE_CACHE_SIZE_PARAMETER (1000).
static int PAGE_CACHE_SIZE_MAXIMUM
          Maximum page cache size we will accept (MAXINT).
static int PAGE_CACHE_SIZE_MINIMUM
          Minimum page cache size we will accept (40).
static java.lang.String PAGE_CACHE_SIZE_PARAMETER
          Property name for the page cache size to be used in the storage area.
static java.lang.String PAGE_RESERVED_SPACE_PARAMETER
          Property name for percentage of space to leave free on page for updates.
static java.lang.String PAGE_RESERVED_ZERO_SPACE_STRING
           
static java.lang.String PAGE_REUSABLE_RECORD_ID
          Property name for container which reuses recordId when a page is reused.
static int PAGE_SIZE_DEFAULT
          Default value for PAGE_SIZE_PARAMETER (4096).
static int PAGE_SIZE_MINIMUM
          Minimum page size we will accept (1024).
static java.lang.String PAGE_SIZE_STRING
           
static java.lang.String PATCH_INITPAGE_RECOVER_ERROR
          The following is a to enable patch for databases with recovery errors during redo of InitPage.
static java.lang.String PRE_ALLOCATE_PAGE
          Property name for the number of pages we try to pre-allocate in one /** synchronous I/O
static int STREAM_FILE_BUFFER_SIZE_DEFAULT
          Default value for STREAM_FILE_BUFFER_SIZE_PARAMETER (16384).
static int STREAM_FILE_BUFFER_SIZE_MAXIMUM
          Maximum stream file buffer size we will accept (MAXINT).
static int STREAM_FILE_BUFFER_SIZE_MINIMUM
          Minimum stream file buffer size we will accept (1024).
static java.lang.String STREAM_FILE_BUFFER_SIZE_PARAMETER
          Property name for buffer size to be used in the stream file container.
 
Method Summary
 void backup(java.io.File backupDir)
          Backup the database to backupDir.
 void backup(java.lang.String backupDir)
          Backup the database to backupDir.
 void backupAndEnableLogArchiveMode(java.io.File backupDir, boolean deleteOnlineArchivedLogFiles)
          Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup.
 void backupAndEnableLogArchiveMode(java.lang.String backupDir, boolean deleteOnlineArchivedLogFiles)
          Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup.
 java.io.Serializable changeBootPassword(java.util.Properties properties, java.io.Serializable changePassword)
          Change the boot password.
 void checkpoint()
          Try to checkpoint the database to minimize recovery time.
 void createFinished()
           
 int decrypt(byte[] ciphertext, int offset, int length, byte[] cleartext, int outputOffset)
          Decrypt cleartext from ciphertext.
 void disableLogArchiveMode(boolean deleteOnlineArchivedLogFiles)
          disables the log archival process, i.e No old log files will be kept around for a roll-forward recovery.
 int encrypt(byte[] cleartext, int offset, int length, byte[] ciphertext, int outputOffset)
          Encrypt cleartext into ciphertext.
 Transaction findUserTransaction(ContextManager contextMgr, java.lang.String transName)
          Find a user transaction in the context manager, which must be the current context manager.
 void freeze()
          Freeze the database temporarily so a backup can be taken.
 void freezePersistentStore()
          Freeze the database from altering any persistent storage.
 DaemonService getDaemon()
          If this raw store has a daemon that services its need, return the daemon.
 java.lang.String getDataFactoryModule()
           
 int getEncryptionBlockSize()
          Returns the encryption block size used during creation of the encrypted database
 LockFactory getLockFactory()
          Get the LockFactory to use with this store.
 java.lang.String getLogFactoryModule()
           
 long getMaxContainerId()
          Return an id which can be used to create a container.
 void getRawStoreProperties(PersistentSet tc)
          Get JBMS properties relavent to raw store
 java.lang.String getTransactionFactoryModule()
           
 TransactionInfo[] getTransactionInfo()
           
 java.lang.Object getXAResourceManager()
           
 void idle()
          Idle the raw store as much as possible.
 boolean isReadOnly()
          Is the store read-only.
 ScanHandle openFlushedScan(DatabaseInstant start, int groupsIWant)
          Get a flushed scan.
 int random()
          Returns a secure random number for this raw store - if database is not encrypted, returns 0.
 Transaction startGlobalTransaction(ContextManager contextMgr, int format_id, byte[] global_id, byte[] local_id)
          Create a global user transaction, almost all work within the raw store is performed in the context of a transaction.
 Transaction startInternalTransaction(ContextManager contextMgr)
          Create an internal transaction.
 Transaction startNestedReadOnlyUserTransaction(java.lang.Object compatibilitySpace, ContextManager contextMgr, java.lang.String transName)
          Create a nested user transaction, almost all work within the raw store is performed in the context of a transaction.
 Transaction startNestedUpdateUserTransaction(ContextManager contextMgr, java.lang.String transName)
          Create a nested user transaction, almost all work within the raw store is performed in the context of a transaction.
 Transaction startTransaction(ContextManager contextMgr, java.lang.String transName)
          Create a user transaction, almost all work within the raw store is performed in the context of a transaction.
 void unfreeze()
          Unfreeze the database after a backup has been taken.
 void unfreezePersistentStore()
          Unfreeze the database, persistent storage can now be altered.
 
Methods inherited from interface org.apache.derby.iapi.store.raw.Corruptable
markCorrupt
 

Field Detail

DERBY_STORE_MINOR_VERSION_1

public static final int DERBY_STORE_MINOR_VERSION_1
Derby Store Minor Version (1)

See Also:
Constant Field Values

DERBY_STORE_MAJOR_VERSION_10

public static final int DERBY_STORE_MAJOR_VERSION_10
Derby 10 Store Major version

See Also:
Constant Field Values

PAGE_SIZE_DEFAULT

public static final int PAGE_SIZE_DEFAULT
Default value for PAGE_SIZE_PARAMETER (4096).

See Also:
Constant Field Values

PAGE_SIZE_MINIMUM

public static final int PAGE_SIZE_MINIMUM
Minimum page size we will accept (1024).

See Also:
Constant Field Values

PAGE_SIZE_STRING

public static final java.lang.String PAGE_SIZE_STRING
See Also:
Constant Field Values

PAGE_CACHE_SIZE_PARAMETER

public static final java.lang.String PAGE_CACHE_SIZE_PARAMETER
Property name for the page cache size to be used in the storage area. Equal to 'derby.storage.pageCacheSize'

See Also:
Constant Field Values

PAGE_CACHE_SIZE_DEFAULT

public static final int PAGE_CACHE_SIZE_DEFAULT
Default value for PAGE_CACHE_SIZE_PARAMETER (1000).

See Also:
Constant Field Values

PAGE_CACHE_SIZE_MINIMUM

public static final int PAGE_CACHE_SIZE_MINIMUM
Minimum page cache size we will accept (40).

See Also:
Constant Field Values

PAGE_CACHE_SIZE_MAXIMUM

public static final int PAGE_CACHE_SIZE_MAXIMUM
Maximum page cache size we will accept (MAXINT).

See Also:
Constant Field Values

MAX_CONTAINER_INITIAL_PAGES

public static final short MAX_CONTAINER_INITIAL_PAGES
Maximum number of initial pages when a container is created

See Also:
Constant Field Values

MINIMUM_RECORD_SIZE_PARAMETER

public static final java.lang.String MINIMUM_RECORD_SIZE_PARAMETER
Property name for the default minimum record size to be used in the storage area. Minimum record size is the minimum number of bytes that a record will reserve on disk.

See Also:
Constant Field Values

MINIMUM_RECORD_SIZE_DEFAULT

public static final int MINIMUM_RECORD_SIZE_DEFAULT
Default value for MINIMUM_RECORD_SIZE_PARAMETER for heap tables that allow overflow. By setting minimumRecordSize to 12 bytes, we guarantee there is enough space to update the row even there is not enough space on the page. The 12 bytes will guarantee there is room for an overflow pointer (page + id).

See Also:
Constant Field Values

MINIMUM_RECORD_SIZE_MINIMUM

public static final int MINIMUM_RECORD_SIZE_MINIMUM
Minimum value for MINIMUM_RECORD_SIZE_PARAMETER (1).

See Also:
Constant Field Values

PAGE_RESERVED_SPACE_PARAMETER

public static final java.lang.String PAGE_RESERVED_SPACE_PARAMETER
Property name for percentage of space to leave free on page for updates.

See Also:
Constant Field Values

PAGE_RESERVED_ZERO_SPACE_STRING

public static final java.lang.String PAGE_RESERVED_ZERO_SPACE_STRING
See Also:
Constant Field Values

PRE_ALLOCATE_PAGE

public static final java.lang.String PRE_ALLOCATE_PAGE
Property name for the number of pages we try to pre-allocate in one /** synchronous I/O

See Also:
Constant Field Values

PAGE_REUSABLE_RECORD_ID

public static final java.lang.String PAGE_REUSABLE_RECORD_ID
Property name for container which reuses recordId when a page is reused. Defaults to false, which means recordId is never reused. This property should NOT be set by the end user, only Access should set it for special conglomerates which does not count on permanant unique recordIds for all records.

See Also:
Constant Field Values

STREAM_FILE_BUFFER_SIZE_PARAMETER

public static final java.lang.String STREAM_FILE_BUFFER_SIZE_PARAMETER
Property name for buffer size to be used in the stream file container. Equal to 'derby.storage.streamFileBufferSize'

See Also:
Constant Field Values

STREAM_FILE_BUFFER_SIZE_DEFAULT

public static final int STREAM_FILE_BUFFER_SIZE_DEFAULT
Default value for STREAM_FILE_BUFFER_SIZE_PARAMETER (16384).

See Also:
Constant Field Values

STREAM_FILE_BUFFER_SIZE_MINIMUM

public static final int STREAM_FILE_BUFFER_SIZE_MINIMUM
Minimum stream file buffer size we will accept (1024).

See Also:
Constant Field Values

STREAM_FILE_BUFFER_SIZE_MAXIMUM

public static final int STREAM_FILE_BUFFER_SIZE_MAXIMUM
Maximum stream file buffer size we will accept (MAXINT).

See Also:
Constant Field Values

CONTAINER_INITIAL_PAGES

public static final java.lang.String CONTAINER_INITIAL_PAGES
Property name for container which attempts to be created with an initial size of this many pages. Defaults to 1 page.
All containers are guarenteed to be created with at least 1 page, if this property is set, it will attempt to allocate CONTAINER_INITIAL_PAGES, but with no guarentee. CONTAIENR_INITIAL_PAGES legally ranges from 1 to MAX_CONTAINER_INITIAL_PAGES. Values < 1 will be set to 1 and values > MAX_CONTAINER_INITIAL_PAGES will be set to MAX_CONTAINER_INITIAL_PAGES This property should only be set in the PROPERTIES list in a CREATE TABLE or CREATE INDEX statement. The global setting of this property has no effect.

See Also:
Constant Field Values

ENCRYPTION_ALIGNMENT

public static final int ENCRYPTION_ALIGNMENT
encryption alignment requirement.

See Also:
Constant Field Values

DEFAULT_ENCRYPTION_BLOCKSIZE

public static final int DEFAULT_ENCRYPTION_BLOCKSIZE
default encryption block size In old existing databases (ie 5.1.x), the default encryption block size used is 8. Do not change this value unless you account for downgrade issues

See Also:
Constant Field Values

ENCRYPTION_BLOCKSIZE

public static final java.lang.String ENCRYPTION_BLOCKSIZE
encryption block size used during creation of encrypted database This property is not set by the user; it is set by the engine when RawStore boots up during creation of an encrypted database

See Also:
Constant Field Values

DATA_ENCRYPT_ALGORITHM_VERSION

public static final java.lang.String DATA_ENCRYPT_ALGORITHM_VERSION
This variable is used to store the encryption scheme to allow for any future changes in encryption schemes of data This property has been introduced in version 10 Value starts at 1

See Also:
Constant Field Values

LOG_ENCRYPT_ALGORITHM_VERSION

public static final java.lang.String LOG_ENCRYPT_ALGORITHM_VERSION
Store the encryption scheme used for logging This will allow for any future changes in encryption schemes of logs This variable has been introduced in version 10 and value starts at 1.

See Also:
Constant Field Values

ENCRYPTED_KEY

public static final java.lang.String ENCRYPTED_KEY
If dataEncryption is true, store the encrypted key in services.properties file. It is really the encrypted key, but the property key is called the encryptedBootPassword.

See Also:
Constant Field Values

KEEP_TRANSACTION_LOG

public static final java.lang.String KEEP_TRANSACTION_LOG
for debugging, keep all transaction logs intact.

See Also:
Constant Field Values

PATCH_INITPAGE_RECOVER_ERROR

public static final java.lang.String PATCH_INITPAGE_RECOVER_ERROR
The following is a to enable patch for databases with recovery errors during redo of InitPage. If this property is set and the page on the disk is corrupted and is getting exceptions like invalid page format ids, we cook up the page during the recovery time. We have seen this kind of problem with 1.5.1 databases from customer Tridium ( Bug no: 3813). This patch needs to be kept unless we find the problem is during recovery process. If we discover this problem is actaully happening at the recovery then this patch should be backed out.

See Also:
Constant Field Values

MODULE

public static final java.lang.String MODULE
module name

See Also:
Constant Field Values
Method Detail

isReadOnly

public boolean isReadOnly()
Is the store read-only.


getLockFactory

public LockFactory getLockFactory()
Get the LockFactory to use with this store.


startTransaction

public Transaction startTransaction(ContextManager contextMgr,
                                    java.lang.String transName)
                             throws StandardException
Create a user transaction, almost all work within the raw store is performed in the context of a transaction.

Starting a transaction always performs the following steps.

  1. Create an raw store transaction context
  2. Create a new idle transaction and then link it to the context. Only one user transaction and one nested user transaction can be active in a context at any one time. After a commit the transaction may be re-used.

    Raw Store Transaction Context Behaviour
    The cleanupOnError() method of this context behaves as follows:

    • If error is an instance of StandardException that has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then no action is taken.
    • If error is an instance of StandardException that has a severity equal to ExceptionSeverity.TRANSACTION_SEVERITY then the context's transaction is aborted, and the transaction returned to the idle state.
    • If error is an instance of StandardException that has a severity greater than ExceptionSeverity.TRANSACTION_SEVERITY then the context's transaction is aborted, the transaction closed, and the context is popped off the stack.
    • If error is not an instance of StandardException then the context's transaction is aborted, the transaction closed, and the context is popped off the stack.

    Parameters:
    contextMgr - is the context manager to use. An exception will be thrown if context is not the current context.
    transName - is the name of the transaction. Thsi name will be displayed by the transactiontable VTI.
    Throws:
    StandardException - Standard Cloudscape error policy
    See Also:
    Transaction, Context, StandardException

startGlobalTransaction

public Transaction startGlobalTransaction(ContextManager contextMgr,
                                          int format_id,
                                          byte[] global_id,
                                          byte[] local_id)
                                   throws StandardException
Create a global user transaction, almost all work within the raw store is performed in the context of a transaction.

The (format_id, global_id, branch_id) triplet is meant to come exactly from a javax.transaction.xa.Xid. We don't use Xid so that the system can be delivered on a non-1.2 vm system and not require the javax classes in the path.

Starting a transaction always performs the following steps.

  1. Create an raw store transaction context
  2. Create a new idle transaction and then link it to the context. Only one user transaction can be active in a context at any one time. After a commit the transaction may be re-used.

    Raw Store Transaction Context Behaviour
    The cleanupOnError() method of this context behaves as follows:

    • If error is an instance of StandardException that has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then no action is taken.
    • If error is an instance of StandardException that has a severity equal to ExceptionSeverity.TRANSACTION_SEVERITY then the context's transaction is aborted, and the transaction returned to the idle state.
    • If error is an instance of StandardException that has a severity greater than ExceptionSeverity.TRANSACTION_SEVERITY then the context's transaction is aborted, the transaction closed, and the context is popped off the stack.
    • If error is not an instance of StandardException then the context's transaction is aborted, the transaction closed, and the context is popped off the stack.

    Parameters:
    contextMgr - is the context manager to use. An exception will be thrown if context is not the current context.
    format_id - the format id part of the Xid - ie. Xid.getFormatId().
    global_id - the global transaction identifier part of XID - ie. Xid.getGlobalTransactionId().
    local_id - The branch qualifier of the Xid - ie. Xid.getBranchQaulifier()
    Throws:
    StandardException - Standard Cloudscape error policy
    See Also:
    Transaction, Context, StandardException

findUserTransaction

public Transaction findUserTransaction(ContextManager contextMgr,
                                       java.lang.String transName)
                                throws StandardException
Find a user transaction in the context manager, which must be the current context manager. If a user transaction does not already exist, then create one @see #startTransaction

Parameters:
contextMgr - the context manager to use. An exception will be thrown if context is not the current context.
transName - If a new transaction is started, it will be given this name. The name is displayed in the transactiontable VTI.
Throws:
StandardException - Standard Cloudscape error policy
See Also:
startTransaction(org.apache.derby.iapi.services.context.ContextManager, java.lang.String)

startInternalTransaction

public Transaction startInternalTransaction(ContextManager contextMgr)
                                     throws StandardException
Create an internal transaction.

Starting an internal transaction always performs the following steps.

  1. Create an raw store internal transaction context
  2. Create a new idle internal transaction and then link it to the context.

    AN internal transaction is identical to a user transaction with the exception that

    • Logical operations are not supported
    • Savepoints are not supported
    • Containers are not closed when commit() is called.
    • Pages are not unlatched (since containers are not closed) when commit() is called.
    • During recovery time internal transactions are rolled back before user transactions.
    Only one internal transaction can be active in a context at any one time. After a commit the transaction may be re-used.

    Raw Store Internal Transaction Context Behaviour
    The cleanupOnError() method of this context behaves as follows:

    • If error is an instance of StandardException that has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then the internal transaction is aborted, the internal transaction is closed, the context is popped off the stack, and an exception of severity Transaction exception is re-thrown.
    • If error is an instance of StandardException that has a severity greater than or equal to ExceptionSeverity.TRANSACTION_SEVERITY then the context's internal transaction is aborted, the internal transaction is closed and the context is popped off the stack.
    • If error is not an instance of StandardException then the context's internal transaction is aborted, the internal transaction is closed and the context is popped off the stack.

    Throws:
    StandardException - Standard Cloudscape error policy
    See Also:
    Transaction, Context, StandardException

startNestedReadOnlyUserTransaction

public Transaction startNestedReadOnlyUserTransaction(java.lang.Object compatibilitySpace,
                                                      ContextManager contextMgr,
                                                      java.lang.String transName)
                                               throws StandardException
Create a nested user transaction, almost all work within the raw store is performed in the context of a transaction.

A nested user transaction is exactly the same as a user transaction, except that one can specify a compatibility space to associate with the transaction. Starting a transaction always performs the following steps.

  1. Create an raw store transaction context
  2. Create a new idle transaction and then link it to the context. Only one user transaction and one nested user transaction can be active in a context at any one time. After a commit the transaction may be re-used.

    Raw Store Transaction Context Behaviour
    The cleanupOnError() method of this context behaves as follows:

    • If error is an instance of StandardException that has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then no action is taken.
    • If error is an instance of StandardException that has a severity equal to ExceptionSeverity.TRANSACTION_SEVERITY then the context's transaction is aborted, and the transaction returned to the idle state. If a user transaction exists on the context stack then that transaction is aborted also.
    • If error is an instance of StandardException that has a severity greater than ExceptionSeverity.TRANSACTION_SEVERITY then the context's transaction is aborted, the transaction closed, and the context is popped off the stack.
    • If error is not an instance of StandardException then the context's transaction is aborted, the transaction closed, and the context is popped off the stack.

    Parameters:
    compatibilitySpace - compatibility space to use for locks.
    contextMgr - is the context manager to use. An exception will be thrown if context is not the current context.
    transName - is the name of the transaction. This name will be displayed by the transactiontable VTI.
    Throws:
    StandardException - Standard Cloudscape error policy
    See Also:
    Transaction, Context, StandardException

startNestedUpdateUserTransaction

public Transaction startNestedUpdateUserTransaction(ContextManager contextMgr,
                                                    java.lang.String transName)
                                             throws StandardException
Create a nested user transaction, almost all work within the raw store is performed in the context of a transaction.

A nested user transaction is exactly the same as a user transaction, except that one can specify a compatibility space to associate with the transaction. Starting a transaction always performs the following steps.

  1. Create an raw store transaction context
  2. Create a new idle transaction and then link it to the context. Only one user transaction and one nested user transaction can be active in a context at any one time. After a commit the transaction may be re-used.

    Raw Store Transaction Context Behaviour
    The cleanupOnError() method of this context behaves as follows:

    • If error is an instance of StandardException that has a severity less than ExceptionSeverity.TRANSACTION_SEVERITY then no action is taken.
    • If error is an instance of StandardException that has a severity equal to ExceptionSeverity.TRANSACTION_SEVERITY then the context's transaction is aborted, and the transaction returned to the idle state. If a user transaction exists on the context stack then that transaction is aborted also.
    • If error is an instance of StandardException that has a severity greater than ExceptionSeverity.TRANSACTION_SEVERITY then the context's transaction is aborted, the transaction closed, and the context is popped off the stack.
    • If error is not an instance of StandardException then the context's transaction is aborted, the transaction closed, and the context is popped off the stack.

    Parameters:
    contextMgr - is the context manager to use. An exception will be thrown if context is not the current context.
    transName - is the name of the transaction. This name will be displayed by the transactiontable VTI.
    Throws:
    StandardException - Standard Cloudscape error policy
    See Also:
    Transaction, Context, StandardException

getTransactionInfo

public TransactionInfo[] getTransactionInfo()
See Also:
AccessFactory.getTransactionInfo()

freeze

public void freeze()
            throws StandardException
Freeze the database temporarily so a backup can be taken.

Please see cloudscape on line documentation on backup and restore.

Throws:
StandardException - Thrown on error

unfreeze

public void unfreeze()
              throws StandardException
Unfreeze the database after a backup has been taken.

Please see cloudscape on line documentation on backup and restore.

Throws:
StandardException - Thrown on error

backup

public void backup(java.lang.String backupDir)
            throws StandardException
Backup the database to backupDir.

Please see cloudscape on line documentation on backup and restore.

Parameters:
backupDir - the name of the directory where the backup should be stored.
Throws:
StandardException - Thrown on error

backup

public void backup(java.io.File backupDir)
            throws StandardException
Backup the database to backupDir.

Please see cloudscape on line documentation on backup and restore.

Parameters:
backupDir - the directory where the backup should be stored.
Throws:
StandardException - Thrown on error

backupAndEnableLogArchiveMode

public void backupAndEnableLogArchiveMode(java.lang.String backupDir,
                                          boolean deleteOnlineArchivedLogFiles)
                                   throws StandardException
Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup.

Parameters:
backupDir - the directory name where the database backup should go. This directory will be created if not it does not exist.
deleteOnlineArchivedLogFiles - If true deletes online archived log files that exist before this backup, delete will occur only after backup is complete.
Throws:
StandardException - Thrown on error

backupAndEnableLogArchiveMode

public void backupAndEnableLogArchiveMode(java.io.File backupDir,
                                          boolean deleteOnlineArchivedLogFiles)
                                   throws StandardException
Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup.

Parameters:
backupDir - the directory name where the database backup should go. This directory will be created if not it does not exist.
deleteOnlineArchivedLogFiles - If true deletes online archived log files that exist before this backup, delete will occur only after backup is complete.
Throws:
StandardException - Thrown on error

disableLogArchiveMode

public void disableLogArchiveMode(boolean deleteOnlineArchivedLogFiles)
                           throws StandardException
disables the log archival process, i.e No old log files will be kept around for a roll-forward recovery.

Parameters:
deleteOnlineArchivedLogFiles - If true deletes all online archived log files that exist before this call immediately; Only restore that can be performed after disabling log archive mode is version recovery.
Throws:
StandardException - Thrown on error

checkpoint

public void checkpoint()
                throws StandardException
Try to checkpoint the database to minimize recovery time. The raw store does not guarentee that a checkpoint will indeed have happened by the time this routine returns.

Throws:
StandardException - Standard Cloudscape error policy

idle

public void idle()
          throws StandardException
Idle the raw store as much as possible.

Throws:
StandardException - Standard Cloudscape error policy

openFlushedScan

public ScanHandle openFlushedScan(DatabaseInstant start,
                                  int groupsIWant)
                           throws StandardException
Get a flushed scan.

Parameters:
start - The instant for the beginning of the scan.
groupsIWant - log record groups the caller wants to scan.
Throws:
StandardException - StandardCloudscape error policy

getDaemon

public DaemonService getDaemon()
If this raw store has a daemon that services its need, return the daemon. If not, return null


getTransactionFactoryModule

public java.lang.String getTransactionFactoryModule()

getDataFactoryModule

public java.lang.String getDataFactoryModule()

getLogFactoryModule

public java.lang.String getLogFactoryModule()

getXAResourceManager

public java.lang.Object getXAResourceManager()
                                      throws StandardException
Throws:
StandardException

createFinished

public void createFinished()
                    throws StandardException
Throws:
StandardException

getRawStoreProperties

public void getRawStoreProperties(PersistentSet tc)
                           throws StandardException
Get JBMS properties relavent to raw store

Throws:
StandardException - Standard cloudscape exception policy.

freezePersistentStore

public void freezePersistentStore()
                           throws StandardException
Freeze the database from altering any persistent storage.

Throws:
StandardException - Standard cloudscape exception policy.

unfreezePersistentStore

public void unfreezePersistentStore()
                             throws StandardException
Unfreeze the database, persistent storage can now be altered.

Throws:
StandardException - Standard cloudscape exception policy.

encrypt

public int encrypt(byte[] cleartext,
                   int offset,
                   int length,
                   byte[] ciphertext,
                   int outputOffset)
            throws StandardException
Encrypt cleartext into ciphertext.

Throws:
StandardException - Standard Cloudscape Error Policy
See Also:
CipherProvider.encrypt(byte[], int, int, byte[], int)

decrypt

public int decrypt(byte[] ciphertext,
                   int offset,
                   int length,
                   byte[] cleartext,
                   int outputOffset)
            throws StandardException
Decrypt cleartext from ciphertext.

Throws:
StandardException - Standard Cloudscape Error Policy
See Also:
CipherProvider.decrypt(byte[], int, int, byte[], int)

getEncryptionBlockSize

public int getEncryptionBlockSize()
Returns the encryption block size used during creation of the encrypted database


random

public int random()
Returns a secure random number for this raw store - if database is not encrypted, returns 0.


changeBootPassword

public java.io.Serializable changeBootPassword(java.util.Properties properties,
                                               java.io.Serializable changePassword)
                                        throws StandardException
Change the boot password. Return the encrypted form of the secret key. The new value must be a String of the form: oldBootPassword, newBootPassword

Throws:
StandardException - Standard Cloudscape Error Policy

getMaxContainerId

public long getMaxContainerId()
                       throws StandardException
Return an id which can be used to create a container.

Return an id number with is greater than any existing container in the current database. Caller will use this to allocate future container numbers - most likely caching the value and then incrementing it as it is used.

Returns:
The an id which can be used to create a container.
Throws:
StandardException - Standard exception policy.

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.