nhibernate-core icon indicating copy to clipboard operation
nhibernate-core copied to clipboard

No way to set Command Timeout for SchemaUpdate

Open gsivorot opened this issue 3 years ago • 1 comments

SchemaUpdate uses the connection directly to create a Command bypassing any opportunity to set the CommandTimeout (or any other settings). Any command taking longer than the default value (30 seconds for SqlCommand) will timeout.

connectionHelper.Prepare();
connection = connectionHelper.Connection;
meta = new DatabaseMetadata(connection, dialect);
stmt = connection.CreateCommand();

gsivorot avatar Apr 28 '22 21:04 gsivorot

@gsivorot If you use a recent version of Microsoft.Data.SqlClient you can set the default command timeout in the connection string

ErikEJ avatar Aug 18 '22 13:08 ErikEJ