1 Reply Latest reply on Feb 8, 2010 12:18 AM by Ilya Dyoshin

    Application-Scoped RESTEasy service with EntityManager: EntityManager is closed exception ALWAYS!

    Ilya Dyoshin Novice


      I'm getting some problem with creating Application-scoped RESTEasy service.

      I need it to be statefull, because in one call user starts transaction in another it adds some data,  and in third call it's commited. Actually all logic is in last call. in the lastcall I use entityManager, and my application always dies with entityManager is closed exception?

      Any idea?

      my component in general is like the following:

      public class BankService extends EntityController {
        public String begin() {
         return myTransactionId;
        public String add(@PathParam("transactionId") String transactionId, @PathParam("somedata") String somedata) {
        public String commit(@PathParam("transactionId") String transactionId) {
          getEntityManager().persist(object); // HERE I RECEIVE An EXCEPTION EntityManager isClosed;