com.mckoi.database

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » mckoi » com.mckoi.database 
com.mckoi.database
com.mckoi.database - The core database classes for Mckoi

The core database classes for Mckoi.

Data Representation

A database is represented by a single TableDataConglomerate, which contains a collection of MasterTableDataSource objects, each of which represents a single table, including both committed and uncommitted rows.

Access to a table is usually through the TableDataSource interface, or its subclass MutableTableDataSource The MasterTableDataSource objects wrap themselves in an instance of the private class MasterTableDataSource.MMutableTableDataSource, which implements MutableTableDataSource.

The format of a table is defined by DataTableDef, which is returned by TableDataSource.getDataTableDef, and which does not change during the lifetime of the table; if the table format is changed, a new MasterTableDataSource is created within the Transaction with the new format, and the data and unchanged columns from the old table are copied to the new one. The format of a column is defined by DataTableColumnDef.

Modifications to a row of a table are handled by a RowData, which carries a reference to the TableDataSource which it modified, and from which data is retrieved. Each column within the row is represented by a DataCell, which is either retrieved from the table or created by DataCellFactory.

Transactions

A database can be associated with one or more simultaneous Transaction objects. All changes to the data in the database are done through Transactions. The current set of open Transaction objects is managed by an OpenTransactionList object, which is pointed to by both the TableDataConglomerate and all of the MasterTableDataSource objects.

Changes to a row are handled by creating a new row in the MasterTableDataSource containing the changed data plus any old data which is unchanged. The data for the modified row are kept in a RowData, which references a QueryContext, which references a DatabaseConnection, which references a Transaction, which is the Transaction under which that change was made. Each field of the row is represented by a DataCell.

When an application issues an SQL request to update the database, it eventually makes it down to Statement.evaluate, for example in Insert. That evaluate method uses its DatabaseConnection to get a DataTable for a table name, which is a wrapper around the MutableTableDataSource returned by the DatabaseConnection's Transaction for the table of that name. The MutableTableDataSource (created by Transaction.getTable) is in turn a wrapper around a MasterTableDataSource created using the private class MasterTableDataSource.MMutableTableDataSource. The Statement uses its DataTable to create a RowData, then passes it to its DataTable, which passes it to the MutableTableDataSource, which passes it to the MasterTableDataSource, which actually makes the change.

The Transaction maintains a TransactionJournal, in which are listed all of the tables which have been changed by the Transaction.

Eventually the Transaction is closed (committed or rolled back), which is handled by the TableDataConglomerate ( processCommit or processRollback), which, for each MasterTableDataSource, gets a MasterTableJournal for it from the TransactionJournal specifying what changes have been made in that table from this Transaction, and tells that MasterTableDataSource to commit or roll back the changes in that MasterTableJournal.

Locking

Locking is used to control concurrent access by two requests in the same Transaction. This is handled during query execution in JDBCDatabaseInterface.execQuery

Each DatabaseConnection has associated with it a single LockingMechanism object, which is used to lock and unlock the DatabaseConnection's Transaction as a whole. The active lock is represented by a LockHandle, which is returned by LockingMechanism.lockTables, and which is passed back to LockingMechanism.unlockTables to drop the lock.

A lock on an individual table is represented by a Lock, which is kept in a LockingQueue, which maintains the link to the locked table.

Update Sequence

When a change is made to the database (insert, update, or delete), the following list shows the sequence in which various steps are taken:

