This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes lock/delete/unlock as atomic operation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "lock/delete/unlock as atomic operation" Watch "lock/delete/unlock as atomic operation" New topic
Author

lock/delete/unlock as atomic operation

Gabriel Ozeas
Ranch Hand

Joined: Jul 04, 2008
Posts: 30

Hello guys,

I'm implementing my spec using synchronized/wait() approach. There are any problem to make the calls to lock/delete/unlock and lock/update/unlock in the server with just one call from the client? I'm using RMI and i think (if i'm not wrong) this way can facilitate the no same-thread-guarantee issue that RMI says.

Ex:



PS: I didn't want to say atomic as an really atomic operation in the title.

Bye bye
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

If you are developing a thin client, your server will have a single method (e.g. book) which handles all necessary business logic (locking record, updating record, unlocking record, checking if the record is still available/bookable) and you'll have one call from the client to execute the booking process. With a fat/thick client you will have a bunch of calls to execute the booking process.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: lock/delete/unlock as atomic operation
 
Similar Threads
Bodgitt and Scarper : locking and unlocking
pls validate my locking strategy - all inputs are g8ly appreciated. (URLyBird)
URLyBird question
More on locking
I passed, but I suffered the 44/80 locking penalty. Why?