Sam Wong

Ranch Hand
+ Follow
since Dec 07, 2000
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 Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sam Wong

If you must implement multi line headers, then I would suggest creating your own custom renderer for the headers. Within that, you can alter the value to include HTML tags. It's not that heavy at all.
Hmm, never heard of this requirement before. I find it highly doubtful that this is true. Who's to say that my IP or MAC address can't change over the course of months? You probably misinterpreted. I believe what they meant by that sentence is that you should be uploading the assignment via the same web page location that you downloaded the assignment. Either way, I wouldn't worry too much about this.
Last resort is to have some code in the finalize() method to notify the the rmi server that the application is going down and to release the lock on record #x. Just brainstorming. Not sure if this solution is feasible.
Luis,
Your points are quite correct. The synchronized methods will not be efficient. In the real world, would you use a file pointer? No. A database server is the most likely choice. But for the purposes of this exam, it isn't available. Hence, synchronized access will have to do. So, don't sweat over it.
Sam
Off the top of my head, maybe you can try an event notification model to notify interested listeners that the record is freed. The listener may be a record locking manager that handles record locking requests. Just an idea. Hope it will spark your own ideas about this.
davidlong,
Please read the JavaRanch Naming Policy and register using a name that complies with the rules.
Thank you,
Sam Wong
The main advantage of such an approach is to avoid passing client id as a parameter to track lock ownership on the database. By ensuring that lock/read/write/unlock work as an atomic operation, client id becomes irrelevant. It can work if done properly and handling all exceptions.
It's good that you recognize that creating an instance of Data for each criteriaFind invocation is wrong. You probably even want to stay away from passing in Data from main. Try to use interfaces to decouple your classes. I don't know what your design looks like but it seems everthing is tightly coupled together.
You can read the entire record including the rec num but exclude it from display with the use of a TableColumnModel. This will allow you to reference and model and get the rec num.
Matt,
I didn't understand exactly what the problems you're having. Could you clarify?
There's no time limit for the assignment so download the assignment and go at it at your own pace.
This is oversimplification of the differences but I feel the main one is data marshalling. RMI takes care of that for you whereas you're on your own with sockets.
I think the format of the message was the intent of the example, not the actual content. You're right in that Origin does not exist and it would return 0 data. You're throwing an exception which is fine. I don't have the assignment available in front of me right now but I thought it stated that any errors in the search criteria string should yield the same behavior as an empty result set.
Conceptually, your model shouldn't care whether the rows contain empty data or not. If it can display it, then do so. Your method checks whether the row and column exists and then display the string representation. What you're missing is the check on the array itself. Check whether rowData is null and also check whether the indexes are valid in that it doesn't go beyond the length of the arrays.
<pre>
public void setValueAt(Object obj, int r, int c)
{
if (rowData != null && r < rowData.length && c < rowData[r].length)
{
rowData[r][c] = obj.toString();
fireTableCellUpdated(r,c);
}
}
</pre>
I'm not sure why you check the schema which I assume contains the field headings, etc.
My opinion is that it wouldn't negatively affect your grade regardless of whether you support add/delete. Perhaps, someone who has completed their SCJD can shed some light on this.
Sam