Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[stellation-res] MySql Port

I have finally got the coding and testing portion of the MySql port
completed. I apologize for the time it took but I was also involved in the
final phase of a product release cycle at work. Testing has only been done
on Windows XP using MySql and Postgres as databases.

The central problem in providing support for MySql within Stellation is that
MySql does not support the implicit generation of indexes when handling
foreign key constraints, unlike other databases. Such indexes may be needed
in both the source (child) and referenced (parent) tables. Thus we are faced
with the problem of dealing with cross-table relationships when generating
the database schema.

We are also faced with the problem of adding tables to the database after
the initial tables have been generated. Currently, this problem arises when
adding the tables for the various artifacts. We need to be able to handle
the possible need for additional indexes to be created in existing tables.

I took the following approach in building a solution for this problem.

1. I decoupled the generation of the abstract tables describing the
Stellation database from the process of actually creating the tables in the
database. The set of tables is now accumulated in a collection stored in
BasicDatabase. This has the additional long-term advantage of making a
programmatically accessible version of the schema available to any component
that may need it.

2. I created additional nested classes within the Table class to allow the
recording of cross table relationships. This bookeeping is needed to support
the correct generation of indexes in tables that are created before other
tables that reference them.

3. I extended the BasicDatabase.createTable method to recognize when it may
be necessary to generate the additional indexes required by MySql and to do
so at the appropriate time.

4. I extended the BasicDatabase.createTable method to recognize when
additional indexes might be required for already existing tables and to
generate the additional indexes for those tables.

In addition a few smaller problems also had to be dealt with.
1. MySql treats BLOBS as case sensitive character data. If you want to store
binary data in a BLOB you must escape certain characters. This has been
implemented.

2. MySql specific data format requirements have been addressed.

I looked at one related area at the same time. All the databases except
Postgres have JDBC drivers that support/require TCP/IP connections.
Accordingly, I defined an extended format for the location option that is
supported by all database types. The general form of the location option is
now

database type:[database name]:[hostname]:[port]:[database user]:[database
user password]

The following defaults are provided:
database name          - Stellation
hostname               - localhost
port                   - database specific
database user          - stellation
database user password - ignored

Trailing fields can be omitted. You can also omit the content of a
positional field by coding consecutive ::.

I have not yet addressed the documentation requirements since I believe that
significant restructuring is needed to accomodate both database specific and
platform specific sections.

Modified files are attached. I hope thay are all there as I do not know how
to easily determine which files I have modified.

Regards

Jonathan Gossage

Personal Email
jgossage@xxxxxxxx

Business Email
jonathan@xxxxxxxxxxxxxx

Attachment: AbstractDatabase.java
Description: Binary data

Attachment: AbstractDBAccessPoint.java
Description: Binary data

Attachment: BasicDatabase.java
Description: Binary data

Attachment: DB2Database.java
Description: Binary data

Attachment: FirebirdDatabase.java
Description: Binary data

Attachment: MysqlDatabase.java
Description: Binary data

Attachment: OracleDatabase.java
Description: Binary data

Attachment: PostgresDatabase.java
Description: Binary data

Attachment: RepositoryDefinition.java
Description: Binary data

Attachment: Table.java
Description: Binary data

Attachment: TableIterator.java
Description: Binary data

Attachment: TestTable.java
Description: Binary data

Attachment: ArtifactAgent.java
Description: Binary data

Attachment: CompoundArtifactAgent.java
Description: Binary data

Attachment: DataArtifact.java
Description: Binary data

Attachment: DataArtifactAgent.java
Description: Binary data

Attachment: TextArtifactAgent.java
Description: Binary data


Back to the top