[jboss-user] [JBoss Seam] - Re: Hibernate2 Problem

ralscha do-not-reply at jboss.com
Thu Jul 12 03:12:31 EDT 2007


Think I figured out what the problem is:

The class org.jboss.seam.persistence.HibernateSessionFactory has
a "unwrap" method

   @Unwrap
  |    public SessionFactory getSessionFactory() throws Exception
  |    {
  |       return createSessionFactory();
  |    }

and a "create" method
   @Create
  |    public void startup() throws Exception
  |    {
  |       sessionFactory = createSessionFactory();
  |    }

and both call createSessionFactory. If I understand the wrap correctly the method will be called everytime the bean is referenced. This results in a new SessionFactory every time. I think the unwrap Method schould only return the sessionFactory. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063334#4063334

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063334



More information about the jboss-user mailing list