Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

lock & read or just read?  RSS feed

 
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

My assignment has the following comment on the lock(int) method: Locks a record so that it can only be updated or deleted by this client.. So what I am thinking is to only use the physical locking (ie locking on the database file) when reading a record. An additional record locking (along with physical locking) will be only used when updating/deleting a record.

DBClient class



Data class:


Do you think it is an appropriate approach to the read method?


[ December 08, 2005: Message edited by: Alex Sharkoff ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12100
246
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alex,

I think that is suitable for the read method.

Regards, Andrew
 
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot, Andrew.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!