Java Source File NameTypeComment
AbstractAggregateFunction.javaClass Provides convenience methods for handling aggregate functions (functions that are evaluated over a grouping set).
AbstractDataTable.javaClass This is the abstract class implemented by a DataTable like table.
AbstractFunction.javaClass An abstract implementation of Function.
AbstractInternalTableInfo.javaClass An implementation of InternalTableInfo that provides a number of methods to aid in the productions of the InternalTableInfo interface.
AbstractInternalTableInfo2.javaClass An implementation of InternalTableInfo that provides a number of methods to aid in the productions of the InternalTableInfo interface for a transaction specific model of a set of tables that is based on a single system table.
AbstractQueryContext.javaClass
Assignment.javaClass An assignment from a variable to an expression.
BlindSearch.javaClass This is a scheme that performs a blind search of a given set.
BlobStore.javaClass A structure inside an Area that maintains the storage of any number of large binary objects.
BlobStoreInterface.javaInterface A very restricted interface for accessing a blob store.
Caster.javaClass Methods to choose and perform casts from database type to Java types.
CellBufferInputStream.javaClass This is a reusable cell stream object that is extended from the ByteArrayInputStream class, which provides methods for reusing the object on a different byte[] arrays.
CellBufferOutputStream.javaClass This is a ByteArrayOutputStream that allows access to the underlying byte array.
CellInput.javaInterface
CellInputStream.javaClass An implementation of CellInput that reads data from an underlying stream.
CollatedBaseSearch.javaClass An implementation of SelectableScheme that is based on some collated set of data.
CompositeTable.javaClass A composite of two or more datasets used to implement UNION, INTERSECTION, and DIFFERENCE.
ConnectionTriggerManager.javaClass A trigger manager on a DatabaseConnection that maintains a list of all triggers set in the database, and the types of triggers they are.
ConvertUtils.javaClass Various static database convertion tools for converting for upgrading parts of the database.
CorrelatedVariable.javaClass A wrapper for a variable in a sub-query that references a column outside of the current query.
Database.javaClass The representation of a single database in the system.
DatabaseConnection.javaClass An object that represents a connection to a Database.
DatabaseConstants.javaInterface Contant static values that determine several parameters of the database operation.
DatabaseConstraintViolationException.javaClass A database exception that represents a constraint violation.
DatabaseDispatcher.javaClass This is the database system dispatcher thread.
DatabaseException.javaClass Exception thrown where various problems occur within the database.
DatabaseProcedure.javaInterface This interface represents a database procedure that is executed on the server side.
DatabaseQueryContext.javaClass An implementation of a QueryContext based on a DatabaseConnection object.
DatabaseSystem.javaClass This class provides information about shared resources available for the entire database system running in this VM.
DataCellCache.javaClass This object represents a cache for accesses to the the data cells within a Table.
DataCellSerialization.javaClass An object that manages the serialization and deserialization of objects to the database file system.
DataIndexDef.javaClass Represents index meta-information on a table.
DataIndexSetDef.javaClass Represents the meta-data for a set of indexes of a table.
DataTable.javaClass DataTable is a wrapper for a MutableTableDataSource that fits into the query hierarchy level.
DataTableColumnDef.javaClass All the information regarding a column in a table.
DataTableDef.javaClass A definition of a table.
DataTableFile.javaInterface This interface handles the abstraction of retreiving information from a database file.
DataTableFilter.javaClass This object sits on top of a DataTable object filtering out certain types of calls.
DataTableListener.javaInterface A DataTableListener is notified of all modifications to the raw entries of the data table.
DefaultDataTable.javaClass This represents a default implementation of a DataTable.
DumpHelper.javaClass A helper class for the 'Table.dumpTo' method.
Expression.javaClass An expression that can be evaluated in a statement.
ExpressionPreparer.javaInterface An interface used to prepare an Expression object.
FilterTable.javaClass A table that is a filter for another table.
FixedRecordList.javaClass A structure that provides a fast way to read and write fixed sized nodes in a Store object.
FixedSizeDataStore.javaClass A file format that allows for the very quick retreival of data that is stored within it.
Function.javaInterface Represents a function that is part of an expression to be evaluated.
FunctionDef.javaClass A definition of a function including its name and parameters.
FunctionFactory.javaClass A factory that generates Function objects given a function name and a set of expression's that represent parameters.
FunctionInfo.javaInterface Meta information about a function.
FunctionLookup.javaInterface An interface that resolves and generates a Function objects given a FunctionDef object.
FunctionTable.javaClass A table that has a number of columns and as many rows as the refering table.
GrantManager.javaClass A class that manages the grants on a database for a given database connection and user.
GroupHelper.javaClass This is a static class that provides the functionality for seperating a table into distinct groups.
GroupResolver.javaInterface Similar to VariableResolver, this method is used by grouping Functions to find information about the current group being evaluated (used for evaluating aggregate functions).
GTConnectionInfoDataSource.javaClass An implementation of MutableTableDataSource that presents the current connection information.

