Well, even if the queries are sent to the DB, you shouldn't care. In fact, you're still in a tx context, so even if Hibernate sends an update on a table, a final rollback would unmake it...
Nobody can see the results of these updates if the tx is in a common transaction isolation mode.
Why don't you want these updates not to be flushed? I guess Hibernate is doing it because it thought it could affect the object you're trying to retrieve.
To sum up, there's no problem to use the FlushMode.COMMIT, but then you will have to call refresh() by yourself on objects you know to be dirty.
_________________ Baptiste
PS : please don't forget to give credits below if you found this answer useful :)
|