Robin Underwood

Ranch Hand
+ Follow
since May 01, 2002
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 Robin Underwood

Congratulations! I really like how you implemented connecting to multiple databases!
21 years ago
Congratulations and good luck to you!
21 years ago

Is it the sequence number of a record in the database or it is same as the member variable "recordNumber" of DataInfo?


It is both. The record number is the key of the database and provides a unique value to indicate which record should be locked.
As far as identifying the client, I generated a unique sequence number on the server to identify the client, but I think most people have just used the remote connection object itself to identify the client. I think I remember some posts where other people have come up with creative strategies to avoid identifying the client at all.
I'd recommend using the MVC pattern for the client. If you search through this forum you'll find lots of very different implementations of the MVC pattern.
I'd recommend searching through this site for information on locking and unlocking. You can lock just one record, and have a client wait until it is notified that a lock has been released by another client.
I didn't provide a reconnect option. The client would get a RemoteException if the server went down, but the client would also get a RemoteException if there were network problems,...etc.
In my application the client would receive a "Server is unavailable" popup error for any RemoteException. Then both the client and server would need to be restarted.
Just read through the postings on this site and you can get a pretty good feel for what the assignment is like. It does end up costing $400 between the assignment and the follow up exam.
My client application just waited with a busy cursor. It would have been better to display a "please wait" message and prevent further screen entries.
You don't pass the port number from client to server.
First the server is started on a particular port number. Then the client needs to select that same port number either through a command line argument or through a GUI. Both the host and port would be included in the client's JNDI lookup of the remote object.
What you need is a Main-class header in your manifest file to identify which class is executable.

Then jar using -cmfv options.
Final jar name info is copied from another link:
"The name of your submission archive file MUST be derived from your i.d. as shown here. (Note that in the United States, your i.d. is your 9-digit social security number, e.g. 555443333. Outside the U.S., your i.d. might be 9 digits, or it might be 2 characters followed by 7 digits, e.g. sp1234567.) Your archive filename MUST BE scjda-AAAAAAAAA.ZZZ, where AAAAAAAAA is your i.d., and
ZZZ is the appropriate filename extension for your archive type (zip, tar, or jar)."
[ July 31, 2002: Message edited by: Robin Underwood ]
I think it's fine as long as the client knows it always uses the default port 1099. I don't think Sun requires the assignment to run on other ports, but I did write my project to run on any valid port.

Robin, I'd like to know when your JOptionPane shows,
will your confirm booking dialog disappear?
did you do the booking
in your confirm booking dialog?


Yes, the confirm booking dialog will disappear before the JOptionPane shows.
In my MVC implementation, the Controller makes all the decisions. So the confirm booking dialog just displays a message (passed from the Controller), and allows selection of seats. The Controller will then ask the dialog whether OK or Cancel was pressed, and how many seats were selected. Then the Controller will ask the DataClient to book the flight.
Server does not need to know about local or remote mode. Server only needs to be started when running in remote mode.
The client needs to choose whether it runs in local or remote mode. When running in remote mode, client will need to know the host and port of the server.
I think it's OK to leave text messages in the code. That's what Sun did in its Data class.
Nate, I did option 2. My confirmation dialog recapped the chosen flight info and allowed selection of the number of seats. Then I used a JOptionPane to let the user know whether or not the booking was successful.
[ July 30, 2002: Message edited by: Robin Underwood ]