NOTE: This is not designed to be a long kept object.

GTCurrentConnectionsDataSource.javaClass An implementation of MutableTableDataSource that presents the current list of connections on the database.

NOTE: This is not designed to be a long kept object.

GTDataSource.javaClass A base class for a dynamically generated data source.
GTPrivMapDataSource.javaClass A GTDataSource that maps a Privs 11-bit set to strings that represent the priv in human understandable string.
GTProductDataSource.javaClass An implementation of MutableTableDataSource that models information about the software.

NOTE: This is not designed to be a long kept object.

GTSQLTypeInfoDataSource.javaClass A GTDataSource that models all SQL types that are available.

NOTE: This is not designed to be a long kept object.

GTStatisticsDataSource.javaClass An implementation of MutableTableDataSource that presents database statistical information.

NOTE: This is not designed to be a long kept object.

GTTableColumnsDataSource.javaClass An implementation of MutableTableDataSource that presents information about the columns of all tables in all schema.

NOTE: This is not designed to be a long kept object.

GTTableInfoDataSource.javaClass An implementation of MutableTableDataSource that presents information about the tables in all schema.

NOTE: This is not designed to be a long kept object.

IndexSet.javaInterface A set of list of indexes.
IndexSetStore.javaClass A class that manages the storage of a set of transactional index lists in a way that is fast to modify.
IndexStore.javaClass A class that manages the storage of a set of transactional index lists in a way that is fast to modify.
INHelper.javaClass This is a static class that provides methods for performing the Query table command 'in' and 'not in'.
InsertSearch.javaClass This is a SelectableScheme similar in some ways to the binary tree.
InternalFunctionFactory.javaClass A FunctionFactory for all internal SQL functions (including aggregate, mathematical, string functions).
InternalJDBCHelper.javaClass Helper and convenience methods and classes for creating a JDBC interface that has direct access to an open transaction of a DatabaseConnection.
InternalTableInfo.javaInterface A class that acts as a container for any system tables that are generated from information inside the database engine.
JoinedTable.javaClass A Table that represents the result of one or more other tables joined together.
JoiningSet.javaClass Used in TableSet to describe how we naturally join the tables together. This is used when the TableSet has evaluated the search condition and it is required for any straggling tables to be naturally joined.
Lock.javaClass This is a lock on a table in the LockingMechanism class.
LockHandle.javaClass This represents a handle for a series of locks that a query has over the tables in a database.
LockingMechanism.javaClass This class represents a model for locking the tables in a database during any sequence of concurrent read/write accesses.

Every table in the database has an 'access_queue' that is generated the first time the table is accessed.

