开发者

Unable to create a session object

开发者 https://www.devze.com 2022-12-24 19:38 出处:网络
I use the code: Session session = new Configuration(). configure(cfgurl). buildSessionFactory(). openSession();

I use 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 prob开发者_JAVA技巧lem is that it is hanging and unable to proceed further. Why is this hanging?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消