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 ISqlJetBtree
public SqlJetTransactionMode getTransMode()
ISqlJetBtree
getTransMode
in interface ISqlJetBtree
public boolean invokeBusyHandler(int number)
public void enter()
ISqlJetBtree
enter
in interface ISqlJetBtree
public void leave()
ISqlJetBtree
leave
in interface ISqlJetBtree
public void open(java.io.File filename, ISqlJetDbHandle db, java.util.Set<SqlJetBtreeFlags> flags, SqlJetFileType type, java.util.Set<SqlJetFileOpenPermission> permissions) throws SqlJetException
ISqlJetBtree
open
in interface ISqlJetBtree
filename
- Name of database file to opendb
- Associated database connectionflags
- FlagsSqlJetException
public void close() throws SqlJetException
ISqlJetBtree
close
in interface ISqlJetBtree
SqlJetException
public void setCacheSize(int mxPage)
ISqlJetBtree
setCacheSize
in interface ISqlJetBtree
public int getCacheSize()
getCacheSize
in interface ISqlJetBtree
public void setSafetyLevel(SqlJetSafetyLevel level)
ISqlJetBtree
setSafetyLevel
in interface ISqlJetBtree
public SqlJetSafetyLevel getSafetyLevel()
getSafetyLevel
in interface ISqlJetBtree
public void setJournalMode(SqlJetPagerJournalMode mode)
setJournalMode
in interface ISqlJetBtree
public SqlJetPagerJournalMode getJournalMode()
getJournalMode
in interface ISqlJetBtree
public boolean isSyncDisabled()
ISqlJetBtree
isSyncDisabled
in interface ISqlJetBtree
public void setPageSize(int pageSize, int reserve) throws SqlJetException
ISqlJetBtree
setPageSize
in interface ISqlJetBtree
SqlJetException
public int getPageSize()
ISqlJetBtree
getPageSize
in interface ISqlJetBtree
public void setMaxPageCount(int mxPage) throws SqlJetException
ISqlJetBtree
setMaxPageCount
in interface ISqlJetBtree
SqlJetException
public int getReserve()
getReserve
in interface ISqlJetBtree
public void setAutoVacuum(SqlJetAutoVacuumMode autoVacuum) throws SqlJetException
ISqlJetBtree
setAutoVacuum
in interface ISqlJetBtree
SqlJetException
public SqlJetAutoVacuumMode getAutoVacuum()
ISqlJetBtree
getAutoVacuum
in interface ISqlJetBtree
public void beginTrans(SqlJetTransactionMode mode) throws SqlJetException
ISqlJetBtree
beginTrans
in interface ISqlJetBtree
SqlJetException
public void commitPhaseOne(java.lang.String master) throws SqlJetException
ISqlJetBtree
commitPhaseOne
in interface ISqlJetBtree
SqlJetException
public void commitPhaseTwo() throws SqlJetException
ISqlJetBtree
commitPhaseTwo
in interface ISqlJetBtree
SqlJetException
public void commit() throws SqlJetException
ISqlJetBtree
commit
in interface ISqlJetBtree
SqlJetException
public void rollback() throws SqlJetException
ISqlJetBtree
rollback
in interface ISqlJetBtree
SqlJetException
public void beginStmt() throws SqlJetException
ISqlJetBtree
beginStmt
in interface ISqlJetBtree
SqlJetException
public void commitStmt() throws SqlJetException
ISqlJetBtree
commitStmt
in interface ISqlJetBtree
SqlJetException
public void rollbackStmt() throws SqlJetException
ISqlJetBtree
rollbackStmt
in interface ISqlJetBtree
SqlJetException
protected void pageReinit(ISqlJetPage page) throws SqlJetException
page
- SqlJetException
public int createTable(java.util.Set<SqlJetBtreeTableCreateFlags> flags) throws SqlJetException
ISqlJetBtree
createTable
in interface ISqlJetBtree
SqlJetException
public boolean isInTrans()
ISqlJetBtree
isInTrans
in interface ISqlJetBtree
public boolean isInStmt()
ISqlJetBtree
isInStmt
in interface ISqlJetBtree
public boolean isInReadTrans()
ISqlJetBtree
isInReadTrans
in interface ISqlJetBtree
public SqlJetSchema getSchema()
ISqlJetBtree
getSchema
in interface ISqlJetBtree
public void setSchema(SqlJetSchema schema)
setSchema
in interface ISqlJetBtree
public boolean isSchemaLocked()
ISqlJetBtree
isSchemaLocked
in interface ISqlJetBtree
public void lockTable(int table, boolean isWriteLock)
ISqlJetBtree
lockTable
in interface ISqlJetBtree
public void savepoint(SqlJetSavepointOperation op, int savepoint) throws SqlJetException
ISqlJetBtree
savepoint
in interface ISqlJetBtree
SqlJetException
public java.io.File getFilename()
ISqlJetBtree
getFilename
in interface ISqlJetBtree
public java.io.File getDirname()
ISqlJetBtree
getDirname
in interface ISqlJetBtree
public java.io.File getJournalname()
ISqlJetBtree
getJournalname
in interface ISqlJetBtree
public void copyFile(ISqlJetBtree from) throws SqlJetException
ISqlJetBtree
copyFile
in interface ISqlJetBtree
SqlJetException
public void incrVacuum() throws SqlJetException
ISqlJetBtree
incrVacuum
in interface ISqlJetBtree
SqlJetException
public int dropTable(int table) throws SqlJetException
ISqlJetBtree
dropTable
in interface ISqlJetBtree
SqlJetException
public void clearTable(int table, int[] change) throws SqlJetException
ISqlJetBtree
clearTable
in interface ISqlJetBtree
SqlJetException
public int getMeta(int idx) throws SqlJetException
ISqlJetBtree
getMeta
in interface ISqlJetBtree
SqlJetException
public void updateMeta(int idx, int value) throws SqlJetException
ISqlJetBtree
updateMeta
in interface ISqlJetBtree
SqlJetException
public void tripAllCursors(SqlJetErrorCode errCode) throws SqlJetException
ISqlJetBtree
tripAllCursors
in interface ISqlJetBtree
SqlJetException
public ISqlJetPager getPager()
ISqlJetBtree
getPager
in interface ISqlJetBtree
public ISqlJetBtreeCursor getCursor(int table, boolean wrFlag, ISqlJetKeyInfo keyInfo) throws SqlJetException
ISqlJetBtree
getCursor
in interface ISqlJetBtree
table
- Index of root pagewrFlag
- true for writing. false for read-onlykeyInfo
- First argument to compare functionSqlJetException
public void closeAllCursors() throws SqlJetException
closeAllCursors
in interface ISqlJetBtree
SqlJetException
public java.lang.String integrityCheck(int[] root, int root2, int mxErr, int[] err)
ISqlJetBtree
integrityCheck
in interface ISqlJetBtree
Copyright © 2009-2010 TMate Software Ltd. All Rights Reserved.