@Begin( flushMode = FlushModeType.MANUAL )
No method within the conversation will write the database until you explicitly call entityManager.flush()
Thanks but this is not the intention what I want to show:
I have no entityManager-Instance in my View-Bean C and want not to provide a instance as I want to decouple the view from the session-bean.
I cannot call entityManager.flush() in my View Bean C, as I do not want to provide a EntityManager-Instance in my ManagedBean C.
I absolutely want to avoid injecting a EntityManager into a web component (in my case the managedBean C).
I guess, this is the problem:
//retrieves methods from aLocal @In aLocal alocal;
Should I use this instead?:
//retrieves methods from aLocal @EJB aLocal alocal;
Your problem is that by default the seam managed persistence context will flush itself to the database automatically, unless you either start a conversation with a flush mode of MANUAL or set the flush mode yourself. There is not need to inject an EntityManager to make this change, you can do it through pages.xml (<begin-conversation flush-mode="MANUAL"/>)
Thank you, I have done that.