Eric,

So, I guess you mean session state is flushed to the db? In that case,
perhaps Hibernate can know apriori whether a call to
EntityManager#find(clazz, id) could load entities from the db that
will overwrite modifications in the current session, and that it would
be harder to determine that for arbitrary queries. But, I'm not really
sure. I'd ask on the hibernate mailing list or in #hibernate on
irc.freenode.org.

It might also help to narrow the scope of your @Transactional methods,
because session flushing shouldn't happen without an active
transaction to begin with.

Jesse

On Tue, Feb 7, 2012 at 4:52 PM, Eric Andresen <ericandre...@gmail.com> wrote:
> Jesse,
>
>   I switched my locator to use the EntityManager.find() interface, and it no
> longer flushes the session, even when it does query the database.    Thanks
> for the suggestion!
>
>   I admit I'm a bit of a n00b with Hibernate, do you know what the
> difference is between letting the EntityManager find the object and calling
> the javax.persistence.Query.getSingleResult() to find it that causes the
> flush to happen for the second and not the first?  Something to do with the
> Spring voodoo or the @Transactional annotations on the DAO perhaps?  I ask
> because these stray flushes have been a thorn in our heel for ages now.
>
> Thanks,
> Eric
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/xbC0paEFeecJ.
>
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to