[jboss-user] [JBoss Seam] - Set non-shared Hibernate interceptor on JPA EntityManager

mjschehl do-not-reply at jboss.com
Fri Oct 26 11:34:58 EDT 2007


I am using Seam 1.2 with JPA and need to assign a thread-safe Interceptor to my Hibernate sessions.   I know I can set thread-unsafe interceptors in the persistance.xml by setting the property "hibernate.ejb.interceptor", but is there a way to run something equivalent to the code below to create the EntityManager?

MyInterceptor interceptor = new MyInterceptor();
  | Session session = getSessionFactory().openSession(interceptor);
  | Transaction tx = session.beginTransaction();
  | interceptor.setSession(session);
  | interceptor.setUsername(identity.getUsername());
  | 


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

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



More information about the jboss-user mailing list