It's not a secret anymore!
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Create() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Create()" Watch "Create()" New topic


GD Deepz
Ranch Hand

Joined: Sep 29, 2004
Posts: 55
This has probably been asked before but I guess locking will not be required for create(). There is really nothing to lock. However, the actual writing of the data to the database will be sychronized as such the database itself need not be "locked" --- Is this correct?

X-Mas and Happy New year to everyone
Jared Chapman
Ranch Hand

Joined: Feb 23, 2004
Posts: 81
I didn't use locking with create(). I keep a list containing record numbers of deleted records. I synchronize on this list, create the record at the record number contained in the first index of the list, and if successful, remove this record number from the list of deleted record numbers. If the list of deleted records is empty, I simply add the record to the end of the file.

B.S. University of Wisconsin<br />SCJP 1.4 (85%)<br />SCJD 1.4 (92%) B&S Contractors
Have you checked out Aspose?
subject: Create()
It's not a secret anymore!