2 Replies Latest reply on Mar 31, 2011 2:20 AM by idyoshin

    Seam 3 Persistence in autocommit

    idyoshin

      Hello,


      I've made a simple application with seam persistence module. And created the home object in conversation scope, which uses the same EntityManager (managed by seam), and entityConverter which loads entities by id supplied as String - also using the same EntityManager.


      And faced that my application autocommit any change to database, during each ajax call.  Maybe I'm using wrong pattern for EntityConverter? Or is there any way to configure the Seam-managed persistence context to not use autocommit mode (like in SEAM 2) ?

        • 1. Re: Seam 3 Persistence in autocommit

          Could you post your whole application source code somewhere? I guess it's possible because you said it's a simple application.

          • 2. Re: Seam 3 Persistence in autocommit
            idyoshin

            Well, I've moved forward really fast - and now it's not so small, as it was.  However I found a solution:







                 public void setupEntityManager(@Observes SeamManagedPersistenceContextCreated event) {
                      logger.info("setting flushmode MANUAL");
                      Session session = (Session) event.getEntityManager().getDelegate();
                      session.setFlushMode(FlushMode.MANUAL);
                 }





            Kind regards,
            Ilya Dyoshin