Hibernate version: 3.0.2
This subject seems to be asked/answered many times on the forum, but with no final verdict (or is just me not seeing it).
I have the following scenario (non-arguable ;-)):
1/ one DB that contains in one of the tables runtime updatable information about N DB
2/ the N dbs are using exactly the same schema (about 180 tables + views, all mapped)
Starting from the afirmation that "obtaining a new SessionFactory is a time consuming operation" I would like to find out if the following scenario may help on speeding up (at least a little bit):
1/ create a Configuration containing the mapping files
2/ for every new SessionFactory, set in the Configuration the Properties of the connection and call buildSessionFactory().
Imo it seems that the time consumption in creating the SessionFactory may come from:
1/ loading all mapping files (about 180)
2/ buildSessionFactory() operation (rescan mappings, obtaining the JDBC connection)
The above scenario seems to remove the 1st time consumption operation.
I would like to know if this is the best I can do or there are more tricks that can be involved in order to speed up.
greatfully,
|