Creates a new DatabaseSchema instance.
Parameters: vdbName - the virtual database name this schema represents
DatabaseSchema
public DatabaseSchema(String vdbName, int nbOfTables)(Code)
Creates a new DatabaseSchema instance with a specified
number of tables.
Parameters: vdbName - the virtual database name this schema represents Parameters: nbOfTables - an int value
Adds a DatabaseTable describing a table of the database.
Parameters: table - the table to add
allTablesAreUnlockedOrLockedByTransaction
public boolean allTablesAreUnlockedOrLockedByTransaction(AbstractRequest request)(Code)
Returns true if all tables are not locked by anyone.
Parameters: request - request trying to execute (to indicate if it is inautocommit mode and the transaction id) true if all tables are unlocked.
Two DatabaseSchema are considered equal if they have the
same tables and the same procedures.
Parameters: other - the object to compare with true if the schemas are equals
Returns the DatabaseProcedure object matching the given
procedure name or null if not found.
Parameters: procedureKey - the procedure key to look for a DatabaseProcedure value or null
Returns the DatabaseProcedure object matching the given
procedure or null if not found.
Parameters: procedure - the procedure to look for a DatabaseProcedure value or null
Returns an HashMap of DatabaseProcedure
objects describing the database. The key entry is given by
DatabaseProcedure.getKey().
an HashMap of DatabaseProcedure
Returns the DatabaseTable object matching the given table
name or null if not found.
Parameters: tableName - the table name to look for a DatabaseTable value or null
Returns the DatabaseTable object matching the given table
name or null if not found. An extra boolean indicates if
table name matching is case sensitive or not.
Parameters: tableName - the table name to look for Parameters: isCaseSensitive - true if name matching must be case sensitive a DatabaseTable value or null
Get xml information about this schema.
xml formatted information on this database schema.
hasATableLockedByTransaction
public boolean hasATableLockedByTransaction(long transactionId)(Code)
Returns true if the given transaction locks (or wait for a lock) on any of
the table of this schema.
Parameters: transactionId - the transaction identifier true if the transaction locks or wait for a lock on at least onetable
hasProcedure
public boolean hasProcedure(String procedureName, int nbOfParameters)(Code)
Returns true if the given ProcedureName is
found in this schema.
Parameters: procedureName - the name of the procedure you are looking for Parameters: nbOfParameters - number of parameters of the stored procecdure true if the procedure has been found
Returns true if the given TableName is found
in this schema.
Parameters: tableName - the name of the table you are looking for true if the table has been found
Checks if this DatabaseSchema is a compatible subset of a
given schema. It means that all tables in this schema must be present with
the same definition in the other schema.
Parameters: other - the object to compare with true if the two schemas are compatible
Checks if this DatabaseSchema is compatible with the given
schema. It means that all tables in this schema that are common with the
other schema must be identical.
Parameters: other - the object to compare with true if the two schemas are compatible
Lock all tables that are not already locked by this transaction (assumes
that locks are free).
Parameters: request - request trying to execute (to indicate if it is inautocommit mode and the transaction id) list of locks acquired (excluding locks already acquired beforethis method was called)
Merges the given schema with the current one. All missing tables or columns
are added if no conflict is detected. An exception is thrown if the given
schema definition conflicts with the current one.
Parameters: databaseSchema - the schema to merge throws: SQLException - if the schemas conflict
releaseLocksOnAllTables
public void releaseLocksOnAllTables(long transactionId)(Code)
Release locks held by the given transaction on all tables.
Parameters: transactionId - the transaction identifier
When the database schema is reloaded, the locks held by active transactions
must be retained.
Parameters: oldSchema - the previous version of the schema.
Updates the given schema with the current one. All missing tables or
columns are added and if the given schema definition conflicts with the
current one, the current schema definition is overriden with the one that
is provided.
Parameters: databaseSchema - the schema to merge