This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

NX: lock and unlock

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my assignment is :
"public void lock(int record)
public void unlock(int record)
The unlock method simply removes the lock from the specified record. If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken."

so my question: how can iimplement the unlock without modified its definition?
i have two choice :
one is :
call lock(i)-modify(Data)-unlock(i) from client site, but client will call server three time in this way. i think how can modified a record does need known by client too.
second :
call lock(i)-modify(Data)-unlock(i) from server site,and server implements rmi interface, but i can't make sure it correspond with sun's requeriment.
which one should i chose , and is there any other good idea to implment it?
what your advice? thanks!
 
jq zhu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lock requirement description:
The lock method should block until the requested lock can be applied. The integer argument indicates the record to be locked. If the method is called with an argument of -1, the entire database should be locked
 
jq zhu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why no person replay, it is very urgent!
 
jq zhu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
closed, i have resolved it.
thanks.
 
author and jackaroo
Posts: 12199
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi JQ,
Welcome to JavaRanch.
Sorry I didnt get to your post until now. I hope you will still stick around and give us more chances to help.
I am glad you solved your problem. Davidd was tackling the same problem in this thread - you may be interested in the solution we were discussing there.
Regards, Andrew
 
jq zhu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much! i have gone to the Topic: NX: About data consistent.
it is very good.
i will not level here.
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic