December 25, 2009 at 10:16 pm
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
December 26, 2009 at 9:14 am
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.
December 27, 2009 at 6:06 am
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply