Mark Ebeling

Ranch Hand
+ Follow
since Jul 06, 2007
Merit badge: grant badges
Mark Ebeling

Senior Consultant


SCJP 5.0
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 Mark Ebeling

Well, I don't display what is given, only what I have hard-coded. But if it was different I would error out and exit.
The one thing I did that I don't see mentioned here is that I hard-coded it, but also checked that what I read in matches the field names and lengths for all six fields. If there is a mis-match I post a message to the Log and screen, and exit. I am just a little nervous about this, since if the test file the examiners use has a slight difference, I am dead. But I am going to trust that they know what they are doing.
Congrats Markus!!!
Sounds like something I would like to try but I do have a question. By setting the layout to null, and having to give exact coordinates, how does resizing work? Would it resize automatically?
Seems reasonable to me. I have not seperated out a business layer yet so I appreciate the ideas. Man - that must have taken sometime to type into this post!
And I am not sure what you are asking. I am using Netbeans as my IDE, and I can block copy from it into posts here. I also use Textpad as a basic text editor, but it can also format (java, XML, C++) and build java code when you give it the JDK. ( can you tell I like freeware!)
[ September 05, 2007: Message edited by: Mark Ebeling ]
I think you are confusing the Owner ID and the lockcookie into one issue, when in fact they are 2 seperate functions. The Owner ID is a user defined number that will be assigned during a Book action. All you will need to do is write this number to a file record. Once booked, there is (at least in my requirements) no need to unbook.
The lockcookie is used to lock database records before update/deletes can be performed. So the sequence should be lock - update - unlock. In order to obtain the lock, the record must be unlocked ( and in my assumptions - not deleted).
I return the lockcookie ( long ) creating a random number as follows:

Then when the update or unlock is called, the passed in lockcookie must match the one I have stored in memory for that record.

Hope that helps.
I am missing where the scjda... file is mentioned? All I have in my directions is the following:

Packaging of Submissions
All elements of your submission must be packaged in a single JAR file. The JAR file must have the following layout and contents in its root:

  • The executable JAR containing the programs. This must be called runme.jar.

  • So isn't it the the runme.jar that needs to be uploaded. Or is there a direction on the upload page that tells you to rename your file?
    Well, I have used the book too. But Andrew is on this forum all the time. He has been very careful not to give away to much, and Sun knows about the book and this forum. So as long as you make the code your own by changing names and of course functionality, it is not considered cheating to use the structure he presents. At least that is what I gather from all the people who have passed and have used his book.

    We are not applying for a copywrite; just being tested on knowing concepts and pulling those concepts into a working project. The whole process is really the test, and I am learning a ton just going through the process using Andrew's book. I think it is a great book and has taught me a ton. The concepts I have learned is what I believe Sun wants us to know in order to be certified.
    Well, at least I am on track for my project. Boy, sounds like you have had some experience with some Rogue developers.
    If I am wrong let me know. But I thought Thread 1 ( client 1 ) would be the only thread to have the correct cookie.
    How could Thread 2 (client 2) come along with the correct cookie also and unlock? Only thread 1 has cookie since it locked the record.
    What am I missing?


    Oh, and I wanted to add that I am assuming (in my choices.txt) that each thread must call methods in Data in the following order:
    1) Data.lockRecord();
    2) Data.update/deleteRecord();
    3) Data.unlock();
    [ August 31, 2007: Message edited by: Mark Ebeling ]
    I don't know if this helps, but I put in a LockManager similar to what Andrew shows in his book (pg. 158). Then I only allow access to the delete method in my Data class as follows:

    This way you can only delete if you have locked the record first, and have the actual key. The LockManger just decouples the locking from the data access. You either have the correct lock or not. I will definitely define all my conclusions in my choices.txt, but I think this is how others have coded and passed.
    Hey Uzma,
    I also have to return a long [] in my B&S assignment. But I am questioning why you are not pulling the database into an internal cache ( I use an ArrayList ) and search it instead of constantly retrieving from the flat file?