Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: database file-system , +
i want to make sure that my transaction as well as copying of a perticular file happen both simoultanously..or they dont happen
 

how can i achieve this...
Posted 8-Jun-12 2:16am
Comments
krumia at 8-Jun-12 7:20am
   
SQL transaction? Fily copy? where does this happen? Which SQL server? Is file copying done by the SQL server, or is it a separate process?
Sandeep Mewara at 8-Jun-12 7:48am
   
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You'll need microsoft transaction server (mts) for this. With it, you create a transaction context, execute multiple actions (like file handling and database updates, also mixed) that all need to call SetComplete (indicating the code didn't encounter any problems). When you then call Commit, MTS will try to commit all the actions. If one of the actions called SetAbort or the Commit somehow fails, a full rollback will ensure nothing changed.
 
Check out this link for more info:
http://technet.microsoft.com/en-us/library/cc805563[^]
 
Good luck!
  Permalink  
Comments
gaurish thakkar at 8-Jun-12 9:13am
   
thanks ..and the copying is not done by sql
E.F. Nijboer at 8-Jun-12 17:01pm
   
My idea was also that the copying of the files wouldn't be done using sql. The nice thing is that file operations are also permitted in the transaction context together with the database operations. mts will then ensure both to be in a transaction.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,803
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,421
3 Manas Bhardwaj 4,841
4 Maciej Los 4,330


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 8 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100