andrew gutnik

Greenhorn
+ Follow
since Nov 19, 2013
andrew likes ...
Eclipse IDE Flex Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by andrew gutnik

it took 5 months to complete the assignment and 3 days for Oracle to estimate it.
Dont have a detailed score yet.
But want to thank all Developer Certification (SCJD/OCMJD) forum participants.
I can say that this forum answered about 90% of arising questions.
So it really worth to read.
10 years ago
thank you all , very helpfull.

What happened with the KISS principle? To be honest I have been around this forum since 2009 and it's the very first time that I see someone using WeakReference and ReferenceQueue. I don't really know if that's a good thing. If I use the search function on this forum I notice there are a few threads mentioning these classes.



1. I use mentioned above goodies to track disconnected clients in case to avoid deadlock, but since i am implementing thin client and after reading the forum i decided that check for lost connection is not must .

And it's the reason for my question in the first place because after i change my code back to use just a HashMap with key as Integer and value as Integer the same tests fail. Tests are for network clients(each client has reference to static Data instance). Clients are created by factory as proxies to RMI server.

2. Exception handling in my code is still under construction and i agree with you it's not appropriate.

3.
isRecordLocked is something simple like


and you are right i'm expecting that it will return true becase i did call to lock() method before calling unlock()

also tests from The FAQ done fine , but they tests only instances of Data class.
Hi ! Thank you for replies glad to be in such friendly company.

Yes i did tests and read "Demystifying the OCMJD" , sure i'll not bet i understood it 100% . Test results are fine .

About

For instance, how about keeping the locked records in a Map<Long, Long> (where the key is the record
number and the value is a number that identifies the client who locked the record)?

. Yes you are right i just trying different ways to implement the assignment.

About

What do you mean by "not working"?

.

My case is as follows : i'm running about from 1 to 100 separate threads

that creates network clients and each client call the book method that is sequence of lock - update - unlock (i have no cookie to identify clients).

Now about "not working" - it means that call to unlock results in exception "Can not unlock record.Possibly record was not locked." ( line 12 )

part of unlock method



with code i posted it works great but if i change to

it throws exception.

by the way do you have difficulties to understand my english , i need to understand if i can express myself more or less correctly?

thank you in advance

Hi all ! after long time spent reading the forum i finally implemented locking mechanism that seems to work after few tests i did. But i have no clue why it works only when i use
such a map for locked records :



DBLocker is my locker manager , Integer is recNo and i populate map like this



the Map<DBLocker, Integer> lockTable; is not working , any help to explain why case with Data.DBLocker wrapped in WeakReference works ?