This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

lock/delete/unlock as atomic operation

 
Gabriel Ozeas
Ranch Hand
Posts: 30
Google App Engine Hibernate jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10392
132
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic