From ea7d69befb8f4391c39b038ec43f03ece3f14cc5 Mon Sep 17 00:00:00 2001 From: ahodgkinson Date: Thu, 28 Sep 2006 22:29:13 +0000 Subject: [PATCH] XFLAIM - Added more c# methods. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@932 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- xflaim/csharp/xflaim/Db.cs | 1344 ++++++++++++++++++++++-------------- 1 file changed, 809 insertions(+), 535 deletions(-) diff --git a/xflaim/csharp/xflaim/Db.cs b/xflaim/csharp/xflaim/Db.cs index 036e476..66157b5 100644 --- a/xflaim/csharp/xflaim/Db.cs +++ b/xflaim/csharp/xflaim/Db.cs @@ -27,9 +27,9 @@ using System.Runtime.InteropServices; namespace xflaim { - //----------------------------------------------------------------------------- - // Element tags - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// Element tags +//----------------------------------------------------------------------------- /// /// Reserved dictionary tags for elements @@ -140,9 +140,9 @@ namespace xflaim ELM_SWEEP_TAG = 0xFFFFFE19 } - //----------------------------------------------------------------------------- - // Attribute tags - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// Attribute tags +//----------------------------------------------------------------------------- /// /// Reserved dictionary tags for attributes @@ -333,9 +333,9 @@ namespace xflaim ATTR_UNIQUE_SUB_ELEMENTS_TAG = 0xFFFFFE2C } - //----------------------------------------------------------------------------- - // XML parse errors - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// XML parse errors +//----------------------------------------------------------------------------- /// /// IMPORTANT NOTE: These need to be kept in sync with the corresponding @@ -537,9 +537,9 @@ namespace xflaim XML_ERR_CREATING_ELEMENT_NODE } - //----------------------------------------------------------------------------- - // XML encoding - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// XML encoding +//----------------------------------------------------------------------------- /// /// IMPORTANT NOTE: These need to be kept in sync with the corresponding @@ -557,9 +557,9 @@ namespace xflaim XFLM_XML_USASCII_ENCODING } - //----------------------------------------------------------------------------- - // XML import stats - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// XML import stats +//----------------------------------------------------------------------------- /// /// XML import stats @@ -619,9 +619,9 @@ namespace xflaim public XMLEncoding eXMLEncoding; } - //----------------------------------------------------------------------------- - // Database transaction types - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// Database transaction types +//----------------------------------------------------------------------------- /// /// Database transaction types. @@ -638,9 +638,9 @@ namespace xflaim XFLM_UPDATE_TRANS } - //----------------------------------------------------------------------------- - // Database transaction flags - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// Database transaction flags +//----------------------------------------------------------------------------- /// /// Database transaction flags. @@ -662,9 +662,9 @@ namespace xflaim XFLM_DONT_POISON_CACHE = 0x0002 } - //----------------------------------------------------------------------------- - // Database lock types - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// Database lock types +//----------------------------------------------------------------------------- /// /// Types of locks that may be requested. @@ -735,9 +735,9 @@ namespace xflaim public eXFlmIndexState eState; } - //----------------------------------------------------------------------------- - // RetrieveFlags - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// RetrieveFlags +//----------------------------------------------------------------------------- /// /// Flags used to specify items to be retrieved from a result set. @@ -887,9 +887,9 @@ namespace xflaim private static extern void xflaim_Db_Release( IntPtr pDb); - //----------------------------------------------------------------------------- - // transBegin - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// transBegin +//----------------------------------------------------------------------------- /// /// Starts a transaction. @@ -3006,494 +3006,768 @@ namespace xflaim IntPtr pDb, out uint puiRflFileNum); - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// setRflFileSizeLimits +//----------------------------------------------------------------------------- -#if TODO - /** - * Set size limits for RFL files. - * @param iMinRflSize Minimum RFL file size. Database will roll to the - * next RFL file when the current RFL file reaches this size. If possible - * it will complete the current transaction before rolling to the next file. - * @param iMaxRflSize Maximum RFL file size. Database will not allow an - * RFL file to exceed this size. Even if it is in the middle of a - * transaction, it will roll to the next RFL file before this size is allowed - * to be exceeded. Thus, the database first looks for an opportunity to - * roll to the next file when the RFL file exceeds iMinRflSize. If it can - * fit the current transaction in without exceeded iMaxRflSize, it will do - * so and then roll to the next file. Otherwise, it will roll to the next - * file before iMaxRflSize is exceeded. - * @throws XFlaimException - */ + /// + /// Set size limits for RFL files. + /// + /// + /// Minimum RFL file size. Database will roll to the next RFL file when + /// the current RFL file reaches this size. If possible it will complete + /// the current transaction before rolling to the next file. + /// + /// + /// Maximum RFL file size. Database will not allow an RFL file + /// to exceed this size. Even if it is in the middle of a transaction, + /// it will roll to the next RFL file before this size is allowed + /// to be exceeded. Thus, the database first looks for an opportunity to + /// roll to the next file when the RFL file exceeds iMinRflSize. If it can + /// fit the current transaction in without exceeded iMaxRflSize, it will do + /// so and then roll to the next file. Otherwise, it will roll to the next + /// file before iMaxRflSize is exceeded. + /// public void setRflFileSizeLimits( uint uiMinRflSize, uint uiMaxRflSize) { + RCODE rc; + + if ((rc = xflaim_Db_setRflFileSizeLimits(m_pDb, + uiMinRflSize, uiMaxRflSize)) != 0) + { + throw new XFlaimException(rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_setRflFileSizeLimits( + IntPtr pDb, + uint uiMinRflSize, + uint uiMaxRflSize); + +//----------------------------------------------------------------------------- +// getMinRflFileSize +//----------------------------------------------------------------------------- + + /// + /// Get the minimum RFL file size. This is the minimum size an RFL file + /// must reach before rolling to the next RFL file. + /// + /// + /// Returns minimum RFL file size. + /// + public uint getMinRflFileSize() + { + RCODE rc; + uint uiRflFileSize; + + if ((rc = xflaim_Db_getMinRflFileSize(m_pDb, + out uiRflFileSize)) != 0) + { + throw new XFlaimException(rc); + } + + return (uiRflFileSize); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getMinRflFileSize( + IntPtr pDb, + out uint uiRflFileSize); + +//----------------------------------------------------------------------------- +// getMaxRflFileSize +//----------------------------------------------------------------------------- + + /// + /// Get the maximum RFL file size. This is the maximum size an RFL file + /// is allowed to grow to. When the current RFL file exceeds the minimum + /// RFL file size, the database will attempt to fit the rest of the + /// transaction in the current file. If the transaction completes before + /// the current RFL file grows larger than the maximum RFL file size, + /// the database will roll to the next RFL file. However, if the current transaction + /// would cause the RFL file to grow larger than the maximum RFL file size, + /// the database will roll to the next file before the transaction completes, + /// and the transaction will be split across multiple RFL files. + /// + /// + /// Returns maximum RFL file size. + /// + public uint getMaxRflFileSize() + { + RCODE rc; + uint uiRflFileSize; + + if ((rc = xflaim_Db_getMaxRflFileSize(m_pDb, + out uiRflFileSize)) != 0) + { + throw new XFlaimException(rc); + } + + return (uiRflFileSize); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getMaxRflFileSize( + IntPtr pDb, + out uint uiRflFileSize); + +//----------------------------------------------------------------------------- +// rflRollToNextFile +//----------------------------------------------------------------------------- + + /// + /// Force the database to roll to the next RFL file. + /// + public void rflRollToNextFile() + { + RCODE rc; + + if ((rc = xflaim_Db_rflRollToNextFile(m_pDb)) != 0) + { + throw new XFlaimException(rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_rflRollToNextFile( + IntPtr pDb); + +//----------------------------------------------------------------------------- +// setKeepAbortedTransInRflFlag +//----------------------------------------------------------------------------- + + /// + /// Specify whether the roll-forward log should keep or not keep aborted + /// transactions. + /// + /// + /// Flag specifying whether to keep or not keep aborted transactions. + /// + public void setKeepAbortedTransInRflFlag( + bool bKeep) + { + RCODE rc; + + if ((rc = xflaim_Db_setKeepAbortedTransInRflFlag(m_pDb, bKeep)) != 0) + { + throw new XFlaimException(rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_setKeepAbortedTransInRflFlag( + IntPtr pDb, + bool bKeep); + +//----------------------------------------------------------------------------- +// getKeepAbortedTransInRflFlag +//----------------------------------------------------------------------------- + + /// + /// Determine whether or not the roll-forward log is keeping aborted + /// transactions. + /// + /// + /// Returns true if aborted transactions are being kept, false otherwise. + /// + public bool getKeepAbortedTransInRflFlag() + { + RCODE rc; + int bKeep; + + + if ((rc = xflaim_Db_getKeepAbortedTransInRflFlag(m_pDb, + out bKeep)) != 0) + { + throw new XFlaimException(rc); + } + + return (bKeep != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getKeepAbortedTransInRflFlag( + IntPtr pDb, + out int bKeep); + +//----------------------------------------------------------------------------- +// setAutoTurnOffKeepRflFlag +//----------------------------------------------------------------------------- + + /// + /// Specify whether the roll-forward log should automatically turn off the + /// keeping of RFL files if the RFL volume fills up. + /// + /// + /// Flag specifying whether to automatically turn off the + /// keeping of RFL files if the RFL volume fills up. + /// + public void setAutoTurnOffKeepRflFlag( + bool bAutoTurnOff) + { + RCODE rc; + + if ((rc = xflaim_Db_setAutoTurnOffKeepRflFlag(m_pDb, bAutoTurnOff)) != 0) + { + throw new XFlaimException(rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_setAutoTurnOffKeepRflFlag( + IntPtr pDb, + bool bAutoTurnOff); + +//----------------------------------------------------------------------------- +// getAutoTurnOffKeepRflFlag +//----------------------------------------------------------------------------- + + /// + /// Determine whether or not keeping of RFL files will automatically be + /// turned off if the RFL volume fills up. + /// + /// + /// Returns true if the keeping of RFL files will automatically be + /// turned off when the RFL volume fills up, false otherwise. + /// + public bool getAutoTurnOffKeepRflFlag() + { + RCODE rc; + int bAutoTurnOff; + + if ((rc = xflaim_Db_getAutoTurnOffKeepRflFlag(m_pDb, + out bAutoTurnOff)) != 0) + { + throw new XFlaimException(rc); + } + + return (bAutoTurnOff != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getAutoTurnOffKeepRflFlag( + IntPtr pDb, + out int bAutoTurnOff); + +//----------------------------------------------------------------------------- +// setFileExtendSize +//----------------------------------------------------------------------------- + + /// + /// Set the file extend size for the database. This size specifies how much + /// to extend a database file when it needs to be extended. + /// + /// + /// File extend size. + /// + public void setFileExtendSize( + uint uiFileExtendSize) + { + RCODE rc; + + if ((rc = xflaim_Db_setFileExtendSize(m_pDb, uiFileExtendSize)) != 0) + { + throw new XFlaimException(rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_setFileExtendSize( + IntPtr pDb, + uint uiFileExtendSize); + +//----------------------------------------------------------------------------- +// getFileExtendSize +//----------------------------------------------------------------------------- + + /// + /// Get the file extend size for the database. + /// + /// + /// Returns file extend size. + /// + public uint getFileExtendSize() + { + RCODE rc; + uint uiFileExtendSize; + + if ((rc = xflaim_Db_getFileExtendSize(m_pDb, + out uiFileExtendSize)) != 0) + { + throw new XFlaimException(rc); + } + + return (uiFileExtendSize); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getFileExtendSize( + IntPtr pDb, + out uint uiFileExtendSize); + +//----------------------------------------------------------------------------- +// getDbVersion +//----------------------------------------------------------------------------- + + /// + /// Get the database version for the database. This is the version of the + /// database, not the code. + /// + /// + /// Returns database version. + /// + public uint getDbVersion() + { + RCODE rc; + uint uiDbVersion; + + if ((rc = xflaim_Db_getDbVersion(m_pDb, out uiDbVersion)) != 0) + { + throw new XFlaimException(rc); + } + + return (uiDbVersion); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getDbVersion( + IntPtr pDb, + out uint uiDbVersion); + +//----------------------------------------------------------------------------- +// getBlockSize +//----------------------------------------------------------------------------- + + /// + /// Get the database block size. + /// + /// + /// Returns database block size. + /// + public uint getBlockSize() + { + RCODE rc; + uint uiBlockSize; + + if ((rc = xflaim_Db_getBlockSize(m_pDb, out uiBlockSize)) != 0) + { + throw new XFlaimException(rc); + } + + return (uiBlockSize); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getBlockSize( + IntPtr pDb, + out uint uiBlockSize); + +//----------------------------------------------------------------------------- +// getDefaultLanguage +//----------------------------------------------------------------------------- + + /// + /// Get the database default language. + /// + /// + /// Returns database default language. + /// + public Languages getDefaultLanguage() + { + RCODE rc; + Languages defaultLang; + + if ((rc = xflaim_Db_getDefaultLanguage(m_pDb, out defaultLang)) != 0) + { + throw new XFlaimException(rc); + } + + return (defaultLang); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getDefaultLanguage( + IntPtr pDb, + out Languages defaultLang); + +//----------------------------------------------------------------------------- +// getTransID +//----------------------------------------------------------------------------- + + /// + /// Get the database's current transaction ID. If no transaction is + /// currently running, but this Db object has an exclusive lock on the database, + /// the transaction ID of the last committed transaction will be returned. + /// If no transaction is running, and this Db object does not have an + /// exclusive lock on the database, zero is returned. + /// + /// + /// Transaction ID + /// + public ulong getTransID() + { + RCODE rc; + ulong ulTransId; + + if ((rc = xflaim_Db_getTransID(m_pDb, out ulTransId)) != 0) + { + throw new XFlaimException(rc); + } + + return (ulTransId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getTransID( + IntPtr pDb, + out ulong ulTransId); + +//----------------------------------------------------------------------------- +// getDbControlFileName +//----------------------------------------------------------------------------- + + /// + /// Get the name of the database's control file + /// + /// + /// Returns control file name. + /// + public string getDbControlFileName() + { + RCODE rc; + IntPtr pszFileName; + string sFileName; + + if ((rc = xflaim_Db_getDbControlFileName(m_pDb, + out pszFileName)) != 0) + { + throw new XFlaimException(rc); + } + + sFileName = Marshal.PtrToStringAnsi(pszFileName); + m_dbSystem.freeUnmanagedMem(pszFileName); + return (sFileName); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getDbControlFileName( + IntPtr pDb, + out IntPtr pszFileName); + +//----------------------------------------------------------------------------- +// getLastBackupTransID +//----------------------------------------------------------------------------- + + /// + /// Get the transaction ID of the last backup that was taken on the database. + /// + /// + /// Returns last backup transaction ID. + /// + public ulong getLastBackupTransID() + { + RCODE rc; + ulong ulTransId; + + if ((rc = xflaim_Db_getLastBackupTransID(m_pDb, + out ulTransId)) != 0) + { + throw new XFlaimException(rc); + } + + return (ulTransId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getLastBackupTransID( + IntPtr pDb, + out ulong ulTransId); + +//----------------------------------------------------------------------------- +// getBlocksChangedSinceBackup +//----------------------------------------------------------------------------- + + /// + /// Get the number of blocks that have changed since the last backup was + /// taken. + /// + /// + /// Returns number of blocks that have changed. + /// + public uint getBlocksChangedSinceBackup() + { + RCODE rc; + uint uiBlocksChanged; + + if ((rc = xflaim_Db_getBlocksChangedSinceBackup(m_pDb, + out uiBlocksChanged)) != 0) + { + throw new XFlaimException(rc); + } + + return (uiBlocksChanged); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getBlocksChangedSinceBackup( + IntPtr pDb, + out uint uiBlocksChanged); + +//----------------------------------------------------------------------------- +// getNextIncBackupSequenceNum +//----------------------------------------------------------------------------- + + /// + /// Get the next incremental backup sequence number for the database. + /// + /// + /// Returns next incremental backup sequence number. + /// + public uint getNextIncBackupSequenceNum() + { + RCODE rc; + uint uiNextIncBackupSequenceNum; + + if ((rc = xflaim_Db_getNextIncBackupSequenceNum(m_pDb, + out uiNextIncBackupSequenceNum)) != 0) + { + throw new XFlaimException(rc); + } + + return (uiNextIncBackupSequenceNum); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getNextIncBackupSequenceNum( + IntPtr pDb, + out uint uiNextIncBackupSequenceNum); + +//----------------------------------------------------------------------------- +// getDiskSpaceDataSize +//----------------------------------------------------------------------------- + + /// + /// Get the amount of disk space currently being used by data files. + /// + /// + /// Returns disk space used by data files. + /// + public ulong getDiskSpaceDataSize() + { + RCODE rc; + ulong ulDiskSpace; + + if ((rc = xflaim_Db_getDiskSpaceDataSize(m_pDb, + out ulDiskSpace)) != 0) + { + throw new XFlaimException(rc); + } + + return (ulDiskSpace); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getDiskSpaceDataSize( + IntPtr pDb, + out ulong ulDiskSpace); + +//----------------------------------------------------------------------------- +// getDiskSpaceRollbackSize +//----------------------------------------------------------------------------- + + /// + /// Get the amount of disk space currently being used by rollback files. + /// + /// + /// Returns disk space used by rollback files. + /// + public ulong getDiskSpaceRollbackSize() + { + RCODE rc; + ulong ulDiskSpace; + + if ((rc = xflaim_Db_getDiskSpaceRollbackSize(m_pDb, + out ulDiskSpace)) != 0) + { + throw new XFlaimException(rc); + } + + return (ulDiskSpace); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getDiskSpaceRollbackSize( + IntPtr pDb, + out ulong ulDiskSpace); + +//----------------------------------------------------------------------------- +// getDiskSpaceRflSize +//----------------------------------------------------------------------------- + + /// + /// Get the amount of disk space currently being used by RFL files. + /// + /// + /// Returns disk space used by RFL files. + /// + public ulong getDiskSpaceRflSize() + { + RCODE rc; + ulong ulDiskSpace; + + if ((rc = xflaim_Db_getDiskSpaceRflSize(m_pDb, + out ulDiskSpace)) != 0) + { + throw new XFlaimException(rc); + } + + return (ulDiskSpace); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getDiskSpaceRflSize( + IntPtr pDb, + out ulong ulDiskSpace); + +//----------------------------------------------------------------------------- +// getDiskSpaceTotalSize +//----------------------------------------------------------------------------- + + /// + /// Get the amount of disk space currently being used by all types of + /// database files. This includes the total of data files plus rollback + /// files plus RFL files. + /// + /// + /// Returns total disk space used by database files of all types. + /// + public ulong getDiskSpaceTotalSize() + { + RCODE rc; + ulong ulDiskSpace; + + if ((rc = xflaim_Db_getDiskSpaceTotalSize(m_pDb, + out ulDiskSpace)) != 0) + { + throw new XFlaimException(rc); + } + + return (ulDiskSpace); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getDiskSpaceTotalSize( + IntPtr pDb, + out ulong ulDiskSpace); + +//----------------------------------------------------------------------------- +// getMustCloseRC +//----------------------------------------------------------------------------- + + /// + /// Get error code that caused the database to force itself to close. This should + /// be one of the values in {@link xflaim.RCODE RCODE}. + /// + /// + /// Returns error code that caused the "must close" condition. + /// + public RCODE getMustCloseRC() + { + return( xflaim_Db_getMustCloseRC(m_pDb)); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getMustCloseRC( + IntPtr pDb); + +//----------------------------------------------------------------------------- +// getAbortRC +//----------------------------------------------------------------------------- + + /// + /// Get error code that caused the current transaction to require an abort. + /// + /// + /// Returns the error code that requires the transaction to abort + /// + public RCODE getAbortRC() + { + return (xflaim_Db_getAbortRC(m_pDb)); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_Db_getAbortRC( + IntPtr pDb); + +//----------------------------------------------------------------------------- +// setMustAbortTrans +//----------------------------------------------------------------------------- + + /// + /// Force the current transaction to abort. This method should be called + /// when the code should not be the code that aborts the transation, but + /// wants to require that the transaction be aborted by whatever module has + /// the authority to abort the transaction. An error code may be + /// set to indicate what error condition is causing the transaction to be + /// aborted. + /// + /// + /// Error code that indicates why the transaction is aborting. + /// + public void setMustAbortTrans( + RCODE rc) + { + xflaim_Db_setAbortRC( m_pDb, rc); } -#endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- + [DllImport("xflaim")] + private static extern void xflaim_Db_setAbortRC( + IntPtr pDb, + RCODE rc); -#if TODO - /** - * Get the minimum RFL file size. This is the minimum size an RFL file - * must reach before rolling to the next RFL file. - * @return Returns minimum RFL file size. - * @throws XFlaimException - */ - public int getMinRflFileSize() throws XFlaimException - { - return( _getMinRflFileSize( m_this)); - } -#endif +//----------------------------------------------------------------------------- +// enableEncryption +//----------------------------------------------------------------------------- - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- + /// + /// Enable encryption support for this database. + /// + public void enableEncryption() + { + xflaim_Db_enableEncryption( m_pDb); + } -#if TODO - /** - * Get the maximum RFL file size. This is the maximum size an RFL file - * is allowed to grow to. When the current RFL file exceeds the minimum - * RFL file size, the database will attempt to fit the rest of the - * transaction in the current file. If the transaction completes before - * the current RFL file grows larger than the maximum RFL file size, - * the database will roll to the next RFL file. However, if the current transaction - * would cause the RFL file to grow larger than the maximum RFL file size, - * the database will roll to the next file before the transaction completes, - * and the transaction will be split across multiple RFL files. - * @return Returns maximum RFL file size. - * @throws XFlaimException - */ - public int getMaxRflFileSize() throws XFlaimException - { - return( _getMaxRflFileSize( m_this)); - } -#endif + [DllImport("xflaim")] + private static extern void xflaim_Db_enableEncryption( + IntPtr pDb); - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// wrapKey +//----------------------------------------------------------------------------- -#if TODO - /** - * Force the database to roll to the next RFL file. - * @throws XFlaimException - */ - public void rflRollToNextFile() throws XFlaimException - { - _rflRollToNextFile( m_this); - } -#endif + /// + /// Wrap the database key in a password. This method is called when it is + /// desirable to move the database to a different machine. Normally, the + /// database key is wrapped in the local NICI storage key - which means that + /// the database can only be opened and accessed on that machine. -- Once + /// the database key is wrapped in a password, the password must be + /// supplied to the dbOpen method to open the database. + /// + /// + /// Password the database key should be wrapped in. + /// + public void wrapKey( + string sPassword) + { +// _wrapKey( m_this, sPassword); + } - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Specify whether the roll-forward log should keep or not keep aborted - * transactions. - * @param bKeep Flag specifying whether to keep or not keep aborted - * transactions. - * @throws XFlaimException - */ - public void setKeepAbortedTransInRflFlag( - boolean bKeep) throws XFlaimException - { - _setKeepAbortedTransInRflFlag( m_this, bKeep); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Determine whether or not the roll-forward log is keeping aborted - * transactions. - * @return Returns true if aborted transactions are being kept, false otherwise. - * @throws XFlaimException - */ - public boolean getKeepAbortedTransInRflFlag() throws XFlaimException - { - return( _getKeepAbortedTransInRflFlag( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Specify whether the roll-forward log should automatically turn off the - * keeping of RFL files if the RFL volume fills up. - * @param bAutoTurnOff Flag specifying whether to automatically turn off the - * keeping of RFL files if the RFL volume fills up. - * @throws XFlaimException - */ - public void setAutoTurnOffKeepRflFlag( - boolean bAutoTurnOff) throws XFlaimException - { - _setAutoTurnOffKeepRflFlag( m_this, bAutoTurnOff); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Determine whether or not keeping of RFL files will automatically be - * turned off if the RFL volume fills up. - * @return Returns true if the keeping of RFL files will automatically be - * turned off when the RFL volume fills up, false otherwise. - * @throws XFlaimException - */ - public boolean getAutoTurnOffKeepRflFlag() throws XFlaimException - { - return( _getAutoTurnOffKeepRflFlag( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Set the file extend size for the database. This size specifies how much - * to extend a database file when it needs to be extended. - * @param iFileExtendSize File extend size. - * @throws XFlaimException - */ - public void setFileExtendSize( - int iFileExtendSize) throws XFlaimException - { - _setFileExtendSize( m_this, iFileExtendSize); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the file extend size for the database. - * @return Returns file extend size. - * @throws XFlaimException - */ - public int getFileExtendSize() throws XFlaimException - { - return( _getFileExtendSize( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the database version for the database. This is the version of the - * database, not the code. - * @return Returns database version. - * @throws XFlaimException - */ - public int getDbVersion() throws XFlaimException - { - return( _getDbVersion( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the database block size. - * @return Returns database block size. - * @throws XFlaimException - */ - public int getBlockSize() throws XFlaimException - { - return( _getBlockSize( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the database default language. - * @return Returns database default language. - * @throws XFlaimException - */ - public int getDefaultLanguage() throws XFlaimException - { - return( _getDefaultLanguage( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the database's current transaction ID. If no transaction is - * currently running, but this Db object has an exclusive lock on the database, - * the transaction ID of the last committed transaction will be returned. - * If no transaction is running, and this Db object does not have an - * exclusive lock on the database, zero is returned. - * @return Returns transaction ID. - * @throws XFlaimException - */ - public long getTransID() throws XFlaimException - { - return( _getTransID( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the name of the database's control file (e.g. mystuff.db). - * @return Returns control file name. - * @throws XFlaimException - */ - public String getDbControlFileName() throws XFlaimException - { - return( _getDbControlFileName( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the transaction ID of the last backup that was taken on the database. - * @return Returns last backup transaction ID. - * @throws XFlaimException - */ - public long getLastBackupTransID() throws XFlaimException - { - return( _getLastBackupTransID( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the number of blocks that have changed since the last backup was - * taken. - * @return Returns number of blocks that have changed. - * @throws XFlaimException - */ - public int getBlocksChangedSinceBackup() throws XFlaimException - { - return( _getBlocksChangedSinceBackup( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the next incremental backup sequence number for the database. - * @return Returns next incremental backup sequence number. - * @throws XFlaimException - */ - public int getNextIncBackupSequenceNum() throws XFlaimException - { - return( _getNextIncBackupSequenceNum( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the amount of disk space currently being used by data files. - * @return Returns disc space used by data files. - * @throws XFlaimException - */ - public long getDiskSpaceDataSize()throws XFlaimException - { - return( _getDiskSpaceDataSize( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the amount of disk space currently being used by rollback files. - * @return Returns disc space used by rollback files. - * @throws XFlaimException - */ - public long getDiskSpaceRollbackSize() throws XFlaimException - { - return( _getDiskSpaceRollbackSize( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the amount of disk space currently being used by RFL files. - * @return Returns disc space used by RFL files. - * @throws XFlaimException - */ - public long getDiskSpaceRflSize() throws XFlaimException - { - return( _getDiskSpaceRflSize( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get the amount of disk space currently being used by all types of - * database files. This includes the total of data files plus rollback - * files plus RFL files. - * @return Returns total disc space used by database files of all types. - * @throws XFlaimException - */ - public long getDiskSpaceTotalSize() throws XFlaimException - { - return( _getDiskSpaceTotalSize( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get error code that caused the database to force itself to close. This should - * be one of the values in {@link xflaim.RCODE RCODE}. - * @return Returns error code that caused the database to force itself to close. - * @throws XFlaimException - */ - public int getMustCloseRC() throws XFlaimException - { - return( _getMustCloseRC( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Get error code that caused the current transaction to require an abort. - * This may be one of the values in {@link xflaim.RCODE RCODE}, but not - * necessarily. - * @return Returns error code that caused the current transaction to require - * itself to abort. - * @throws XFlaimException - */ - public int getAbortRC() throws XFlaimException - { - return( _getAbortRC( m_this)); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Force the current transaction to abort. This method should be called - * when the code should not be the code that aborts the transation, but - * wants to require that the transaction be aborted by whatever module has - * the authority to abort or commit the transaction. An error code may be - * set to indicate what error condition is causing the transaction to be - * aborted. - * @param iRc Error code that indicates why the transaction is aborting. - * @throws XFlaimException - */ - public void setMustAbortTrans( - int iRc) throws XFlaimException - { - _setMustAbortTrans( m_this, iRc); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Enable encryption for this database. - * @throws XFlaimException - */ - public void enableEncryption() throws XFlaimException - { - _enableEncryption( m_this); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- - -#if TODO - /** - * Wrap the database key in a password. This method is called when it is - * desirable to move the database to a different machine. Normally, the - * database key is wrapped in the local NICI storage key - which means that - * the database can only be opened and accessed on that machine. -- Once - * the database key is wrapped in a password, the password must be - * supplied to the dbOpen method to open the database. - * @param sPassword Password the database key should be wrapped in. - * @throws XFlaimException - */ - public void wrapKey( - String sPassword) throws XFlaimException - { - _wrapKey( m_this, sPassword); - } -#endif - - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// rollOverDbKey +//----------------------------------------------------------------------------- #if TODO /** @@ -3507,9 +3781,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// getSerialNumber +//----------------------------------------------------------------------------- #if TODO /** @@ -3524,9 +3798,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// getCheckpointInfo. +//----------------------------------------------------------------------------- #if TODO /** @@ -3541,9 +3815,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// exportXML +//----------------------------------------------------------------------------- #if TODO /** @@ -3565,9 +3839,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// exportXML +//----------------------------------------------------------------------------- #if TODO /** @@ -3586,9 +3860,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// getLockWaiters +//----------------------------------------------------------------------------- #if TODO /** @@ -3606,9 +3880,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// setDeleteStatusObject +//----------------------------------------------------------------------------- #if TODO /** @@ -3627,9 +3901,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// setIndexingClientObject +//----------------------------------------------------------------------------- #if TODO /** @@ -3648,9 +3922,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// setIndexingStatusObject +//----------------------------------------------------------------------------- #if TODO /** @@ -3669,9 +3943,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// setCommitClientObject +//----------------------------------------------------------------------------- #if TODO /** @@ -3691,9 +3965,9 @@ namespace xflaim } #endif - //----------------------------------------------------------------------------- - // - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// upgrade +//----------------------------------------------------------------------------- #if TODO /**