File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes We should wrap delete/create/update in lock/unlock ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "We should wrap delete/create/update in lock/unlock ?" Watch "We should wrap delete/create/update in lock/unlock ?" New topic

We should wrap delete/create/update in lock/unlock ?

james bonds

Joined: Feb 19, 2007
Posts: 9
In the Data(access) class, we should wrap read/delete/create/update in lock/unlock ?

In the DB tier, I did not wrap read/create/update/delete in lock/unlock.
Just,in the booking method of GuiController class(GUI tier), I wraped the update in lock/unlock as follows,not Data (access) class.

The assignment does not require other funtions except booking.
So,I think that others(create/delete/read) do not need wrapping.
Of cource, If the assignment required me it, I would wrap others.

Am i right?

[ February 20, 2007: Message edited by: james bonds ]
Mark Smyth
Ranch Hand

Joined: Feb 04, 2004
Posts: 288
Yep I think that is a good approach and is very similar to how I have also done this. No need for create and delete in your gui so there is no need to wrap these. BTW - Create does not require a lock/unlock as the record does not exist before the method completes.


It is sorta covered in the JavaRanch Style Guide.
subject: We should wrap delete/create/update in lock/unlock ?
Similar Threads
functionalities for client?
Max. Denny's DVD Project: GUIController class doubt
About:My URLyBird1.3.2 Locking
Design of data access layer - please comment on