aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to lock and unlock??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to lock and unlock???" Watch "How to lock and unlock???" New topic
Author

How to lock and unlock???

Jack Yang
Ranch Hand

Joined: Jan 31, 2002
Posts: 59
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!!!


SCJD2,SCBCD,SCJWD,SCJP2
Ying Ren
Ranch Hand

Joined: May 24, 2002
Posts: 35
I use the HashMap for storing the record and the connection.
YING REN
Jack Yang
Ranch Hand

Joined: Jan 31, 2002
Posts: 59
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

Joined: Jul 02, 2002
Posts: 13
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

Joined: May 13, 2002
Posts: 301
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.


scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
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


Java Regular Expressions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to lock and unlock???