Hibernate and multiple datasources...
From: Lionel (SPAMcoollATfreePOINTfr)
Date: 10/15/04
- Previous message: David McDivitt: "Re: help creating datasource"
- Next in thread: Kingsley Idehen: "Re: Hibernate and multiple datasources..."
- Reply: Kingsley Idehen: "Re: Hibernate and multiple datasources..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 15 Oct 2004 11:05:33 +0200
Hi !!!
I have an hibernate application thta as multiple databases.
Depending on the country of the user, I will access the database of his
country.
All databases have exactly the same structure.
How can I manage this with struts/hibernate ?
Here is the solution I think I will use:
- define a JNDI datasource for each database.
- create an hibernate.cfg.xml for each database, using the same hbm files,
load in context each SessionFactory
- use a ServletFilter to open a connexion to the correct database depending
on the user profile for each http request
Do you see any problem in this configuration ?
Could I do better ?
Thanks.
- Previous message: David McDivitt: "Re: help creating datasource"
- Next in thread: Kingsley Idehen: "Re: Hibernate and multiple datasources..."
- Reply: Kingsley Idehen: "Re: Hibernate and multiple datasources..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|