]
Emmanuel Bernard resolved ANN-700.
----------------------------------
Resolution: Fixed
Fix Version/s: 3.3.1
I introduced a FlushModeType.PERSISTENCE_CONTEXT which is the default now in @Named*Query
This change break backward compatibility at compile time, runtime backward compatibility
is unaffected.
I am not too fussed about the backward compatibility, the previous behavior was stupid.
Hibernate's @NamedQuery always sets flushMode
---------------------------------------------
Key: ANN-700
URL:
http://opensource.atlassian.com/projects/hibernate/browse/ANN-700
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.0.ga
Environment: Hibernate 3.2.4.sp1, MySQL 5
Reporter: Luke Maurer
Fix For: 3.3.1
Hibernate's own @NamedQuery annotation (i.e.
@org.hibernate.annotations.NamedQuery)'s flushMode attribute is AUTO by default. This
tripped us up recently when we found that our Seam conversation-scoped persistence context
(having MANUAL flush mode) was flushing prematurely. The problem is, though, no value of
flushMode is going to be correct, as the query will elsewhere be used with flush mode
AUTO.
The workaround is, of course, to set the flush mode every time we use the query, but this
would be cumbersome and error-prone (and I suspect would defeat the point of being able to
set it in the annotation in the first place). In our case, we didn't really need the
extra stuff in the Hibernate extension, so we went back to the JPA @NamedQuery. At any
rate, this is a very surprising (and subtle) side effect of merely switching from
@javax.persistence.NamedQuery to @org.hibernate.annotations.NamedQuery.
(Unfortunately, I don't know a good solution, since, for what must be really great
reasons, annotation elements can't have null values ...)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: