1 Reply Latest reply on Feb 21, 2006 2:26 PM by Adam Warski

    atomic transactions

    jasonw1 Newbie

      This is probably a topic for another forum. If I am saving the contents of a file within a database and saving/updating the file to svn how can I garruntee atomicity? For instance I am parsing a file and storing the contents in a database and then saving the file in svn/cvs. By storing the contents in the database I can search and perform calculations on the contents. Also, by saving the file in svn I have the orginal data which I can retrieve later for viewing through other programs.
      So, in this example how can I garunttee that when the data is inserted/updated in the database is an atomic transaction with saving the file to svn. I know I could rollback the database transaction back if there is an error saving to svn. What if ... there are multiple users saving the same file?

      user A commits changes to the database
      user B commits changes to the database
      user B saves the file
      user A saves the file

      even if this is within a small block of code the such as...

      //save to database
      //save file
      //commit database changes

      so now the database is out of sync with the latest file within svn.
      Again this might be a question suited for another forum, and advice is approciated even you tell me another forum to post on ;)