-
1. Re: why transaction is rollbacked? @CreateProcess @Stateless EntityManager
yakamax May 14, 2009 1:58 PM (in response to yakamax)Let me know if it's possible to use @CreateProcess in @Stateless Bean which persist an Entity.
I'm little bit confused about that.
-
2. Re: why transaction is rollbacked? @CreateProcess @Stateless EntityManager
yakamax May 14, 2009 4:06 PM (in response to yakamax)I found solution :
It's definitly possible to @CreateProcess and persist Object with same transaction in a Stateless bean.
What I did :
Add in components.xml
<transaction:ejb-transaction/>
Get entityManager this way in you Stateless Bean :
@PersistenceContext EntityManager entityManager;
I supposed problem was about EJB transaction. Please if someone (Gavin ;) ?) can explain me more...
Thank you.
-
3. Re: why transaction is rollbacked? @CreateProcess @Stateless EntityManager
yakamax May 14, 2009 4:12 PM (in response to yakamax)More information : I'm don't know if it can be source of problem but I forgot to tell you that my method createMyObject(String name) is exposed and called by remoting @WebRemote (javascript client).
-
4. Re: why transaction is rollbacked? @CreateProcess @Stateless EntityManager
yakamax May 14, 2009 6:41 PM (in response to yakamax)To persist it works but if in the same bean I would like to request database, I always get no result...
For the first post this is my exception received in my callback :
... java.lang.IllegalStateException Transaction begin not detected try installing transaction ejb-transaction in components.xml ...
-
5. Re: why transaction is rollbacked? @CreateProcess @Stateless EntityManager
yakamax May 15, 2009 10:11 AM (in response to yakamax)Nevermind,
with
<transaction:ejb-transaction/>
in components.xml and
@In EntityManager entityManager;
it's works pretty well calling by WebRemote.