[hibernate-dev] FlushMode.NEVER deprecated

Emmanuel Bernard emmanuel at hibernate.org
Mon Dec 4 11:29:41 EST 2006


andresgr wrote:
> Hi.
>
> I can see in Hibernate 3.2 LockMode.NEVER is deprecated in favor of
> LockMode.MANUAL.
>
> Maybe this is a silly argument... but i think that FlushMode.NEVER has
> some "semantic" benefits. I mean, if i'm reading code and see
>
>    session.setFlushMode(FlushMode.NEVER)
>
> i think "oh, this is going to be a read-only session". On the other
> hand, if i see
>
>    session.setFlushMode(FlushMode.MANUAL)
>
> i'll think "oh, in this session the developer is going to manually
> flush the session at some point, instead of letting hibernate taking
> care".
>
> Even more, hibernate could throw some "Not flushable session
> (read-only)" exception  if someone try to flush on this mode...
>
This is exactly why MANUAL is a better name than NEVER :-)



More information about the hibernate-dev mailing list