[
http://jira.jboss.com/jira/browse/JBSEAM-2928?page=all ]
Pete Muir closed JBSEAM-2928.
-----------------------------
Fix Version/s: (was: 2.1.0.BETA1)
(was: 2.0.2.CR2)
Resolution: Rejected
Assignee: Pete Muir
JSF already declares an EL variable called session which points at the user's
session.
You shouldn't use variables which conflict with existing variable names.
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
Tomcat 6 but same problem on JBoss 4.2 as well.
Reporter: Sebastian Hennebrueder
Assigned To: Pete Muir
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