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.  [ 3 posts ] 
Author Message
 Post subject: Reservation system
PostPosted: Fri Aug 26, 2005 6:16 pm 
Newbie

Joined: Sat Mar 13, 2004 9:46 am
Posts: 10
Hello group,

I'm developing a reservation system and want to use hibernate for data access. The system should issue a seat number when someone reservates one. First the database is checked on a 'available' flag in a certain table. When the seat is still available it must be reserved (by setting the flag available to false).

The system makes use of a single database and two applications. Each application must be able to handle reservations. It could be that the two applications try to reservate a seat number at the same time. They both check if the available flag is set to true, and then they both set it to false. Both applications return with a valid reservation and two different persons are assigned to the same seat. How can I prevent this with hibernate? I dont want to lock a table for a whole transaction.

Thanks in advance.
Dee.


Top
 Profile  
 
 Post subject: locks
PostPosted: Fri Aug 26, 2005 6:39 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Did you checked this?
http://www.hibernate.org/hib_docs/v3/re ... ns-locking

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 11:10 am 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
Also take a look at optimistic concurrency control.

http://www.hibernate.org/hib_docs/v3/reference/en/html/transactions.html#transactions-optimistic


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.