This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird DB Locking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird DB Locking" Watch "URLyBird DB Locking" New topic
Author

URLyBird DB Locking

Cathal Mullan
Ranch Hand

Joined: May 20, 2011
Posts: 118
Hey Guys,

I have taken a look at some posts regarding the URLyBird DB locking, I see that people are returning lock keys to the front end.

I am wondering why people are doing this?

My plan is to have a thin client that connects to an RMI server. Behind this I will have a business layer.

In this business layer I was going to:

1. Get the lock for the record
2. Check the record has not been changed since it was retrieved
3. Update the record
4. Release the lock

So no returning lock keys to the front end.

Did anybody who passed the OCMJD do this too? Or am I missing something important?

cheers
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5139
    
  12

It all depends of course on the interface you've got. For example my interface does not have a lockCookie, so I had to come up with a slightly different approach. But for a thin client you don't need to pass the lockCookie back to the client, all the magic can happen on the server.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Cathal Mullan
Ranch Hand

Joined: May 20, 2011
Posts: 118
Hey Roel,

my services interface would be something like:



so no lock keys returned to the front end, seem ok to you?

cheers
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5139
    
  12

Lacks some business exceptions, but that's not the point here Seems ok to me
Cathal Mullan
Ranch Hand

Joined: May 20, 2011
Posts: 118
Cheers for the advice, just want to make sure I don't get an automatic fail
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5139
    
  12

Just remember: I am not an accessor, so there is no guarantee that the given advice will not result in automatic failure. If you violate a must requirement, you'll fail (automatically). For all other decisions there is no good or wrong, just document your decisions in choices.txt and you'll be fine (and an OCMJD soon)
Cathal Mullan
Ranch Hand

Joined: May 20, 2011
Posts: 118
Hopefully

cheers
 
wood burning stoves
 
subject: URLyBird DB Locking
 
Similar Threads
URLybird
dealing with lock lost - URLyBird
Implements DBAcess - URLyBird 1.2.3
URLyBird:1.2.1 Accessing the database
URLyBird 1.3.3 - a few questions