Brannor McThife wrote:
I might be corrected by one of the Admins, but I believe that the rules is simple, only one SessionFactory per Database, as it in essence represents control of all the various sessions that will act on that database.
As such, each SessionFactory has its own config and sets of mapping files. I have a Database class where I map to 8 different databases using 8 different SessionFactories.
It could also be seen as good practise to keep different DB configurations nicely separated.
-G
First of all, thank you very much for replying so quickly.
From the point of view of a good design, I absolutely agree with you.
At the moment I'm starting a new project with a database schema that will have more or less one hundred of quite big tables; and the application require to have different databases built on the same schema (the business logic is the same, of course).
Since I read from documentation that a SessionFactory is a "hevy" object, that contains all mappings and statements, I would like to know if this approach was possible.
Thank you very much, Brannor