草庐IT

transaction_safe

全部标签

c# - ado.net transaction.commit 抛出信号量异常

当我提交交易时,我得到:System.Threading.SemaphoreFullException:Addingthespecifiedcounttothesemaphorewouldcauseittoexceeditsmaximumcount.atSystem.Threading.Semaphore.Release(Int32releaseCount)atSystem.Data.ProviderBase.DbConnectionPool.PutNewObject(DbConnectionInternalobj)atSystem.Data.ProviderBase.DbConnec

c# - EntityFramework 测试初始化​​错误 : CREATE DATABASE statement not allowed within multi-statement transaction

我正在尝试构建一个快速测试,每次运行时都会删除并重新创建数据库。我有以下内容:[TestClass]publicclassPocoTest{privateTransactionScope_transactionScope;privateProjectDataSource_dataSource;privateRepository_repository=newRepository();privateconststring_cstring="DataSource=.;InitialCatalog=test_db;Trusted_Connection=True";[TestInitialize

c# - Entity Framework new transaction is not allowed because there are other threads running in the session,多线程保存

我正在尝试将多线程进程的日志保存在数据库中,但出现以下错误:不允许新事务,因为session中还有其他线程在运行。在每个胎面我都有这个功能:internalboolWriteTrace(IResultresult,stringmessage,bytetype){SPC_SENDING_TRACEtrace=newSPC_SENDING_TRACE(message,Parent.currentLine.CD_LINE,type,Parent.currentUser.FULLNAME,Parent.guid);Context.SPC_SENDING_TRACE.AddObject(trac

c# - Visual Studio 2012 - 在 .NET 4.5 框架中找不到 System.Transactions 程序集

我试图在C#VisualStudio2012项目中添加对System.Transactions的引用,但System.Transactions在框架程序集中不可用,您可以在下面的屏幕截图中看到:有谁知道为什么System.Transactions对我不可用?我怎样才能让它重新出现?编辑:修复了屏幕截图,谢谢Marc! 最佳答案 为此发布了一个MicrosoftConnect条目,其中有一条评论建议您可以浏览它。给出的路径是:C:\ProgramFiles(x86)\ReferenceAssemblies\Microsoft\Fram

c# - NHibernate 异常 : Transaction not connected, 或已断开连接

在我们的开发环境中,所有ASP.NET应用程序都运行良好。但是,当我在测试机器上部署站点时,在某些页面上出现此异常:NHibernate.TransactionException:Transactionnotconnected,orwasdisconnectedatNHibernate.Transaction.AdoTransaction.CheckNotZombied()ind:\CSharp\NH\NH\nhibernate\src\NHibernate\Transaction\AdoTransaction.cs:line406atNHibernate.Transaction.Ad

C# - System.Transactions.TransactionScope

我对TransactionScope类很好奇。在大多数情况下,我假设它是用于数据库连接(这就是我用它的目的)。我的问题是,您能否将任何代码放入TransactionScope的usingblock中以使其具有事务性?MS文档对此并不清楚。如果它可以用于使除数据库连接之外的代码成为事务性的,那么支持哪些代码?如果它可以使System.IO.File操作具有事务性,这对我来说似乎很疯狂。 最佳答案 TransactionScope不仅适用于数据库。每个实现IEnlistmentNotification接口(interface)的组件都可

c# - 诊断 ObjectDisposedException "Safe handle has been closed"

我有一个C#应用程序,它正在使用消息命中ObjectDisposedExceptionSafehandlehasbeenclosed我一启动应用程序就会发生这种情况。遗憾的是,堆栈跟踪确实没有帮助(见下文)。我有什么办法可以确定这里正在异步尝试调用什么?DoAsyncCall()真的意味着异步方法调用吗?mscorlib.dll!System.Threading.EventWaitHandle.Set()+0xebytesmscorlib.dll!System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(Syste

c# - SQL 服务器,C# : Timeout exception on Transaction Rollback

我遇到了一个奇怪的问题。我有一个.NET程序,我的流程逻辑需要在SQLServer2005数据库上进行长时间运行的事务(~20分钟)。没关系,因为没有人并行访问数据库。当出现问题时,应该回滚事务。在我的DbTransaction对象上的Rollback()操作很少且没有任何可见模式抛出SqlException:Message:"Timeoutexpired.Thetimeoutperiodelapsedpriortocompletionoftheoperationortheserverisnotresponding."StackTrace:atSystem.Data.SqlClient

c# - 嵌入式 RavenDB 出现 "Could not find transactional storage type"错误

我能够根据在以下位置找到的代码成功运行RavenDB的简单测试:http://ravendb.net/tutorials/hello-world接下来我尝试以嵌入式方式运行它,但我不断收到以下错误:Message:Couldnotfindtransactionalstoragetype:Raven.Storage.Esent.TransactionalStorage,Raven.Storage.EsentStackTrace:atRaven.Database.Config.InMemoryRavenConfiguration.CreateTransactionalStorage(Act

#ubuntu# #git# repository git config --global --add safe.directory

ubuntu克隆下源码对其操作时git时偶发性报错 fatal:detecteddubiousownershipinrepository并提示可以:gitconfig--global--addsafe.directory/目录我们按提示执行确实可以短暂避免该问题,但治标不治本,且文件很多时需要一个个敲命令。产生这一问题的本质原因是下载代码的所有权没有转移,即你下载了别人的代码(一般使用docker下载后,本地编译容易出现),别人声明该代码所有权。所以,在修改代码时会报以上问题。因此,我们需要做的并不是声称哪目录是安全的,而是要将代码所有权转移。  使用以下命令将代码所有权转移gitconfig