commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: jakarta-commons-sandbox/transaction/xdocs/file index.xml
Date Mon, 01 Nov 2004 20:01:07 GMT
ozeigermann    2004/11/01 12:01:07

  Modified:    transaction/xdocs/file index.xml
  Completed documentation
  Revision  Changes    Path
  1.2       +60 -1     jakarta-commons-sandbox/transaction/xdocs/file/index.xml
  Index: index.xml
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/xdocs/file/index.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.xml	1 Nov 2004 18:25:51 -0000	1.1
  +++ index.xml	1 Nov 2004 20:01:07 -0000	1.2
  @@ -10,7 +10,66 @@
   <section name="Transactional file access">
  - <p></p> 
  + <p>Sometimes it may be desirable to save a single file or even a
  + number of related files to the file system atomically. This means if
  + you write something and an error occurs or for any reason you change
  + you mind and rather want to cancel what you did. Consider your
  + application fails in the middle of overwriting important data which
  + neither gives you the old state nor the new one, but rather a
  + corrupted one. Or only part of your data has been written leaving you
  + with an inconsistent state.</p> 
  +<p>The <a
  +file</a> package provides you with code that allows you to have atomic
  +read and write operations on any file system. The <a
  +resource manager</a> offers you the possibility to isolate a number of
  +operations on a set of files in a transaction. Using the <a
  +href="../locks/index.html">locks package</a> it is able to offer you
  +full ACID transactions including serializability. Of course to make this
  +work all access to the managed files must be done by this
  +manager. Direct access to the file system can <em>not</em> be
  +monitored by the manager.</p>
  +<p>When you <a
  +a transaction you need to provide an indentifier to later refer to
  +this newly started transaction. You can also let an identifier be <a
  +for you. Calls to e.g. <a
  +or <a
  +to</a> will need the identifier to know which transaction they belong to.</p>

  +<p>Finally when you want to
  +commit the transaction call <a
  +or <a
  +to undo all changes. The transactionality is achieved by first writing to
  +temporary files and upon commit moving or copying them to the primary
  +location. Locks and a delicate commit mechanism will assure that no
  +data corruption occurs.
  +<p>A fail safe <a
  +sequence</a> is the second main part of the file package. Just like
  +sequences known from Oracle or other relational database systems it
  +provides you with a unique ids. Each call to the <a
  +method will return a new unique long number and persists the current
  +value of the sequence to disk. This means when you shut down your
  +system and restart it you will still get no double
  +numbers, but the sequence will continue. Additionally, this sequence implementation is
fail safe which
  +means when an error occurs while saving the value of the sequence to
  +disk you still are guaranteed not to get any double values. The file
  +containing the value is guaranteed not to be corrupted as well. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message