Hi,
It is known that session factories are 'heavy' objects in terms of the overhead required for their initialization.
Nevertheless, there might be reasons to have multiple session factories within one application, such as:
- Requiring access to different databases from within the same application
- Requiring different naming conventions or other configuration options
for different parts of the application - Managabiliity: the application (which uses Hibernate) uses third party
products that also use hibernate. Having one session factory per
product makes it easy to manage the persistence configurations for
these products independently. Here independent session factories are
possible since the products communicate with each other exclusively
through APIs and not through the database.
Now my question is. What is the overhead of having multiple session factories instead of one in terms of processing (CPU) and memory?
Cheers
Erik[/list]