I like that proposal. We give the method name semantic meaning (i.e.
setRenderFlushMode()). If a call really is made to
setManualFlushMode(), perhaps because of @Begin(flushMode = "MANUAL"),
then I can go along with an exception being thrown in that case.
I absolutely agree that we want to prevent flushing in the rendering
phase. I just wish it was supported as an extension by at least one
other JPA provider. I had hope for OpenJPA.
On Tue, May 27, 2008 at 2:03 PM, Gavin King <gavin(a)hibernate.org> wrote:
I think it is correct to call setManualFlushMode() before the render
phase. We should *never* flush changes to the database while in render
response, and we should therefore avoid the cost of a dirty check.
The correct fix would be to have two methods:
with diff implementations for non-Hibernate persistence providers:
setManualFlushMode() throws an exception
setRenderFlushMode() is a no-op
for Hibernate, however, setRenderFlushMode() would call setManualFlushMode().
On Tue, May 27, 2008 at 12:36 PM, Pete Muir <pete.muir(a)jboss.org> wrote:
> It looks like we will end up having a 2.0.3 release. I would prefer not to
> put this fix for which there is an easy workaround into this release
> especially as I don't think this fix is correct (we shouldn't call
> setManualFlushMode() from there at all).
> On 27 May 2008, at 16:37, Dan Allen wrote:
>> Seam devs,
>> I am bringing a topic that happened in a private e-mail between Jay
>> and I to the list.
>> The main issue that I really want to see included in 2.0.2.SP1 is this
>> fix for the PersistenceProvider (JBSEAM-3030). It bothers me that we
>> are blatantly not supporting other JPA providers, even though we all
>> know how important manual flushing is (trust that I find it the single
>> most lacking feature in JPA). This is not a regression, but it sure
>> feels like one.
>> The backstory is that if you have at least one component with a
>> persistence context (e.g. @In private EntityManager entityManager or
>> @PersistenceContext private EntityManager entityManager), then Seam
>> will attempt to put it into manual flush mode before rendering. When
>> that happens, you are using the generic JPA provider, an exception is
>> thrown, failing the rendering process. The only way around this issue
>> is to implement your own PersistenceProvider and override the
>> setManualFlushMode() to do nothing. My fix changes this exception to a
>> log warning message.
>> Dan Allen
>> Software consultant | Author of Seam in Action
>> NOTE: While I make a strong effort to keep up with my email on a daily
>> basis, life and work come first and, at times, keep me away from my mail
>> for a while. If you contact me, then don't hear back for more than a week,
>> it is very likely that I am excessively backlogged or the message was
>> caught in the spam filters. Please don't hesitate to resend a message if
>> you feel that it did not reach my attention.
>> seam-dev mailing list
> seam-dev mailing list
Software consultant | Author of Seam in Action
NOTE: While I make a strong effort to keep up with my email on a daily
basis, life and work come first and, at times, keep me away from my mail
for a while. If you contact me, then don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters. Please don't hesitate to resend a message if
you feel that it did not reach my attention.