Re: Hibernate and multiple datasources...
From: Boris Cinkler (boris_cinkler_at_yh.cm)
Date: 11/29/04
- Next message: Andreas Stroeber: "JSP & Oracle InterMedia"
- Previous message: Anzime: "Re: DB2 poolled Connection problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Nov 2004 05:09:57 GMT
There should be a way to pass java.sql.Connection to Hibernate when
openning session, and it will use that connection instead.
PS I didn't work with Hibernate 2.0 and 2.1, there may be actually
better way to do that.
Boris
Lionel wrote:
> 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.
>
>
- Next message: Andreas Stroeber: "JSP & Oracle InterMedia"
- Previous message: Anzime: "Re: DB2 poolled Connection problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|