Transaction Problem after upgrading ASP.Net + C# App. from .Net 2.0 beta to .Net 2.0 Professional

  • Thread starter Thread starter Beenz
  • Start date Start date
B

Beenz

Hello,
I am developing an application in C#, which was previously in .Net 2005
Beta, then it was working perfectly fine, but from the time I have
upgraded
it to .Net 2.0 Professional, its continously giving me error on the
following line,
transaction = Connection.BeginTransaction();

System.Data.SqlClient.SqlException: New transaction is not allowed
because
there are other threads running in the session.
at System.Data.SqlClient.SqlConnection.OnError(SqlException
exception,
Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateO
bject
stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at
System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte
[]
buffer, TransactionManagerRequestType request, String transactionName,
TransactionManagerIsolationLevel isoLevel, Int32 timeout,
SqlInternalTransaction transaction, TdsParserStateObject stateObj)
at
System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(T
ransactionRequest
transactionRequest, String transactionName, IsolationLevel iso,
SqlInternalTransaction internalTransaction)
at
System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction(Transa
ctionRequest
transactionRequest, String name, IsolationLevel iso,
SqlInternalTransaction
internalTransaction)
at
System.Data.SqlClient.SqlInternalConnection.BeginSqlTransaction(Isolatio
nLevel
iso, String transactionName)
at
System.Data.SqlClient.SqlInternalConnection.BeginTransaction(IsolationLe
vel
iso)
at
System.Data.SqlClient.SqlConnection.BeginDbTransaction(IsolationLevel
isolationLevel)
at
System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransacti
on()

I removed Beta using a Microsoft provided utility. This same project is
running on another machine and giving the very same error. I am logged
in as
admin. and all kind of settings are perfectly fine.
The problem with this error is that its occuring on some actions, while
on
others application works fine. Initially some actions works perfectly
fine but if once this error starts coming on that particular location,
its keep on coming exactly on the same location, reboot don't have any
effect on this.
Multiple Active Results sets is on.
This error has made our application extremely unstable. quick help will
be appreciated.

Beenish Sahar Khan,
Software Developer,
Kolachi Advanced Technologies
 
Hi Beenz,

Are your starting a new transaction when a DataReader is left open?

This is by-design. In order to avoid non-determinite transactional state,
there must be no open operations while executing a transaction change. To
allow this would be to allow indeterminite state. You wouldn't know what
operations were part of of the transaction or not. This was changed recent
builds and the RTM build.

So, please close the reader and start the transaction. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Dear Kevin,

Hello,

Thanks very much, your answer was quite right and solved our problem. I am
really thankfull to you. Btw. Just a compliment, you guys are doing a great
job, two thumbs up to you ppl (Y) Regards, Beenish Sahar Khan
 
You're welcome, Beenish. It was nice to know that you have had the problem
resolved.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top