• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Locking issues

 
dhana sekar
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
 
Michael Morris
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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
 
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
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic