-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: FlushMode = COMMIT, but flush inserts immediately?
PostPosted: Fri Nov 21, 2008 2:28 pm 
Newbie

Joined: Fri Nov 21, 2008 1:19 pm
Posts: 1
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 ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.