public class SqlJetBtree extends java.lang.Object implements ISqlJetBtree
SQLITE_FILE_HEADER, SQLJET_DEFAULT_AUTOVACUUM, zMagicHeader| Constructor and Description |
|---|
SqlJetBtree() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginStmt()
Start a statement subtransaction.
|
void |
beginTrans(SqlJetTransactionMode mode)
Attempt to start a new transaction.
|
void |
clearTable(int table,
int[] change)
Delete all information from a single table in the database.
|
void |
close()
Close an open database and invalidate all cursors.
|
void |
closeAllCursors() |
void |
commit()
Do both phases of a commit.
|
void |
commitPhaseOne(java.lang.String master)
This routine does the first phase of a two-phase commit.
|
void |
commitPhaseTwo()
Commit the transaction currently in progress.
|
void |
commitStmt()
Commit the statment subtransaction currently in progress.
|
void |
copyFile(ISqlJetBtree from)
Copy the complete content of from.
|
int |
createTable(java.util.Set<SqlJetBtreeTableCreateFlags> flags)
Create a new BTree table.
|
int |
dropTable(int table)
Erase all information in a table and add the root of the table to the
freelist.
|
void |
enter()
Enter a mutex on the given BTree object.
|
SqlJetAutoVacuumMode |
getAutoVacuum()
Return the value of the 'auto-vacuum' property.
|
int |
getCacheSize() |
ISqlJetBtreeCursor |
getCursor(int table,
boolean wrFlag,
ISqlJetKeyInfo keyInfo)
Create a new cursor for the BTree whose root is on the page iTable.
|
ISqlJetDbHandle |
getDb() |
java.io.File |
getDirname()
Return the pathname of the directory that contains the database file.
|
java.io.File |
getFilename()
Return the full pathname of the underlying database file.
|
SqlJetPagerJournalMode |
getJournalMode() |
java.io.File |
getJournalname()
Return the pathname of the journal file for this database.
|
int |
getMeta(int idx)
Read the meta-information out of a database file.
|
ISqlJetPager |
getPager()
Return the pager associated with a BTree.
|
int |
getPageSize()
Return the currently defined page size
|
int |
getReserve() |
SqlJetSafetyLevel |
getSafetyLevel() |
SqlJetSchema |
getSchema()
This function returns a pointer to a blob of memory associated with a
single shared-btree.
|
SqlJetTransactionMode |
getTransMode()
Get transaction mode
|
void |
incrVacuum()
A write-transaction must be opened before calling this function.
|
java.lang.String |
integrityCheck(int[] root,
int root2,
int mxErr,
int[] err)
This routine does a complete check of the given BTree file.
|
boolean |
invokeBusyHandler(int number)
Invoke the busy handler for a btree.
|
boolean |
isInReadTrans()
Return true if a read (or write) transaction is active.
|
boolean |
isInStmt()
Return true if a statement transaction is active.
|
boolean |
isInTrans()
Return true if a transaction is active.
|
boolean |
isSchemaLocked()
Return true if another user of the same shared btree as the argument
handle holds an exclusive lock on the sqlite_master table.
|
boolean |
isSyncDisabled()
Return TRUE if the given btree is set to safety level 1.
|
void |
leave()
Exit the recursive mutex on a Btree.
|
void |
lockTable(int table,
boolean isWriteLock)
Obtain a lock on the table whose root page is iTab.
|
void |
open(java.io.File filename,
ISqlJetDbHandle db,
java.util.Set<SqlJetBtreeFlags> flags,
SqlJetFileType type,
java.util.Set<SqlJetFileOpenPermission> permissions)
Open a database file.
|
protected void |
pageReinit(ISqlJetPage page)
During a rollback, when the pager reloads information into the cache so
that the cache is restored to its original state at the start of the
transaction, for each page restored this routine is called.
|
void |
rollback()
Rollback the transaction in progress.
|
void |
rollbackStmt()
Rollback the active statement subtransaction.
|
void |
savepoint(SqlJetSavepointOperation op,
int savepoint)
The second argument to this function, op, is always SAVEPOINT_ROLLBACK or
SAVEPOINT_RELEASE.
|
void |
setAutoVacuum(SqlJetAutoVacuumMode autoVacuum)
Change the 'auto-vacuum' property of the database.
|
void |
setCacheSize(int mxPage)
Change the limit on the number of pages allowed in the cache.
|
void |
setJournalMode(SqlJetPagerJournalMode mode) |
void |
setMaxPageCount(int mxPage)
Set the maximum page count for a database if mxPage is positive.
|
void |
setPageSize(int pageSize,
int reserve)
Change the default pages size and the number of reserved bytes per page.
|
void |
setSafetyLevel(SqlJetSafetyLevel level)
Change the way data is synced to disk in order to increase or decrease
how well the database resists damage due to OS crashes and power
failures.
|
void |
setSchema(SqlJetSchema schema) |
void |
tripAllCursors(SqlJetErrorCode errCode)
This routine sets the state to CURSOR_FAULT and the error code to errCode
for every cursor on BtShared that pBtree references.
|
void |
updateMeta(int idx,
int value)
Write meta-information back into the database.
|
public ISqlJetDbHandle getDb()
getDb in interface ISqlJetBtreepublic SqlJetTransactionMode getTransMode()
ISqlJetBtreegetTransMode in interface ISqlJetBtreepublic boolean invokeBusyHandler(int number)
public void enter()
ISqlJetBtreeenter in interface ISqlJetBtreepublic void leave()
ISqlJetBtreeleave in interface ISqlJetBtreepublic void open(java.io.File filename,
ISqlJetDbHandle db,
java.util.Set<SqlJetBtreeFlags> flags,
SqlJetFileType type,
java.util.Set<SqlJetFileOpenPermission> permissions)
throws SqlJetException
ISqlJetBtreeopen in interface ISqlJetBtreefilename - Name of database file to opendb - Associated database connectionflags - FlagsSqlJetExceptionpublic void close()
throws SqlJetException
ISqlJetBtreeclose in interface ISqlJetBtreeSqlJetExceptionpublic void setCacheSize(int mxPage)
ISqlJetBtreesetCacheSize in interface ISqlJetBtreepublic int getCacheSize()
getCacheSize in interface ISqlJetBtreepublic void setSafetyLevel(SqlJetSafetyLevel level)
ISqlJetBtreesetSafetyLevel in interface ISqlJetBtreepublic SqlJetSafetyLevel getSafetyLevel()
getSafetyLevel in interface ISqlJetBtreepublic void setJournalMode(SqlJetPagerJournalMode mode)
setJournalMode in interface ISqlJetBtreepublic SqlJetPagerJournalMode getJournalMode()
getJournalMode in interface ISqlJetBtreepublic boolean isSyncDisabled()
ISqlJetBtreeisSyncDisabled in interface ISqlJetBtreepublic void setPageSize(int pageSize,
int reserve)
throws SqlJetException
ISqlJetBtreesetPageSize in interface ISqlJetBtreeSqlJetExceptionpublic int getPageSize()
ISqlJetBtreegetPageSize in interface ISqlJetBtreepublic void setMaxPageCount(int mxPage)
throws SqlJetException
ISqlJetBtreesetMaxPageCount in interface ISqlJetBtreeSqlJetExceptionpublic int getReserve()
getReserve in interface ISqlJetBtreepublic void setAutoVacuum(SqlJetAutoVacuumMode autoVacuum) throws SqlJetException
ISqlJetBtreesetAutoVacuum in interface ISqlJetBtreeSqlJetExceptionpublic SqlJetAutoVacuumMode getAutoVacuum()
ISqlJetBtreegetAutoVacuum in interface ISqlJetBtreepublic void beginTrans(SqlJetTransactionMode mode) throws SqlJetException
ISqlJetBtreebeginTrans in interface ISqlJetBtreeSqlJetExceptionpublic void commitPhaseOne(java.lang.String master)
throws SqlJetException
ISqlJetBtreecommitPhaseOne in interface ISqlJetBtreeSqlJetExceptionpublic void commitPhaseTwo()
throws SqlJetException
ISqlJetBtreecommitPhaseTwo in interface ISqlJetBtreeSqlJetExceptionpublic void commit()
throws SqlJetException
ISqlJetBtreecommit in interface ISqlJetBtreeSqlJetExceptionpublic void rollback()
throws SqlJetException
ISqlJetBtreerollback in interface ISqlJetBtreeSqlJetExceptionpublic void beginStmt()
throws SqlJetException
ISqlJetBtreebeginStmt in interface ISqlJetBtreeSqlJetExceptionpublic void commitStmt()
throws SqlJetException
ISqlJetBtreecommitStmt in interface ISqlJetBtreeSqlJetExceptionpublic void rollbackStmt()
throws SqlJetException
ISqlJetBtreerollbackStmt in interface ISqlJetBtreeSqlJetExceptionprotected void pageReinit(ISqlJetPage page) throws SqlJetException
page - SqlJetExceptionpublic int createTable(java.util.Set<SqlJetBtreeTableCreateFlags> flags) throws SqlJetException
ISqlJetBtreecreateTable in interface ISqlJetBtreeSqlJetExceptionpublic boolean isInTrans()
ISqlJetBtreeisInTrans in interface ISqlJetBtreepublic boolean isInStmt()
ISqlJetBtreeisInStmt in interface ISqlJetBtreepublic boolean isInReadTrans()
ISqlJetBtreeisInReadTrans in interface ISqlJetBtreepublic SqlJetSchema getSchema()
ISqlJetBtreegetSchema in interface ISqlJetBtreepublic void setSchema(SqlJetSchema schema)
setSchema in interface ISqlJetBtreepublic boolean isSchemaLocked()
ISqlJetBtreeisSchemaLocked in interface ISqlJetBtreepublic void lockTable(int table,
boolean isWriteLock)
ISqlJetBtreelockTable in interface ISqlJetBtreepublic void savepoint(SqlJetSavepointOperation op, int savepoint) throws SqlJetException
ISqlJetBtreesavepoint in interface ISqlJetBtreeSqlJetExceptionpublic java.io.File getFilename()
ISqlJetBtreegetFilename in interface ISqlJetBtreepublic java.io.File getDirname()
ISqlJetBtreegetDirname in interface ISqlJetBtreepublic java.io.File getJournalname()
ISqlJetBtreegetJournalname in interface ISqlJetBtreepublic void copyFile(ISqlJetBtree from) throws SqlJetException
ISqlJetBtreecopyFile in interface ISqlJetBtreeSqlJetExceptionpublic void incrVacuum()
throws SqlJetException
ISqlJetBtreeincrVacuum in interface ISqlJetBtreeSqlJetExceptionpublic int dropTable(int table)
throws SqlJetException
ISqlJetBtreedropTable in interface ISqlJetBtreeSqlJetExceptionpublic void clearTable(int table,
int[] change)
throws SqlJetException
ISqlJetBtreeclearTable in interface ISqlJetBtreeSqlJetExceptionpublic int getMeta(int idx)
throws SqlJetException
ISqlJetBtreegetMeta in interface ISqlJetBtreeSqlJetExceptionpublic void updateMeta(int idx,
int value)
throws SqlJetException
ISqlJetBtreeupdateMeta in interface ISqlJetBtreeSqlJetExceptionpublic void tripAllCursors(SqlJetErrorCode errCode) throws SqlJetException
ISqlJetBtreetripAllCursors in interface ISqlJetBtreeSqlJetExceptionpublic ISqlJetPager getPager()
ISqlJetBtreegetPager in interface ISqlJetBtreepublic ISqlJetBtreeCursor getCursor(int table, boolean wrFlag, ISqlJetKeyInfo keyInfo) throws SqlJetException
ISqlJetBtreegetCursor in interface ISqlJetBtreetable - Index of root pagewrFlag - true for writing. false for read-onlykeyInfo - First argument to compare functionSqlJetExceptionpublic void closeAllCursors()
throws SqlJetException
closeAllCursors in interface ISqlJetBtreeSqlJetExceptionpublic java.lang.String integrityCheck(int[] root,
int root2,
int mxErr,
int[] err)
ISqlJetBtreeintegrityCheck in interface ISqlJetBtreeCopyright © 2009-2010 TMate Software Ltd. All Rights Reserved.