[jboss-user] [EJB 3.0] - FlushMode.MANUAL being ignored???

JamesWoodward do-not-reply at jboss.com
Wed Feb 7 12:08:33 EST 2007


Hi,

I recently purches the eBook "Java Persistence with Hibernate" and am working through the chapters.

Why is it that this code reports a flushMode of AUTO, when it should be MANUAL?


  | @Stateful
  | public class MySessionBean implements MySession {
  | 
  |     private static final Log log = LogFactory.getLog(MySessionBean.class);
  | 
  |     @PersistenceContext(type=PersistenceContextType.EXTENDED, properties=@PersistenceProperty(name="org.hibernate.flushMode", value="MANUAL"))
  |     private EntityManager entityManager;
  |     
  |     @EJB
  |     private CounterDAO counterDAO;
  |     
  |     public void test() {
  |         org.jboss.ejb3.entity.HibernateSession hs = (org.jboss.ejb3.entity.HibernateSession) entityManager;
  |         org.hibernate.Session session = hs.getHibernateSession();
  |         org.hibernate.FlushMode flushMode = session.getFlushMode();
  |         log.info(flushMode);
  |         
  |         for (int i = 0; i < 100; i++) {
  |             Integer value = counterDAO.increment(threadName);
  |         }
  |     }
  | 
  |     public void flush() {
  |         entityManager.flush();
  |     }
  | 
  |     @Remove
  |     public void destroy() {
  |         log.info("FtpSessionBean.destroy()");
  |     }
  | }
  | 

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

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



More information about the jboss-user mailing list