LockingQueue.javaClass This class is used in the 'LockingMechanism' class.
MasterTableDataSource.javaClass A master table data source provides facilities for read/writing and maintaining low level data in a table.
MasterTableGarbageCollector.javaClass A row garbage collector for a master table data source that manages garbage collection over a MasterTableDataSource object.
MasterTableJournal.javaClass A journal of changes that occured to a table in a data conglomerate during a transaction.
MasterTableListener.javaInterface An interface that is notified of add/remove events on a MasterTableDataSource.
MultiVersionTableIndices.javaClass This class manages a set of indices for a table over different versions. The indices include the list of rows (required), and any index data (optional).
MutableTableDataSource.javaInterface A mutable data source that allows for the addition and removal of rows.
NaturallyJoinedTable.javaClass A table that is the cartesian product of two tables.
OpenTransactionList.javaClass The list of all currently open transactions.
Operator.javaClass An operator for an expression.
OuterTable.javaClass A Table class for forming OUTER type results.
ParameterSubstitution.javaClass An object that represents a constant value that is to be lately binded to a constant value in an Expression.
PatternSearch.javaClass This is a static class that performs the operations to do a pattern search on a given column of a table.
Privileges.javaClass A set of privileges to grant a user for an object.
ProcedureConnection.javaInterface An interface for accessing a database connection inside a stored procedure.
ProcedureException.javaClass An exception that is generated from a stored procedure when some erronious condition occurs.
ProcedureManager.javaClass A DatabaseConnection procedure manager.
ProcedureName.javaClass The name of a procedure as understood by a ProcedureManager.
QueryContext.javaInterface Facts about a particular query including the root table sources, user name of the controlling context, sequence state, etc.
QueryPlan.javaClass Various helper methods for constructing a plan tree, and the plan node implementations themselves.
QueryPlanNode.javaInterface A node element of a query plan tree.
RawDiagnosticTable.javaInterface An interface that allows for the inspection and repair of the raw data in a file.
RawTableInformation.javaClass This object represents the lowest level DataTable information of a given VirtualTable.
ReferenceTable.javaClass This is an implementation of a Table that references a DataTable as its parent.
RegexLibrary.javaInterface An interface that links with a Regex library.
RIDList.javaClass This is an optimization to help sorting over a column in a table.
RootTable.javaInterface Interface that is implemented by all Root tables.
RowData.javaClass Represents a row of data to be added into a table.
RowEnumeration.javaInterface This enumeration allows for access to a tables rows.
SchemaDef.javaClass A definition of a schema.
SelectableRange.javaClass An object that represents a range of values to select from a list.
SelectableRangeSet.javaClass Represents a complex normalized range of a list.
SelectableScheme.javaClass Represents a base class for a mechanism to select ranges from a given set. Such schemes could include BinaryTree, Hashtable or just a blind search.

A given element in the set is specified through a 'row' integer whose contents can be obtained through the 'table.getCellContents(column, row)'. Every scheme is given a table and column number that the set refers to. While a given set element is refered to as a 'row', the integer is really only a pointer into the set list which can be de-referenced with a call to table.getCellContents(row).

SequenceManager.javaClass An object that manages the creation and removal of sequence keys, and that offers access to the sequence values (possibly cached).
SimpleRowEnumeration.javaClass A RowEnumeration implementation that represents a sequence of rows that can be referenced in incremental order between 0 and row_count (exclusive).
SimpleTableQuery.javaClass A simple convenience interface for querying a MutableTableDataSource instance.
SimpleTransaction.javaClass An simple implementation of Transaction that provides various facilities for implementing a Transaction object on a number of MasterTableDataSource tables.
StatementCache.javaClass A cache that maintains a serialized set of StatementTree objects that can be deserialized on demand.
StatementException.javaClass An error that is thrown when there is erronious information in a statement.
StatementTree.javaClass A serializable container class for a parsed query language statement.
StatementTreeObject.javaInterface An complex object that is to be contained within a StatementTree object.
StateStore.javaClass A store that manages the current state of all tables in a Conglomerate.
StoreSystem.javaInterface An object that creates and manages the Store objects that the database engine uses to represent itself on an external medium such as a disk, and that constitute the low level persistent data format.

This interface is an abstraction of the database persistence layer.

