PC Review


Reply
Thread Tools Rate Thread

transaction scope

 
 
Smokey Grindel
Guest
Posts: n/a
 
      15th May 2008
If I am inside a function that returns a boolean and i have all the commands
inside it inside a transaction scope and I do something like a return false,
which causes it to never run the trancastion scope's complete method, this
does cancel out the transaction right? causeing it to rollback? thanks!


 
Reply With Quote
 
 
 
 
Misbah Arefin
Guest
Posts: n/a
 
      16th May 2008
using (TransactionScope ts = new TransactionScope())
{
//call complete on the TransactionScope or not based on return value
if(someFunc())
ts.Complete(); // Commit the transaction
}


if someFunc() reutrns false - the transaction will rollback because you are
exiting the scope without calling ts.Complete();


--
Misbah Arefin
https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
http://dotnethitman.spaces.live.com
http://www.linkedin.com/in/misbaharefin




"Smokey Grindel" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> If I am inside a function that returns a boolean and i have all the
> commands inside it inside a transaction scope and I do something like a
> return false, which causes it to never run the trancastion scope's
> complete method, this does cancel out the transaction right? causeing it
> to rollback? thanks!
>
>

 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      16th May 2008
Smokey,

Yea there can be "something", however without showing code you are the only
one who can fix that.

Cor

"Smokey Grindel" <(E-Mail Removed)> schreef in bericht
news:%(E-Mail Removed)...
> If I am inside a function that returns a boolean and i have all the
> commands inside it inside a transaction scope and I do something like a
> return false, which causes it to never run the trancastion scope's
> complete method, this does cancel out the transaction right? causeing it
> to rollback? thanks!
>


 
Reply With Quote
 
Smokey Grindel
Guest
Posts: n/a
 
      29th May 2008
I am confused about what you said, I was just asking how the thing worked,
there is no code to fix

"Cor Ligthert[MVP]" <(E-Mail Removed)> wrote in message
news:35362E06-6F79-43E5-BE5F-(E-Mail Removed)...
> Smokey,
>
> Yea there can be "something", however without showing code you are the
> only one who can fix that.
>
> Cor
>
> "Smokey Grindel" <(E-Mail Removed)> schreef in bericht
> news:%(E-Mail Removed)...
>> If I am inside a function that returns a boolean and i have all the
>> commands inside it inside a transaction scope and I do something like a
>> return false, which causes it to never run the trancastion scope's
>> complete method, this does cancel out the transaction right? causeing it
>> to rollback? thanks!
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transaction Scope AAAAA Microsoft ASP .NET 1 26th Jun 2009 07:51 AM
Transaction Scope and DTC Needs? lucius Microsoft ADO .NET 5 26th Sep 2007 04:14 PM
When in transaction scope how do I run a query outside transaction? Allan Ebdrup Microsoft C# .NET 5 10th Apr 2007 09:53 AM
Using Transaction Scope AnikSol Microsoft ADO .NET 2 1st Nov 2006 05:20 PM
Transaction Scope =?Utf-8?B?VmlzaA==?= Microsoft ADO .NET 5 14th Apr 2005 02:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:53 PM.