-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: net.sf.hibernate.cfg.Configuration.buildSessionFactory bug?
PostPosted: Thu Oct 28, 2004 6:01 am 
Newbie

Joined: Thu Oct 28, 2004 5:49 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.