SubsetColumnTable.javaClass This object is a filter that sits atop a Table object.
SystemQueryContext.javaClass A QueryContext that only wraps around a TransactionSystem and does not provide implementations for the 'getTable', and 'getDatabase' methods.
Table.javaClass This is a definition for a table in the database.
TableAccessState.javaClass This class provides very limited access to a Table object.
TableBackedCache.javaClass A TableBackedCache is a special type of a cache in a DataTableConglomerate that is backed by a table in the database.
TableCommitModificationEvent.javaClass An object that encapsulates all row modification information about a table when a change to the table is about to be committed.
TableDataConglomerate.javaClass A conglomerate of data that represents the contents of all tables in a complete database.
TableDataSource.javaInterface This interface represents the source of data in a table.
TableDescriptions.javaClass An object that is a key part of Database.
TableFunctions.javaClass A number of functions that are table set functions such as simple select operations, joins, unions, sub-query operations, etc.
TableModificationEvent.javaClass The event information of when a table is modified inside a transaction.
TableName.javaClass A name of a table and any associated referencing information.
TableQueryDef.javaInterface An interface to an object that describes characteristics of a table based object in the database.
TArrayType.javaClass An implementation of TType for an expression array.
TBinaryType.javaClass An implementation of TType for a binary block of data.
TBooleanType.javaClass An implementation of TType for a boolean value.
TDateType.javaClass An implementation of TType for date objects.
TemporaryTable.javaClass This class represents a temporary table that is built from data that is not related to any underlying DataTable object from the database.
TJavaObjectType.javaClass An implementation of TType for a java object of possibly defined type.
TNullType.javaClass An implementation of TType that represents a NULL type.
TNumericType.javaClass An implementation of TType for a number.
TObject.javaClass A TObject is a strongly typed object in a database engine.
TQueryPlanType.javaClass An implementation of TType for a query plan value.
Transaction.javaClass An open transaction that manages all data access to the TableDataConglomerate.
TransactionException.javaClass Thrown when a transaction error happens.
TransactionJournal.javaClass The list of all primitive operations to the database that a transaction performed.
TransactionModificationListener.javaInterface A listener that is notified of table modification events made by a transaction, both immediately inside a transaction and when a transaction commits.
TransactionSystem.javaClass A class that provides information and global functions for the transaction layer in the engine.
TriggerEvent.javaClass A trigger event represents a high level action that occured in the database.
TriggerListener.javaInterface A listener that can listen for high layer trigger events.
TriggerManager.javaClass An object that manages high level trigger events within a Database context. This manager is designed to manage the map between session and triggers being listened for.
TStringType.javaClass An implementation of TType for a String.
TType.javaClass A TType object represents a type in a database engine.
User.javaClass Encapsulates the information about a single user logged into the system. The class provides access to information in the user database.

This object also serves as a storage for session state information.

UserAccessException.javaClass An exception that is thrown when the user is not permitted to perform a certain action.
UserManager.javaClass A class that manages the list of users connected to the engine.
V1FileStoreSystem.javaClass An implementation of StoreSystem that manages persistant data through the native file system.
V1HeapStoreSystem.javaClass An implementation of StoreSystem that stores all persistent data on the heap using HeapStore objects.
V1MasterTableDataSource.javaClass A MasterTableDataSource that uses IndexStore and VariableSizeDataStore as its backing mechanism for representing the table structure in a file on disk.
V2MasterTableDataSource.javaClass A MasterTableDataSource that is backed by a non-shared com.mckoi.store.Store object.
Variable.javaClass This represents a column name that may be qualified.
VariableResolver.javaInterface An interface to resolve a variable name to a constant object.
VariableSizeDataStore.javaClass Provides a mechanism for storing variable length data in a file which can quickly be indexed via a reference number.
ViewDef.javaClass A ViewDef object is a definition of a view stored in the database.
ViewManager.javaClass A DatabaseConnection view manager.
VirtualTable.javaClass A VirtualTable is a representation of a table whose rows are actually physically stored in another table.
WorkerPool.javaClass Maintains a pool of worker threads that are used to dispatch commands to a Database sub-system.
WorkerThread.javaClass This is a worker thread.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.