[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2928) Precedence problem when injecting Hibernate Session into HibernateTransaction

Sebastian Hennebrueder (JIRA) jira-events at lists.jboss.org
Fri Apr 25 08:39:09 EDT 2008


Precedence problem when injecting Hibernate Session into HibernateTransaction
-----------------------------------------------------------------------------

                 Key: JBSEAM-2928
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2928
             Project: Seam
          Issue Type: Bug
    Affects Versions: 2.0.1.GA
         Environment: Linux, Java 1.5, Hibernate
            Reporter: Sebastian Hennebrueder


Hello,

I found a precedence problem and I am not sure is this turns out to be a general problem in a lot of core components (or me not understanding something).

I try to inject the Hibernate session in my components using session as name. @In private Session session

With the following components.xml this leads to a classcastexception when the session is injected in the HibernateTransaction. Seam tries to inject a HTTP Session.

components.xml

<persistence:hibernate-session-factory name="hibernateSessionFactory"/>
<persistence:managed-hibernate-session name="session"                       
 auto-create="true"        
session-factory="#{hibernateSessionFactory}"/>
<transaction:hibernate-transaction session="#{session}"/>

In my opinion this is an error as the component is properly created.

A workaround is possible. When injecting the session into the transaction the wrong component (Seam Session) is used.

I created a factory for session.

  <factory name="session"
           scope="STATELESS"
           auto-create="true"
           value="#{xsession}"/>
<persistence:managed-hibernate-session name="xsession"
                                         auto-create="true"
session-factory="#{hibernateSessionFactory}"/>
 <transaction:hibernate-transaction session="#{xsession}" />

I tried to play with the precedence but this did not help as well.

Best Regards / Viele Grüße

Sebastian Hennebrueder

----- http://www.laliluna.de 

-- 
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