public abstract class SimpleTransaction extends Object
This object does not implement any transaction control mechanisms such as 'commit' or 'rollback'. This object is most useful for setting up a short-term minimal transaction for modifying or querying some data in the database given on some view.
Modifier and Type | Method and Description |
---|---|
long |
currentUniqueID(TableName table_name)
Returns the current unique id for the given table name.
|
DebugLogger |
Debug()
Returns a DebugLogger object that we use to log debug messages to.
|
protected void |
disposeAllIndices()
Disposes of all IndexSet objects currently accessed by this Transaction.
|
protected com.mckoi.database.MasterTableDataSource |
findVisibleTable(TableName table_name,
boolean ignore_case)
Searches through the list of tables visible within this transaction and
returns the MasterTableDataSource object with the given name.
|
protected void |
flushTableCache(TableName table_name)
Flushes the table cache and purges the cache of the entry for the given
table name.
|
DataTableDef |
getDataTableDef(TableName table_name)
Returns the DataTableDef for the table with the given name that is
visible within this transaction.
|
protected DataTableDef |
getDynamicDataTableDef(TableName table_name)
Returns the DataTableDef for a dynamic table defined in this transaction.
|
protected MutableTableDataSource |
getDynamicTable(TableName table_name)
If this transaction implementation defines dynamic tables (tables whose
content is determined by some function), this should return the
table here as a MutableTableDataSource object.
|
protected TableName[] |
getDynamicTableList()
Returns a list of all dynamic table names.
|
protected String |
getDynamicTableType(TableName table_name)
Returns a string type describing the type of the dynamic table.
|
TransactionSystem |
getSystem()
Returns the TransactionSystem that this Transaction is part of.
|
MutableTableDataSource |
getTable(TableName table_name)
Returns a MutableTableDataSource object that represents the table with
the given name within this transaction.
|
TableDataSource |
getTableDataSource(TableName table_name)
Returns a TableDataSource object that represents the table with the
given name within this transaction.
|
TableName[] |
getTableList()
Returns a list of table names that are visible within this transaction.
|
String |
getTableType(TableName table_name)
Returns the type of the table object with the given name.
|
protected com.mckoi.database.MasterTableDataSource |
getVisibleTable(int n)
Returns a MasterTableDataSource object representing table 'n' in the set
of tables visible in this transaction.
|
protected int |
getVisibleTableCount()
Returns the number of visible tables being managed by this transaction.
|
protected ArrayList |
getVisibleTables()
Returns a list of all visible tables.
|
protected boolean |
isDynamicTable(TableName table_name)
Returns true if the given table name is a dynamically generated table and
is not a table that is found in the table list defined in this transaction
object.
|
boolean |
isReadOnly()
Returns true if the transaction is read-only, otherwise returns false.
|
long |
lastSequenceValue(TableName name)
Returns the sequence value for the given sequence generator that
was last returned by a call to 'nextSequenceValue'.
|
long |
nextSequenceValue(TableName name)
Requests of the sequence generator the next value from the sequence.
|
long |
nextUniqueID(TableName table_name)
Atomically returns a unique id that can be used as a seed for a set of
unique identifiers for a table.
|
TableName |
resolveToTableName(String current_schema,
String name,
boolean case_insensitive)
Resolves the given string to a table name, throwing an exception if
the reference is ambiguous.
|
protected void |
setIndexSetForTable(com.mckoi.database.MasterTableDataSource table,
IndexSet index_set)
Sets the IndexSet for the given MasterTableDataSource object in this
transaction.
|
void |
setReadOnly()
Sets this transaction as read only.
|
void |
setSequenceValue(TableName name,
long value)
Sets the sequence value for the given sequence generator.
|
void |
setUniqueID(TableName table_name,
long unique_id)
Sets the unique id for the given table name.
|
boolean |
tableExists(TableName table_name)
Returns true if the database table object with the given name exists
within this transaction.
|
TableName |
tryResolveCase(TableName table_name)
Attempts to resolve the given table name to its correct case assuming
the table name represents a case insensitive version of the name.
|
public void setReadOnly()
public boolean isReadOnly()
public final TransactionSystem getSystem()
protected final ArrayList getVisibleTables()
public final DebugLogger Debug()
protected int getVisibleTableCount()
protected com.mckoi.database.MasterTableDataSource getVisibleTable(int n)
protected com.mckoi.database.MasterTableDataSource findVisibleTable(TableName table_name, boolean ignore_case)
protected final void setIndexSetForTable(com.mckoi.database.MasterTableDataSource table, IndexSet index_set)
protected boolean isDynamicTable(TableName table_name)
It is intended this is implemented by derived classes to handle dynamically generated tables (tables based on some function or from an external data source)
protected MutableTableDataSource getDynamicTable(TableName table_name)
It is intended this is implemented by derived classes to handle dynamically generated tables (tables based on some function or from an external data source)
protected DataTableDef getDynamicDataTableDef(TableName table_name)
It is intended this is implemented by derived classes to handle dynamically generated tables (tables based on some function or from an external data source)
protected String getDynamicTableType(TableName table_name)
It is intended this is implemented by derived classes to handle dynamically generated tables (tables based on some function or from an external data source)
protected TableName[] getDynamicTableList()
It is intended this is implemented by derived classes to handle dynamically generated tables (tables based on some function or from an external data source)
protected void flushTableCache(TableName table_name)
protected void disposeAllIndices()
public TableDataSource getTableDataSource(TableName table_name)
public MutableTableDataSource getTable(TableName table_name)
If the table does not exist then an exception is thrown.
public DataTableDef getDataTableDef(TableName table_name)
Returns null if table name doesn't refer to a table that exists.
public TableName[] getTableList()
public boolean tableExists(TableName table_name)
public TableName tryResolveCase(TableName table_name)
public String getTableType(TableName table_name)
public TableName resolveToTableName(String current_schema, String name, boolean case_insensitive)
public long nextSequenceValue(TableName name)
NOTE: This does NOT check that the user owning this connection has the correct privs to perform this operation.
public long lastSequenceValue(TableName name)
NOTE: This does NOT check that the user owning this connection has the correct privs to perform this operation.
public void setSequenceValue(TableName name, long value)
NOTE: This does NOT check that the user owning this connection has the correct privs to perform this operation.
public long currentUniqueID(TableName table_name)
public long nextUniqueID(TableName table_name)
NOTE: This change can not be rolled back.
public void setUniqueID(TableName table_name, long unique_id)
Copyright © 2015. All rights reserved.