[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1674) HibernateSessionFactory creates a Factory on every DB operation

Ralph Schaer (JIRA) jira-events at lists.jboss.org
Mon Jul 16 07:46:03 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-1674?page=comments#action_12369071 ] 
            
Ralph Schaer commented on JBSEAM-1674:
--------------------------------------

I tested my test application and the hibernate2 application with the change. It solved the problem.

But there where other problems with the example application. 

Tomcat 6
- The example will not work out of the box. It's necessary to delete el-api.jar (el-ri.jar is not needed too). Tomcat 6 has already an el implementation.
- It's not necessary to copy commons-collections-3.2.jar, commons-dbcp-1.2.2.jar and commons-pool-1.3.jar into the lib directory of tomcat 
   as the readme.txt describes. It's sufficient to copy hsqldb.jar into the <tomcat_home>/lib directory.

Tomcat 5.5
- This Tomcat crashes with a strange exception when I click on the Register button
  "javax.el.ELException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1"
  But when I switch from HSQLDB to H2 it works. I have no idea what is wrong with HSQLDB on Tomcat 5.5.
  On Tomcat 6 HSQLDB and H2 are working.



> HibernateSessionFactory creates a Factory on every DB operation
> ---------------------------------------------------------------
>
>                 Key: JBSEAM-1674
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1674
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 2.0.0.BETA1
>         Environment: JavaBeans, Hibernate, Tomcat 6.0.13, Java 6, Windows XP
>            Reporter: Ralph Schaer
>         Assigned To: Gavin King
>            Priority: Blocker
>             Fix For: 2.0.0.CR1
>
>
> Reproduce with the Hibernate2 Example
> Deploying to tomcat works. The browser shows the login form.
> But everytime a new request is started for example with "Register New User" or "Register" in the New User form, the seam application creates a new HibernateSessionFactory and the SchemaExport tool is running. It drops and creates the tables in the database every time. So it's for example not possible to register a new user.
> The problem could be that org.jboss.seam.persistence.HibernateSessionFactory has a @Unwrap and a @Create method and both doing the
> same thing, call "return createSessionFactory();". If I understand the @Unwrap 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list