PC Review


Reply
Thread Tools Rate Thread

ado.net transactions

 
 
=?Utf-8?B?YWppdA==?=
Guest
Posts: n/a
 
      11th Feb 2005
I am getting this erroor on transaction.commit
"stack overflow"

on transaction.rollback i am getting this
{"This SqlTransaction has completed; it is no longer usable." }

I am passing same transaction object to lot of methods like say 12
which call stored procedures

how to overcome this problem.

I dont want to use com+

Thanks
Ajit
 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      12th Feb 2005
i guess you are invoking begintransaction too many times?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

"ajit" <(E-Mail Removed)> wrote in message
news:C98FD3F2-14CF-4496-A9D6-(E-Mail Removed)...
>I am getting this erroor on transaction.commit
> "stack overflow"
>
> on transaction.rollback i am getting this
> {"This SqlTransaction has completed; it is no longer usable." }
>
> I am passing same transaction object to lot of methods like say 12
> which call stored procedures
>
> how to overcome this problem.
>
> I dont want to use com+
>
> Thanks
> Ajit



 
Reply With Quote
 
=?Utf-8?B?YWppdA==?=
Guest
Posts: n/a
 
      14th Feb 2005

No I am not I am doing something like this



Re: ado.net transactions
Posted: 02-14-2005 10:04 AM
using (SqlConnection connection = new SqlConnection(ConnectionString))
{
connection.Open();

using (SqlTransaction transaction = connection.BeginTransaction())

{

try
{
using (INASBAL.Service service = new INASBAL.Service())
{




service.SequenceID = service.InputAccountData(transaction, ref dt);

ParseAndInsertAccountLeadType(transaction, ref dt, nav, service);


ParseAndInsertAccountDisabilityCoverage(transaction, ref dt, nav, service);


ParseAndInsertAccountAuthorizedRider(transaction, ref dt, nav, service);


ParseAndInsertMailingAddress(transaction, ref dt, nav, service);


ParseAndInsertAccountAgent(transaction, ref dt, nav, service);


ParseAndInsertAccountAuthorizingOfficer(transaction, ref dt, nav, service);

ParseAndInsertAccountBillingContact(transaction, ref dt, nav, service);
ParseAndInsertAccountBroker(transaction, ref dt, nav, service);
ParseAndInsertAccountFlexOneBenefit(transaction, ref dt, nav, service);
ParseAndInsertAccountLegalRep(transaction, ref dt, nav, service);
ParseAndInsertAccountContactFsa(transaction, ref dt, nav, service);
ParseAndInsertAccountFlexIneligibleBen(transaction, ref dt, nav, service);


ParseAndInsertAccountOtherCarrierBen(transaction, ref dt, nav, service);

//
//if all successful commit transaction
//
transaction.Commit();

}//using service

}//try

catch (Exception ex)
{
transaction.Rollback();
throw ex;
}

}//using transaction

}//using connection


INSIDE THESE METHODS I AM USING MS DATA APPLICATION BLOCK LIKE

Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(transaction,
CommandType.StoredProcedure, strProcedure, arParms);


Thanks
Ajit

"Miha Markic [MVP C#]" wrote:

> i guess you are invoking begintransaction too many times?
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & development
> www.rthand.com
> SLODUG - Slovene Developer Users Group www.codezone-si.info
>
> "ajit" <(E-Mail Removed)> wrote in message
> news:C98FD3F2-14CF-4496-A9D6-(E-Mail Removed)...
> >I am getting this erroor on transaction.commit
> > "stack overflow"
> >
> > on transaction.rollback i am getting this
> > {"This SqlTransaction has completed; it is no longer usable." }
> >
> > I am passing same transaction object to lot of methods like say 12
> > which call stored procedures
> >
> > how to overcome this problem.
> >
> > I dont want to use com+
> >
> > Thanks
> > Ajit

>
>
>

 
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
Supporting Transactions A La System.Transactions in a custom system aldousd666 Microsoft ADO .NET 2 9th May 2007 01:49 PM
"Supporting" transactions a la System.Transactions aldousd666 Microsoft Dot NET Framework 0 8th May 2007 02:36 PM
C# transactions v SQL transactions Mike P Microsoft C# .NET 11 24th Sep 2004 06:29 PM
Transactions??? Akhil Microsoft C# .NET 3 19th Aug 2004 05:49 PM
Mixing ADO.NET transactions and Stored Procedure Transactions James Walker Microsoft ADO .NET 1 27th May 2004 11:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:35 AM.