After changing a model and performing shema upgrade we got TimeOutException exception, trying to set operation timeout like this, but it doesn't work:

sessionConfig = new SessionConfiguration {
  DefaultIsolationLevel = IsolationLevel.Snapshot,
  Options = SessionOptions.ServerProfile | SessionOptions.AutoActivation,
  DefaultCommandTimeout = 10 * 60 // ten minutes
};

config.Types.Register(typeof(DataDomain).Assembly, typeof(DataDomain).Namespace);
config.Sessions.Add(sessionConfig);
Domain = Domain.Build(config);

Exception details:

31 20:02:55 - Начало построения домена данных приложения...
31 20:03:30 - Xtensive.Orm.OperationTimeoutException: SQL error occured.
SQL error details 'Type: OperationTimeout;'
Query 'CREATE INDEX [Order.IX_CreateDateTimePhoneToCall] ON [dbo].[Order] ([CreateDateTime] ASC, [PhoneToCall] ASC);'
Original message 'Истекло время ожидания (Timeout). Время ожидания истекло до завершения операции или сервер не отвечает.' ---> System.Data.SqlClient.SqlException: Истекло время ожидания (Timeout). Время ожидания истекло до завершения операции или сервер не отвечает.
в System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
в System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
в System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
в System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
в System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
в System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
в Xtensive.Storage.Providers.Sql.Driver.ExecuteNonQuery(Session session, DbCommand command)
--- Конец трассировки внутреннего стека исключений ---
в Xtensive.Storage.Providers.Sql.Driver.ExecuteNonQuery(Session session, DbCommand command)
в Xtensive.Storage.Providers.Sql.SchemaUpgradeHandler.Execute(IEnumerable`1 batch)
в Xtensive.Storage.Providers.Sql.SchemaUpgradeHandler.UpgradeSchema(ActionSequence upgradeActions, StorageInfo sourceSchema, StorageInfo targetSchema)
в Xtensive.Orm.Building.Builders.DomainBuilder.SynchronizeSchema(SchemaUpgradeMode schemaUpgradeMode)
в Xtensive.Orm.Building.Builders.DomainBuilder.BuildDomain(DomainConfiguration configuration, DomainBuilderConfiguration builderConfiguration)
в Xtensive.Orm.Upgrade.UpgradingDomainBuilder.BuildStageDomain(UpgradeStage stage)
в Xtensive.Orm.Upgrade.UpgradingDomainBuilder.Build(DomainConfiguration configuration)

How to increase Timeout time?

asked Jan 31 '12 at 04:09

Dmitry%20F's gravatar image

Dmitry F
11669

edited Jan 31 '12 at 04:14

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211


One Answer:

Use config.Sessions.System = ... instead of Add. Btw, it's also better to use config.Sessions.Default = instead of Add, if you're willing to change default session options; it's better to use Add for custom session configs only.

See SessionConfigurationCollection for other options.

answered Jan 31 '12 at 04:31

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

Forgot to add: System session configuration is used for all operations performed on upgrade.

(Jan 31 '12 at 04:32) Alex Yakunin Alex%20Yakunin's gravatar image

Btw, here is an example of correct default session configuration: http://support.x-tensive.com/question/4925/dirty-read-question

You need to do a similar trick for system session as well.

(Jan 31 '12 at 04:36) Alex Yakunin Alex%20Yakunin's gravatar image

Thank you, that solution works.

(Feb 01 '12 at 04:07) Dmitry F Dmitry%20F's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA