Click here to Skip to main content
11,923,046 members (65,521 online)
Rate this:
Please Sign up or sign in to vote.
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
krumia 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 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
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:[^]

Good luck!
gaurish thakkar 8-Jun-12 9:13am
thanks ..and the copying is not done by sql
E.F. Nijboer 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151125.3 | Last Updated 8 Jun 2012
Copyright © CodeProject, 1999-2015
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