-
1. Re: Seam persistence and flush mode
blabno Feb 28, 2012 3:35 AM (in response to andrewwheeler)I've just hit the same problem.
You can set default flush mode in beans.xml (or seam-beans.xml):
<persistence:FlushModeManagerImpl>
<persistence:flushModeType>MANUAL</persistence:flushModeType>
</persistence:FlushModeManagerImpl>
(xmlns:persistence="urn:java:org.jboss.seam.persistence")
Or programatically by injecting FlushModeManager and invoking setFlushModeType..
-
2. Re: Seam persistence and flush mode
tom_goring Nov 30, 2012 11:34 AM (in response to blabno)Hi Bernard,
thanks for this link.
Couple of questions:
1) If I add the above to my beans.xml I get
cvc-complex-type.2.4.a: Invalid content was found starting with element 'persistence:FlushModeManagerImpl'. One of '{"http://java.sun.com/xml/ns/
javaee":decorators, "http://java.sun.com/xml/ns/javaee":alternatives}' is expected.
could you provide a full example?
2) If I want to set flush mode manual programtically for all my entity managers where should I do this? (I've done it on a interceptor on my service layer which works).
3) Flush Mode Manual still requires me in my service layer call flush on the entity manager. I want this to auto happen for me when the conversation completes.
How should I go about this ? can I listen to the conversation ending generically ?
Thanks in advance.