  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | - Re: PersistenceContext injection in Seam 2.0beta1 | - Re: PersistenceContext injection in Seam 2.0beta1 2007-08-11 - By alexg79
Back anonymous wrote : @(protected) is part of JPA, why would it be able to inject a Hibernate Session. Further proof here: http://docs.jboss.com/ejb3/app-server/reference/build/reference/en/html /hibernate.html anonymous wrote : | 4.2. Injection Hibernate Session and SessionFactory | | You can inject a org.hibernate.Session and org.hibernate.SessionFactory directly into your EJBs just as you can do with EntityManagers and EntityManagerFactorys. The behavior of a Session is just the same as the behavior of an injected EntityManager. The application server controls the lifecycle of the Session so that you do not have to open, flush, or close the session. Extended persistence contexts also work with injected Hibernate Sessions. | | import org.hibernate.Session; | import org.hibernate.SessionFactory; | | @(protected) public class MyStatefulBean ... { | @(protected)(unitName="crm") Session session1; | @(protected)(unitName="crm2", type=EXTENDED) Session extendedpc; | @(protected)(unitName="crm") SessionFactory factory; | | }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic &p=4073300#4073300
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode =reply&p=4073300 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ jboss-user mailing list jboss-user@(protected) https://lists.jboss.org/mailman/listinfo/jboss-user
|
|
 |