Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Locking issues

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

According to my knowledge i feel the locking flow is as follows
lock -> read -> modify -> unlock
in the above flow, Can i have read, modify in the
same method.

-Dhana
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dhana,
Hey dude you need to change your display name to a first and last name if you want to keep getting help from this most excellant forum.


in the above flow, Can i have read, modify in the
same method.


Absolutely. Why not do it all (lock, read, modify unlock) in a method named doBooking()?
Hope this helps
Michael Morris
 
dhana sekar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for ur immediate responce Mr.Morris & Mr.Mark.
What i mean is instred of having seperate
method like read(int recNo), modify(int recNo ) like lock() and unlock() can i have a common method named modifyRec(int recNo,int seat) which will first do reading followed by modifying. Please give ur comments and feedback on this.
-regards,
dhana
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

modifyRec(int recNo,int seat)


Isn't that saying the same thing that Micheal just said in his doBooking method.
Yes you will have a method like this, but not directly in the Data class. This will be in a DataAccessFacade type design pattern, for the client.
And please change your name to your first and last name. This is a policy of Javaranch, and you have been asked a few times already.
Mark
[ March 29, 2002: Message edited by: Mark Spritzler ]
 
dhana sekar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam very sorry for not changing my name. Any how now i changed it as u guys said.
-dhana
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic