Originally posted by Eric Kim:
I find there is no way to get test case work with server side locking.
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Eric Kim:
My understanding is the UI just need book() (Essentially a read and then update) and find() business methods, UI does not need to create record on the server side, am I correct?
Yes, there's no need to make create avaliable outside the Data class.
Another issue is in the instruction it mentions that when run UI as a standalone app, no locking is allowed. Obviously no locking is required in this case, but in the Data class it will still check lock cookie as the interface is something like this:
How should I address this issue?
Non-Networked Mode
The program must be able to work in a non-networked mode. In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements.
The operating mode is selected using the single command line argument that is permitted. Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all.
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Eric Kim (in response to George):
I totally agree with you, if I only expose book()/find()/getColumnName()/GetRecordCount() methods to client, and implement lock in both book() and find() on server side, then it can handle the test case quite nicely and there is no chance to create deadlock or stale data even if client crashes.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Javini Javono:
I take it that the major difference between the o-lock and the p-lock, is that
1. In the o-lock, you might have to come back to your client and say, "sorry,
but that room is no longer available."
2. In the p-lock, you know in advance that it is available since you hold the
lock until the client either clicks "book" or "cancel."
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |