![]() ![]() Yes and by default cmd.CommandTimeout will be 30 but by default cmd.Connection. So we'd use ''only'' if it hasn't been set previously via OneTimeCommandTimeout or CommandTimeout? Makes sense. If (OneTimeCommandTimeout = 0 & CommandTimeout = 0 & > 30) That looks good but I think it would be like this? If (cmd.CommandTimeout = 0 & > 30)Ĭmd.CommandTimeout = Public override void OnExecutingCommand(IDbCommand cmd) In UmbracoDatabase's override of OnConnectionOpened? If (CommandTimeout = 0) CommandTimeout = connection.ConnectionTimeout Public UmbracoDatabase(string connectionStringName, ILogger logger) Public UmbracoDatabase(string connectionString, DbProviderFactory provider, ILogger logger) Public UmbracoDatabase(string connectionString, string providerName, ILogger logger) Public UmbracoDatabase(IDbConnection connection, ILogger logger) Yes, you can use the UmbracoDatabase constructor but will need to get the value from somewhere or parse it out of the connection string if using the Connection Timeout value. I don't mind how we achieve this, if it can be as simple as a ctor argument, sounds good to me though some devs have picked up PetaPoco again so we'll see how they go (my guess is not very far). Yes there are already changes but we'll keep those to a minimum. Let's try not to hack the petapoco core more than we need to. Since my example code overrides the SaveChanges () for the read only -context, you can actually simulate the different connection strings even when developing locally (without going through the hassle of generating a kind-of-a-read-only connection string for your local MS SQL Express database). I ''think'' just setting CommandTimeout in UmbracoDatabase constructor would achieve the same result but may be wrong? Modern computers can churn data at an alarming rate, and high speed networking (often with multiple parallel links between important servers) provides enormous bandwidth, but that damned latency means that computers spend an awful lot of time waiting for data and that is one of the several reasons that continuation-based programming is becoming. PetaPoco.Database code is already drastically different to the original with fixed bits copied from NPoco and other custom code but with the switch to NPoco for v8 maybe worth thinking about what happens with that or cross that bridge later.?Īs you say most changes come from NPoco and I'd rather not add things that are not in NPoco (though we might have done it already.). Wondering if, in order to keep PetaPoco.Database code untouched (to facilitate upgrades) we should instead set CommandTimeout in UmbracoDatabase constructor? Server=tcp:,1433 Database=MyThing User Timeout=300 _lastArgs = (from IDataParameter parameter in cmd.Parameters select parameter.Value).ToArray() Database(, DatabaseType.![]() No OneTimeCommandTimeout or CommandTimeout so lets use the ConnectionTimeout value from web.config if there is one and it's greater than the default 30Įlse if ( > 30) We have an issue where we have multiple Mappings/Types to include, and they werent getting bound. This is what I have tested successfully adding the second "else if": There is a SQL Connection timeout in the connection string, "Connection Timeout" but this isn't the same as Command timeout however I think it would work pretty well as a way of allowing Command timeout to be configured without having to add a new AppSetting. Therefore it should be possible to configure the command timeout in PetaPoco. Gcl = db.Fetch (string.Some queries can take more than the default 30 second command timeout to execute especially when running on Azure with S0 type databases. Using (var db = new NPoco.Database(DatabaseConnection.Connection, )) want to change this to some minimum value of the TIMESTAMP data type. NOTE: This hard-coding a minimum date value is a temporary fix. Using (var db = new NPoco.Database(conn)) Using (var conn = new NpgsqlConnection(nnectionString)) I have an Asp.Net Core app with Entity Framework Core that I initialize as follows: services. Minval = minval = null ? new DateTime(year: 2000, month: 0, day: 0) : minval Public IEnumerable GetPage(int page, int pageSize, DateTime minval) Below is the syntax of the connection strings is as follows. Change the value of page and pageSize to alter the amount of ![]() / Retrieve a lsit of Company one page at a time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |