Thanks for you answer.
Yes Ido. I need exactly what you have described. I think it is quite common
scenario.
And how to be now?
With EntityManager.setFlushMode() we can set only
javax.persistence.FlushModeType.COMMIT
or
javax.persistence.FlushModeType.AUTO
I tried this:
| private EntityManager em;
| @PersistenceContext(type=EXTENDED)
| public void setEntityManager(EntityManager val){
| val.setFlushMode(FlushModeType.COMMIT);
| em = val;
| }
|
but it does not work.
I get exception:
| Caused by: java.lang.NullPointerException
| at
org.jboss.ejb3.entity.ExtendedEntityManager.getPersistenceContext(ExtendedEntityManager.java:59)
| at
org.jboss.ejb3.entity.ExtendedEntityManager.setFlushMode(ExtendedEntityManager.java:179)
| at
com.colvir.reference.action.ValutaProcAction.setEntityManager(ValutaProcAction.java:41)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at
org.jboss.ejb3.injection.JndiMethodInjector.inject(JndiMethodInjector.java:97)
| ... 59 more
|
Thanks. Denis.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3952005#3952005
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3952005
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user