Ihor Strutynskyj

Greenhorn
+ Follow
since Mar 28, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ihor Strutynskyj

Rudy,
More general approach would be for server not to verify the client status and unlock the record himself, but simple do nothing. If the next request for this record comes from the same failed client (after the timeout expired) allow the request to proceed, otherwise grant the lock to whatever client will ask for it first. This technique is called 'optimistic leased locks'. Which is a compromise between pesimistic locking (strict timeout based) and optimistic locking (version based).
Regards, Ihor
Hi Rudy,
There are many different ways to track clients in RMI approach. You can use client's IP address (which will limit you to one client per IP), you can generate unique client ID using java.rmi.server.ObjID class, or you can use simple object (call it flightData or DataService) which will be a communication point between client and RMI server. This communication point will be created one per client per connection time, and will serve as unique client ID.
Regards, Ihor
Hi Matt,
This is what I came accross in JawaWorld (1999-12) article:
"...The other problem is that Swing doesn't correctly update the menu bar as items are added to and removed from it in all situations..." Alen Holub (famous by his threading series) presents his solution to this problemm.
May be its related to what you are experiencing.
Regards, Ihor
Hi,
I'm thinking of implementing optimistic record locking for this assignment. The idea is simple. Keep the version number for each record (in the separate file - since it is not feasible to modify the db structure), and use it with each read/write.
(I execute booking logic on the RMI client).
For reading (atomized):
- read the record along with its version.
For writing (atomized):
- read the current record version
- compare current version with the version of client request and if they are the same write changes to the db
- otherwise notify client to reread the record and resubmit the request
- with each write increment the record version.
The booking transaction will consist of one method call modify() on the RMI server which will wrap the call to Data.modify() with the above described procedure. In the local mode actual Data.modify() will be used.
Advantages: clients that fail before the final write do not affect each other; no locking/timing is involved
Disadvantages: extra data file, possibility of loosing points for not following instructions and not implementing lock()/unlock() methods.
Any comments are welcome.
Regards, Ihor
Rudy,
Now it's more clear what your overloaded find() does. I did the same but inside the criteriaFind() with the little difference that my criteria is stored in the array of ArrayLists which is a bit more efficient to traverse than synchronized Vector. I also keep separate int[] of indexes for even faster scanning of search criteria.
Regards, Ihor
Rudy,
If you call find() from criteriaFind you will be searching
the whole database per EACH column in your search criteria.
More efficient way would be to use the code from find()
as an example of how to write criteriaFind() which will
do one database scan per all columns in the search criteria.
Sun does look at the efficiency of criteriaFind.
Regards, Ihor
Use an adaptor class to wrap calls and to catch and rethrow
exceptions of the type you need.
To clear the confusion about data conversion tool (DCT). This was the part of earlier version of the assignment, which had the ASCII data file. Then you have to write the DCT to convert it to binary format. The new version of assignemt already has the db in the binary format, hence the DCT is irrelevant.
I have the old version (got it on 10/15/2000) and initially thought the DCT will give me some extra work. Now, after finishing it (it took 3-4 days of research/thinking and 4-5 hours of coding/debugging), I can say it was not bad at all. I learned very interested classes and know a bit more about Java.
Good luck with FBN,
Ihor.
You can also try experimental gcc_java
compiler which will compile your java source into executables the same way as C or C++. I think there are some other java compilers out there. The new JDK 1.3 has very smart hotspot engine which will compile some parts of the byte codes 'on the fly' to improve performance.
23 years ago
Regarding the abiguity of some exam questins. Everything depends on the your level of knowledge and experience on the subject. Some questions may look ambiguos to novice Java programmers while otherwise they are perfectly clear to their authors. To me only two questions looked ambigous which does not mean they are so in the total view. Now, when I look more on the subject, everything got clear. My advice in this case would be: read the question several times without any assumptions (like you read it for the first time every time).
About Exam Cram. The only thing I did not like about that book was that it has answers to the practice questions right below the quetion itself. It may be useful for learning the stuff the first time but for refreshing and cramming I prefer got get my own answer and then compare it with the correct one. So I had to cover the answer every time I read the question. Otherwise the book is good for refreshing and finalizing all your knowledge.
The sample exam shares the same questions as Exam Prep's 2 exams,
and on-line Bill Brogden's mock exams.
Ihor.
Thanks everyone for warm replies. Unfortunately I did not keep
my notes in software format, just hardly readable paper copy, and I'm not planning to transfer them to soft format (I'm on vacation as of tomorrow). There are plenty of notes available on the net, although I found few errors in each one. Some of the notes have outdated info (e.g. by: Heather McKenzie - you can't create a file using File class, but in Java 2 there is a number of create...() methods in File class (as well as delete()), by Amandeep Waraich - there is no sqr() method in Math class, pow() should be used for this purpose - wrong: there is a method java.lang.Math.sqrt(), etc.). If you want to make any use of those notes make sure each concept stated in them is very clear to you. Do not take everything you read for true.
Hi everyone.
I was relativelly easy with a lot of smart questions on fundamentals. Some questions were ambiquos to the extent I understood them. There were 5 fill-in questions, 1 on gc, 2-3 on threads, none on graphics, 4-5 on awt, 1-2 simple questions on I/O (as in the objectives - nothing more), two famous mediatrucker and socket (I think Sun will remove them soon).
I studied (not full time) 7 months with some serious mocking last week. My advice to others who are going to take the exam is to keep your own notes on topics that are not clear at the first time WITH simple examples you create yourself and run through the compiler, keep also notes on wrong mock answers.
My sources were:
1. Khalid, Munghal, Rasmussen.
2. Exam Prep.
3. Exam Cram.
4. Lots of mock exams. (Do read Sun samples).
5. My notes.
6. some Thinking in Java and JLS (do not need to read the whole things).
#2 was the most disappointing.
#5, #4 were the most helpful.
#1, #6 give you understanding of fundamentals.
Ihor.
Does someone have links to other companies that provide Java Certification excluding IBM?
I have a few comments about questions b) and d). b) is worded a bit confusing. I think it should say: "You can directly invoke the garbage collector whenever you want." We all know that invoking means "suggest" and that DOS NOT guarantee the GC will RUN immediately (or at all) as a result of this call.
For question d): Does it mean ALWAYS or SOMETIMES? If it means
garbage collector SOMETIMES runs in low-memory situations - then d) is true. If it means ALWAYS - then it's false. You can easily write a program that will consume all available memory resources without even giving a chance for GC to start. In this case your application will halt.
--Ihor
Bongadi, sorry I misspelled your name.