我有一个在线游戏的服务器项目,经常遇到数据库致命错误。当程序必须从数据库加载数据时会发生这种情况,但并非总是如此。我认为,很确信该错误是由于内存不足引起的。我可以增加计算机的内存总量,但是数据库是否动态使用它需要的内存,或者可能受到某些限制?我对此了解不多,非常感谢您的帮助。谢谢! 我将以下错误留作参考。
System.Data.Entity.Core.EntityException: An exception has been raised that is likely due to a transient failure. If you are connecting to a SQL Azure database consider using SqlAzureExecutionStrategy. ---> System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.Entity.Core.EntityException: An exception has been raised that is likely due to a transient failure. If you are connecting to a SQL Azure database consider using SqlAzureExecutionStrategy. ---> System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) ---> System.ComponentModel.Win32Exception: No process is on the other end of the pipe
--- End of inner exception stack trace ---
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.<Execute>b__0()
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
--- End of inner exception stack trace ---
...
at Def.DAL.DAO.SInstanceDAO.LoadByStoneId(Int16 stoneId) in C:\Users\Administrator\Desktop\Definitiva\Def.DAL.DAO\SInstanceDAO.cs:line 98
at Def.GameObject.SpecialItem.Use(ClientSession session, ItemInstance& inv, Byte Option, String[] packetSplit) in C:\Users\Administrator\Desktop\Definitiva\Def.GameObject\Item\SpecialItem.cs:line 1371
at Def.Handler.BasicPacketHandler.Guri(GuriPacket guriPacket) in C:\Users\Administrator\Desktop\Definitiva\Def.Handler\BasicPacketHandler.cs:line 1084
at Def.GameObject.ClientSession.TriggerHandler(String packetHeader, String packet, Boolean force, Boolean ignoreAuthority) in C:\Users\Administrator\Desktop\Definitiva\Def.GameObject\Networking\ClientSession.cs:line 604
at OpenNos.GameObject.ClientSession.HandlePackets() in C:\Users\Administrator\Desktop\Definitiva\Def.GameObject\Networking\ClientSession.cs:line 490
at System.Reactive.AnonymousSafeObserver`1.OnNext(T value)
...
(跟踪不完整)