Hibernate version: 2.1.6
Mapping documents: N/A
Code between sessionFactory.openSession() and session.close(): N/A
Full stack trace of any exception that occurs: N/A
Name and version of the database you are using: N/A
The generated SQL (show_sql=true): N/A
Debug level Hibernate log excerpt: N/A
I was browsing though the source code for class net.sf.hibernate.cfg.Configuration - method buildSessionFactory
the doc comment states
Quote:
The <tt>SessionFactory</tt> will be
immutable, so changes made to the <tt>Configuration</tt> after
building the <tt>SessionFactory</tt> will not affect it.
And the code contains the following:
Code:
Properties copy = new Properties();
copy.putAll(properties);
Settings settings = buildSettings();
If you then look in the buildSettings() method you find
Code:
return SettingsFactory.buildSettings(properties);
I.e. buildSettings() uses the global scope properties. Should this use the copy created in buildSessionFactory() instead?
If not, why is the copy created? It is only declared in the scope of the method buildSessionFactory which does nothing with it, except for the lines quoted above
Jeroen