Hibernate and multiple datasources...

From: Lionel (SPAMcoollATfreePOINTfr)
Date: 10/15/04

  • Next message: Kingsley Idehen: "Re: Hibernate and multiple datasources..."
    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.


  • Next message: Kingsley Idehen: "Re: Hibernate and multiple datasources..."

    Relevant Pages

    • Re: When to use sub-values
      ... from the outset as if each discrete problem is a database problem -- ... "optimizations" are merely optimizations. ... within LOCATE (depending on the controlling-nesting levels you want to ... reimplemented our own simulated RDBMS to be able to store/retrieve/sort ...
      (comp.databases.pick)
    • Re: asp.net, vs2k5, getting started connecting to databases... Im confused
      ... It's a bit confusing when you first get started and the short answer ... Depending on how you want to display the data in your webparts, ... // this with the current connection. ... // Close data reader object and database connection ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: CeDeleteRecord Anomalies
      ... > I am trying to use the CeDeleteRecord function on CE4.2. ... > this function fails (repeatable depending on the database I'm using). ... Does your database contain Text as well? ...
      (microsoft.public.windowsce.embedded.vc)
    • Re: A nongeneric bounded string array type (in database code)
      ... > detail that the programmer needs to thing about and handle appropriately. ... depending on the database indeed. ... If you take arrays to the further level of columns x rows, ...
      (comp.lang.ada)
    • Re: How can I organize my database?
      ... I am trying to design a database in order to store information on as many ... Depending on the organisation, this ... number of country offices can vary greatly in number. ... number of district offices can vary in number. ...
      (microsoft.public.access.tablesdbdesign)