So IIUC, you want to create a repository of your database schemas, and then create a VDB that can query this repository?
This is possible, using the JDBC Metadata Connector. Simply configure the ModeShape configuration to have a source for each of the DBMS users that MdoeShape should access. For example, if all of your databases are accessible via a single user, then you'd only need on source. However, if you have multiple DBMS instances and/or require different users for different databases, you'll need to configure multiple sources and use the federation connector to merge all of those into a single logical repository. Then make sure that you reindex the content if any of the databases is changed. You'll want to be aware of performance, since this JDBC Metadata Connector does not cache the metadata.
This approach would allow the repository to reflect in real time the database schemas, but they do this by directly accessing the database metadata (the JDBC Metadata Connector does not cache the metadata). As such, you'll want to be aware of performance, and understand that the repository will be directly and frequently accessing the database metadata.
Alternatively, you can use ModeShape as a repository for database metadata captured at design-time. This is often perfectly acceptable for most scenarios, because production databases and their schemas are controlled very tightly and often need to be coordinated with application deployments. This is perhaps the easiest way to integrate ModeShape and Teiid:
- Deploy ModeShape to JBoss AS using our kit, and set it up as a regular repository (e.g., with a single persistent store, as it won't be using the JDBC Metadata Connector), and be sure the Teiid VDB sequencer is configured
- Use Teiid Designer (within JBoss DevStudio) to import the databases as relational models
- Use the ModeShape plugin (with JBoss DevStudio) or use the WebDAV functionality to publish these models (and/or VDBs created from these models) into ModeShape
- Query the table, column, indexes, etc. metadata stored in the repository. You can even create a new VDB and use Teiid to query the metadata this way.
There's a fair amount of integration required, but this is exactly what the JBoss Enterprise Data Services Platform enables out of the box. If you're interested in EDS, please contact Red Hat sales for more information.
Thanks Randall for the reply.
We have JBOSS SOA platform in our organization. I was assigned the task to review JBOSS Enterprise Data Services platform and see how it can be used. Below are the steps I followed -
- Integrated EDS into Jboss SOA
- Using Jboss Developer Studio 4, created a Teiid Project
- import -> Teiid Designer - Metadata from JDBC Database, created a oracle connection profile with 'A' database and created a Teiid MetaData Model
- Following the same steps imported another Teiid Metadata Model with 'B' database
- Created 'C' Teiid Metadata Model with ModelClass as Relational and ModelType as ViewModel and created a child basetable and in the transformations fetched from tables from both A and B Teiid Metadata Models
- Created a new Teiid VDB and added the newly created C Teiid Metadata Model (which uses A and B models)
- Deployed and Executed it, working fine, when querying the child basetable created, it is fetching from both the databases.
I showed all this but I was asked how does Modeshape fit into all this/ Instead of going to actual databases to create the A and B Teiid Metadata Models can we go to a Meta Data Repository and create the models as we donot need actual data at that time we just need tables and views.
So I was thinking to try modeshape to fetch the tables and columns and create the virtual tables, but to give the actual data sources directly to fetch the data. In other words not use Modeshape to fetch the actual data but just use it for designing the A and B Metadata models.
Can we use Modeshape like that, just as a metadata provider for designing? And when actually deploying the VDB I will enter the adtasource for A and B Metadata Models.
Quickly, you can 'publish' VDBs and models to ModeShape and can then query the metadata, all without having to 'deploy' the VDBs for data access.
However, questions about the SOA-P EDS platform is really not appropriate for this forum, which is focused on the ModeShape open source project. Instead, the best thing is for you to contact Red Hat support, who will definitely answer your questions. Plus, you'll have access to the entire knowledge base and will have a way to track your question(s). You're already paying for support, so you may as well use it!
Thanks. I will contact jboss support.
One more question about Modeshape, What is the main use of Modeshape is it to store and fetch metadata or fetch actual data in applications from the underlying database connections?
It can do both, but in the context of SOA-P EDS it is primarily a metadata repository.