I am connecting my ATG application to data base using FakeXADataSource.properties and JTDataSource.properties. Is there a way I can connect my application to two db or different schema in single db.
Thanks in advance.
I dont think there is any restriction on how you can do this , the FakeXA and JTDatasources are just the datasources which take the db information on to which the respective repositories are persisted.The undelying details are specified either using JNDI ( JTDatasource ) with greater flexibility or straight in the .properties file as in FakeXA.But for ease of use and not introducing un necessary complications I would suggest using different schemas on same DB. The reasons i can suggest are as
1 . Data base maintainence scripts and activities
2. Any work that needs to be peformed on one database needs to be replicated on to the other
It is not unheard of but certainly I would recommend using a single database with a different location database as a back up
Sundar M R
Thanks to all,
Actually I have a schema named "atg" contains tables that required for ATG out of box functionality, there is anther schema named "other" having tables not related to out of box but still used as having business data. I am using JTDataSource.properties and FakeXADataSource.properties for using "atg" schema.
I want to know configuration changes so that I can use data from "other" schema also.
Why do not you have the custom tables inside the same schema as that of ATG's? You should not alter the OOB tables but you can add your custom tables to the schema in which OOB tables are in.
This would be an easier implementation rather than maintaining the custom tables in a separate schema (provided your business/infra/security requirements mandates to maintain them in a separate schema).
----Yes I have business requirement for that.
What kind of business requirement ask you have to create different schema for your custom table? To me its a Technical/System requirement.
I am not saying that there cannot be a scenario where you have to create multiple schema, just curious what is your scenario as solution might vary based on scenario you are in.
For instance if both schema exist on same DB instance and the data in table is not modified by you application (like catalog data) you can create materialized/indexed view in you primary schema which will give you better performance.
Otherwise if data is changed by your application and its simple to identify what exist in which schema you can create multiple repositories with dependencies on each other each using different datasource.
Otherwise, if data is mixed and complicated you can use composite repository which OOTB support multiple datasources. Refer: