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, [EMAIL
PROTECTED](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
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user