PDA

View Full Version : خطای new transaction is not allowed because there are other threads running in the session



amir.khanlari
یک شنبه 20 فروردین 1391, 16:40 عصر
سلام دوستان.
من توی برنامم وقتی دارم اطلاعات رو توی دیتابیسم ذخیره می کنم به این خطا برخورد می کنم


System.Data.SqlClient.SqlException was caught
Message=New transaction is not allowed because there are other threads running in the session.
Source=.Net SqlClient Data Provider
ErrorCode=-2146232060
Class=16
LineNumber=1
Number=3988
Procedure=""
Server=92.....\mssqlserver2008
State=1
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.TdsExecuteTransact ionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj, Boolean isDelegateControlRequest)
at System.Data.SqlClient.SqlInternalConnectionTds.Exe cuteTransactionYukon(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
at System.Data.SqlClient.SqlInternalConnectionTds.Exe cuteTransaction(TransactionRequest transactionRequest, String name, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
at System.Data.SqlClient.SqlInternalConnection.BeginS qlTransaction(IsolationLevel iso, String transactionName)
at System.Data.SqlClient.SqlInternalConnection.BeginT ransaction(IsolationLevel iso)
at System.Data.SqlClient.SqlConnection.BeginDbTransac tion(IsolationLevel isolationLevel)
at System.Data.Common.DbConnection.System.Data.IDbCon nection.BeginTransaction()
at DevExpress.Xpo.DB.ConnectionProviderSql.Connection BeginTransaction(Object il)
at DevExpress.Xpo.DB.ConnectionProviderSql.BeginTrans actionCore(Object il)
at DevExpress.Xpo.DB.ConnectionProviderSql.BeginTrans action()
at DevExpress.Xpo.DB.MSSqlConnectionProvider.ProcessM odifyData(ModificationStatement[] dmlStatements)
at DevExpress.Xpo.DB.DataStoreSerializedBase.ModifyDa ta(ModificationStatement[] dmlStatements)
at DevExpress.Xpo.DB.ConnectionProviderSql.ModifyData (ModificationStatement[] dmlStatements)
at DevExpress.Xpo.SimpleDataLayer.ModifyData(Modifica tionStatement[] dmlStatements)
at DevExpress.Xpo.Helpers.DataLayerWrapperS18452.Modi fyData(ModificationStatement[] dmlStatements)
at DevExpress.Xpo.SimpleObjectLayer.CommitChanges(Ses sion session, ICollection fullListForDelete, ICollection completeListForSave)
at DevExpress.Xpo.Session.FlushChangesInsideTransacti on()
at DevExpress.Xpo.Session.FlushChanges()
at DevExpress.Xpo.Session.ProcessingProcess(ObjectSet markedObjectsHolder, Object theObject)
at DevExpress.Xpo.Session.Save(Object theObject)
at DevExpress.Xpo.XPBaseObject.Save()



از 4 .Net و sqlserver2008 r2 استفاده میکنم.
ممنون میشم اگه کسی کمکم کنه. خیلی حیاتی هستش.
با تشکر

amir.khanlari
یک شنبه 20 فروردین 1391, 17:03 عصر
دستور Insert هم این هستش


declare @p19 int
set @p19=1
exec sp_executesql N'update "dbo"."AFSubscription" set "TheLastWrongNumber"=@p0,"SubscriptionCode"=@p1,"Unsubscrited"=@p2,"Index"=@p3,"ThePersonal"=@p4,"SubscriptionDate"=null,"TheEmbranchmentRequestForm"=@p5,"TheStationBlock"=@p6,"TheWateryFinCode"=null,"TheWateryEmbFinCode"=null,"TheSewageEmbFinCode"=null,"IsConverted"=@p7,"IdentityCode"=@p8,"TheUser"=null,"TheOrganization"=null,"LastDebit"=@p9,"LastDebitDate"=@p10,"LastContorState"=@p11,"SewageSubscrptionCode"=@p8,"TheUsingWaterPrice"=@p12,"OptimisticLockField"=@p13 where (("OID" = @p14) and ("OptimisticLockField" = @p15)) IF @@ROWCOUNT <> 1 begin set @r=0 RETURN end set @r=1',N'@p0 int,@p1 bigint,@p2 bit,@p3 decimal(7,3),@p4 bigint,@p5 bigint,@p6 bigint,@p7 bit,@p8 nvarchar(4000),@p9 bigint,@p10 datetime,@p11 nvarchar(4000),@p12 bigint,@p13 int,@p14 bigint,@p15 int,@r int output',@p0=0,@p1=234441,@p2=0,@p3=8320.040,@p4=11 5345,@p5=10064,@p6=12,@p7=1,@p8=N'',@p9=-222,@p10='2008-08-28 00:00:00',@p11=N'0',@p12=34,@p13=7,@p14=10061,@p15 =6,@r=@p19 output
select @p19

hastiam
یک شنبه 30 مهر 1391, 15:01 عصر
دوستان اگه کسی دلیل ایجاد این خطا رو میدونه لطفا راهنمایی کنید تا این مشکل بزرگ حل بشه :ناراحت: