• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

client ID for lock/unlock

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i see this in instructions..

... If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken


to do this i have see many coments, such pass to the server a client object.. but, hm
i can do like this?
the server return a int by lock method wich identify this record locking order, and a subsequent unlock could pass this int with the recNum to unlock else the unlock no make effect, or have to be a same identifier for all time of connection of client..
i like java and
thanks in advance !
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I follow the popular solution, that you should create a lockmagager class in your server side. Since, the lock and unlock are only used in remote mode. And in your remote data class which should provide all the services that data class provides, you instance a new lockmanager class using this remote data class, thus, you can track the lock owner all the time.
YING REN
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alex,
I agree with Ying that you should use a lock manager and OO methodology to map clients to locked records, but many have taken your approach and passed the certification. I would encourage you though to design it in such a way that you are not forced to change the signatures of lock and unlock in your public Data interface.
Hope this helps,
Michael Morris
[ August 07, 2002: Message edited by: Michael Morris ]
 
town drunk
( and author)
Posts: 4118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alex,
You'll be able to find a detailed discussion of all issues regarding locking here
HTH,
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic