我用过
CommunitySystem.CurrentContext.DefaultSecurity.RemoveUser(IUser user);
要删除用户。
但是,这很好。但是突然之间出现了错误。而且它永远都在发生。 RemoveUser(IUser user)引发异常。
异常详细信息如下,
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at EPiServer.Community.Forum.Data.ForumFactory.<>c__DisplayClass33_0.<UserRemovedCleanUp>b__0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass32_0.<ExecuteTransaction>b__0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass33_0`1.<ExecuteTransaction>b__0()
at EPiServer.Community.Forum.ForumModule.DefaultSecurity_RemovedUser(ISecurityHandler sender, IRemoveUserEventArgs args)
at EPiServer.Common.Security.RemoveUserEventHandler.Invoke(ISecurityHandler sender, IRemoveUserEventArgs args)
at EPiServer.Common.Security.SecurityHandler.OnRemoveUser(IRemoveUserEventArgs args)
at EPiServer.Common.Security.Data.SecurityFactory.<>c__DisplayClass57_0.<RemoveUser>b__0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass32_0.<ExecuteTransaction>b__0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass33_0`1.<ExecuteTransaction>b__0()
at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
at EPiServer.Common.Security.SecurityHandler.RemoveUser(IUser user)
根据上述错误,似乎是由于数据库问题而发生的。但是什么DB?我该如何诊断?是什么原因造成的?任何帮助表示赞赏。谢谢。
其他信息:
EPiServer.CommonFramework version=9.0.1
EPiServer.CMS.Core version=11.9.2
EPiServer.Community version=9.0.0
更新:我发布了same question on Episerver Forums,但没有得到答案
答案 0 :(得分:0)
将“ episerver.datastore”超时值增加到5分钟是可行的。
<episerver.dataStore>
<dataSettings
connectionStringName="EPiServerDB"
retries="5"
retryDelay="0:0:0.1"
databaseQueryTimeout="0:05:00" />
</episerver.dataStore>
注意: The dataSettings
不在代码中。明确添加。