File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create()

 
GD Deepz
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic