tags:

views:

33

answers:

1

hi,

i used the code

Session session = new Configuration().configure(cfgurl).buildSessionFactory().openSession() ;

to create a session. the cfgurl is of type URL and points to the hibernate.cfg.xml file of another project. The problem is it is getting hanged and unable to proceed further. What is the problem? Help

A: 

Usually the SessionFactory is created once and kept in a static variable. I'm not sure that this is the cause of the hanging though.

Maurice Perry
Usually? Not on my my watch it ain't, that would be an offence worthy of a severe wagging of the finger.
skaffman
@skaffman: alright then instead of "Usually" let's say "The method recommended in the hiberate documentation"
Maurice Perry
You _can_ create several session factories in the same project - although it is very rarely needed, thus almost always a waste of time and resources, it should work nevertheless. One of our app did that for a long time before I found and fixed it :-)
Péter Török