I just started the Developer Cert, and I'm running into several questions, particularly with the database and record locking.
(I have the home improvement contractor assignment, by the way)
I see a lot of discussion about lockCookies. My assignment says nothing about them, and the method signatures would seem to prevent them. (public void lock(int recNo), etc.)
My main question is, is it safe to assume that my server will be the only client for this database? Without lock cookies, it seems that I would have to trust a thread to only unlock a record that it has currently locked.
Also, if all the locking is done server-side, it seems like it might as well all be done inside the create, update, and delete methods, rather than forcing the client to lock-modify-unlock.
If the lock is done inside the writing method, however, that means that a database client (still server-side) trying to do lock-modify-unlock, would create a deadlock.
So, the big question: If the GUI client cannot cause deadlock, and the exposed server methods cannot cause deadlock, am I safe, even though directly calling certain database methods could cause deadlock?