-->
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.  [ 2 posts ] 
Author Message
 Post subject: basic DB question on concurrency / Hibernate
PostPosted: Thu Oct 23, 2003 11:11 am 
Newbie

Joined: Thu Oct 23, 2003 11:08 am
Posts: 10
Hi

I have following *newbie* question:

I am creating a "work-task"-table which records task to be
processed. The idea is that multiple users are working on
these tasks and are able to "check out" a set of tasks which
they want to process, e.g. the 10 last entered tasks.

Thus, my table requires an id for each task, a timestamp field,
other field related to the work to do and an indicator field
which tells, that a task is currently in process at an user.

My question is now related to concurrency in the application.

What is the best way to avoid problems? Where do I have to
pay attention? If I select a set of appropiate tasks (e.g. the
oldest non-processed tasks) and then want to update the
"in-work" field, I can not be sure, that not another user
has meanwhile also selected one of my task...

Transactions give my the possiblity to be sure that multiple
database queries have been completed successfully (and rolled
back in case of an error), but don't prevent other users to
access certain records...is this correct?

I know certain DBs allow SELECT FOR UPDATE which actually seems
to me a solution, but I think, I simply have not understand
the whole transaction stuff correctly or the versioning mechanism
existing in Hibernate.

Does anyhave have some advice for me?

Thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 23, 2003 12:56 pm 
Newbie

Joined: Mon Oct 20, 2003 3:03 pm
Posts: 13
I suggest you read about about "optimistic" vs. "pessimistic" locking,
and "isolation levels". I recall the docs being pretty good on this topic.


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

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.