Hibernate version: 3.2
MS SQL Server database.
Not a bug, but a question:
Is there any way to have FlushMode = COMMIT, but post inserts immediately (note: can't rely on the presence of generated IDs).
I'm using Hibernate in a "client-server" app, and I'm generally happy with FlushMode.COMMIT for my (relatively) long conversation. Of course, by using this FlushMode, I avoid the concurrency issues inherent with accumulating Xlocks.
Hibernate is excellent in that updates to entities, even though they have not been persisted with UPDATE statements (until commit), still reflect their changes in subsequent queries. However, as expected, transient entities that have been persisted (with save() ) do not show up in subsequent queries.
For my needs and business logic concerns, I don't mind posting the inserts immediately, as the corresponding Xlocks will not effectively impinge on other users. The only exceptions are collisions from creative minds creating the same PK in separate transactions, or large-scale inserts that promote to table-level lock, which is not an issue for my app.
Thanks for your help,
Sean
_________________ Learning persists ...
|