This content has been marked as final.
Show 3 replies
-
1. Re: Commit transaction within web-service request
idyoshin Mar 30, 2010 2:56 PM (in response to cscs)I'm using the following approach: the webservice bean - is the interface, and there is also an event-scoped database controller, in the database controller the whole interaction with database is done. That works for me.
Kind regards,
Ilya Dyoshin
-
2. Re: Commit transaction within web-service request
cscs Mar 30, 2010 5:36 PM (in response to cscs)Hi Ilja,
thank you for the hint. I have a controller class and set it @Scope(ScopeType.EVENT) but unfortunately it still will not immediately send the newly created Object to the DB. Did you use any other special annotations?
-
3. Re: Commit transaction within web-service request
idyoshin Mar 30, 2010 5:55 PM (in response to cscs)No.
simply
EntityManager em = (EntityManager)Component.getComponent("entityManager, true); em.persist(obj); em.flush();
the DBController method is marked as @Transactional, and the Web-service method isn't. Ah, yeah - I've been using Seam-RESTEasy integration as the web-service.
Regards,
Ilya Dyoshin