Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to lock and unlock???

 
Jack Yang
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
I just start the coding.I read from the forum and found using LockManager is a good way.But I'm confuss,should we implement the lock and unlock in the Data class?And is there a vector or array to record the locked number in the LockManager?
Thank you very much!!!
 
Ying Ren
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the HashMap for storing the record and the connection.
YING REN
 
Jack Yang
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you,Ying Ren.
But I still don't understand about the Data.class.
In this clas,there is a lock and unlock method.Do you add code there?Or you create another class to do and leave it blank?
 
Lina Mahl
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yang hao:
Thank you,Ying Ren.
But I still don't understand about the Data.class.
In this clas,there is a lock and unlock method.Do you add code there?Or you create another class to do and leave it blank?

I am realy interested in those two methodes to. I began adding code in the Data class. But I would like to change both method into synchronized methods. Is it wrong to add modifiers? I am using Hashtables.
/Lina
[ July 23, 2002: Message edited by: Lina Mahl ]
 
Nate Johnson
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lina Mahl:

I am realy interested in those two methodes to. I began adding code in the Data class. But I would like to change both method into synchronized methods. Is it wrong to add modifiers? I am using Hashtables.
/Lina
[ July 23, 2002: Message edited by: Lina Mahl ]


I have a lock manager class that has a hash map of (record, client id) pairs. This class implements lock and unlock with syncronized blocks of code for my remote data objects.
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Lina,
You might find the discussion here helpful. As to your question specifically, try looking here
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic