Administration of Transactions in a second session opened in first session

  • Hey Pals,

    Is there any way out there to commit/Rollback the transactions opened in FIRST session , in the SECOND Session?

    Here is the elaboration of my query:

    I will open a Transaction in Session Id=60 and I want to commit/Rollback this transaction in Session Id 65.

    I know Rolling back a open transaction can be done by executing KILL statement against the Session Id...but no idea about Committing.

    Throw some light on this case, Guys...

    In 'Thoughts',

    [font="Comic Sans MS"]Lonely Vampire[/font]

    --In 'thoughts'...
    Lonely Rogue

  • AFAIK, you cannot commit that transaction. How would the server know if all work has been done for the transaction? Another connection can't necessarily know that, so the only thing you can do is kill it.

    A transaction isn't necessarily one batch. A distributed transaction from a client (think .NET here), might send some data to SQL Server, some to an AS/400. Until it gets a note that both items are complete, it doesn't issue a commit on both sides. If you had a way to commit that from another session, you might do so before the other side responded.

  • A transaction can only be committed in the session that it was started in. From another connection all you can do is kill it, which forces a rollback.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply