This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!

yi lu

+ Follow
since Dec 26, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by yi lu

I passed SCJD with score 143
General Considerations (maximum = 58): 58
Documentation (maximum = 20): 20
GUI (maximum = 24): 18
Server (maximum = 53): 47
Last question: IF one client lock record X, then when he is modifying the database, he exit the system before UNLOCK it
the record X will be locked forever, how the server know there is a record should be unlock by itself?
[ March 02, 2004: Message edited by: yi lu ]
15 years ago
I have uploaded my program.
when can I take part in the computer-base test?
My job is "Fly By Night Services".
When I finish, maybe I would fail in uploading the zip file because the user document is big with some screenshot-pitures, and my modem is not so fast to upload it.
If I only write user document without screenshot, will it reduce my score?
(without screenshot, the size of zip file is between 200K and 300K. Then it will be ok to my modem.)
If it will reduce my score, what can I do to upload such a big file?
[ February 07, 2004: Message edited by: yi lu ]
which of above should copy to client?
and which of above should copy to server?
Why only port 1099 do well in my computer?
when I use any other port number, an exception is throwed like this:java.rmi.ConnectException: Connection refused to host: localhost; nested exception Connection refused:java.lang.NullPointerException
is there any restriction with RMI'port? like closing firewall, start some system web server and so on.
my policy is :
grant {
permission "", "";
permission "localhost:1024-65535","connect";
sorry, these sentences do not exist in my instruction. 55555555555~~~~
Originally posted by Andrew Monkhouse:
In your instructions you should have the statement "You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.".
In other words Sun are guaranteeing to you that they will never run two standalone clients simultaneously. Nor will they run the standalone client and the server simultaneously. Nor will they run two servers simultaneously.
if non networked mode can't run along with network mode, does it means in non networked mode, I need not consider lock/unlock because of only one client?
[ January 05, 2004: Message edited by: yi lu ]
Thanks a lot, something still unclear to me:
in the instruction:
Architecturally, the application is a traditional client-server system. There are three key parts: the server-side database with network server functionality, the client-side graphical user interface, and a client-side database client part that handles the networking on behalf of the user interface.
Additionally, the program must be able to work in a non-networked mode. In this mode, the database and user interface run in the same VM and no networking is performed, and no sockets should be created. The user must be able to select the operating mode, although it is acceptable that the program stay in one mode once it has started up.
db-file in A computer
a client in A computer
b client in B computer
Client a <------(non-networked mode)------->Database in A computer
Client b <----->Server in A computer<------>Database in A computer
when "a" client use non-networked mode and "b" client use network mode, in this situation, how does the Server handle(lock/unlock) the request from "a" client
yes, I know I can lock it by a static variable
but, if I do not lock the WHOLE database(the file) when any client modify only ONE record,
then when two client modify two different records at the same time(it is OK for not locking mark in two different records),
it means two program write ONE file at the same time,
Can the system(like windows) support two program write ONE file at the same time?
When running two clients you connect to a server. The object on the server side should take care of locking, and is the same for both clients.
I know I should take care of locking
and what I want to know is how to lock?
need the db-file change its format(add a lock mark field)? eg. when the lock mark field=0,the record is locked, when the lock mark field=1,the record is unlocked,
in the instruction:
Record locking must be implemented using the methods public void lock(int) and public void unlock(int). These methods are required to allow concurrent use of the database when booking flights from multiple clients.
multiple clients must be in different computers and run the same jave class file, need the db-file change its format(add a lock mark field) to adapt the lock and unlock methods?
[ January 02, 2004: Message edited by: yi lu ]
There are two Processes, not two Threads
we run "java test.class" twice and in two computers, how to wait or notify another Process in another computer?
[ January 02, 2004: Message edited by: yi lu ]
in the instruction:
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.
in which situation should I lock the the entire database?
How to get the magic cookie of the db-file