{"action":"created","issue":{"url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/issues/57","repository_url":"https://api.github.com/repos/GolosMovement/StatElectGenerator","labels_url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/issues/57/comments","events_url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/issues/57/events","html_url":"https://github.com/GolosMovement/StatElectGenerator/issues/57","id":358324265,"node_id":"MDU6SXNzdWUzNTgzMjQyNjU=","number":57,"title":"Server error при импорте","user":{"login":"BlackWrangler","id":36114863,"node_id":"MDQ6VXNlcjM2MTE0ODYz","avatar_url":"https://avatars2.githubusercontent.com/u/36114863?v=4","gravatar_id":"","url":"https://api.github.com/users/BlackWrangler","html_url":"https://github.com/BlackWrangler","followers_url":"https://api.github.com/users/BlackWrangler/followers","following_url":"https://api.github.com/users/BlackWrangler/following{/other_user}","gists_url":"https://api.github.com/users/BlackWrangler/gists{/gist_id}","starred_url":"https://api.github.com/users/BlackWrangler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlackWrangler/subscriptions","organizations_url":"https://api.github.com/users/BlackWrangler/orgs","repos_url":"https://api.github.com/users/BlackWrangler/repos","events_url":"https://api.github.com/users/BlackWrangler/events{/privacy}","received_events_url":"https://api.github.com/users/BlackWrangler/received_events","type":"User","site_admin":false},"labels":[{"id":1049919533,"node_id":"MDU6TGFiZWwxMDQ5OTE5NTMz","url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/labels/09.09","name":"09.09","color":"000000","default":false},{"id":826071622,"node_id":"MDU6TGFiZWw4MjYwNzE2MjI=","url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":1022728158,"node_id":"MDU6TGFiZWwxMDIyNzI4MTU4","url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/labels/import","name":"import","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":{"login":"ybinzu","id":1109847,"node_id":"MDQ6VXNlcjExMDk4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1109847?v=4","gravatar_id":"","url":"https://api.github.com/users/ybinzu","html_url":"https://github.com/ybinzu","followers_url":"https://api.github.com/users/ybinzu/followers","following_url":"https://api.github.com/users/ybinzu/following{/other_user}","gists_url":"https://api.github.com/users/ybinzu/gists{/gist_id}","starred_url":"https://api.github.com/users/ybinzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybinzu/subscriptions","organizations_url":"https://api.github.com/users/ybinzu/orgs","repos_url":"https://api.github.com/users/ybinzu/repos","events_url":"https://api.github.com/users/ybinzu/events{/privacy}","received_events_url":"https://api.github.com/users/ybinzu/received_events","type":"User","site_admin":false},"assignees":[{"login":"ybinzu","id":1109847,"node_id":"MDQ6VXNlcjExMDk4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1109847?v=4","gravatar_id":"","url":"https://api.github.com/users/ybinzu","html_url":"https://github.com/ybinzu","followers_url":"https://api.github.com/users/ybinzu/followers","following_url":"https://api.github.com/users/ybinzu/following{/other_user}","gists_url":"https://api.github.com/users/ybinzu/gists{/gist_id}","starred_url":"https://api.github.com/users/ybinzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybinzu/subscriptions","organizations_url":"https://api.github.com/users/ybinzu/orgs","repos_url":"https://api.github.com/users/ybinzu/repos","events_url":"https://api.github.com/users/ybinzu/events{/privacy}","received_events_url":"https://api.github.com/users/ybinzu/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/milestones/1","html_url":"https://github.com/GolosMovement/StatElectGenerator/milestone/1","labels_url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/milestones/1/labels","id":3564461,"node_id":"MDk6TWlsZXN0b25lMzU2NDQ2MQ==","number":1,"title":"0.0.1","description":"Новая структура БД, импортер, тестовая страница","creator":{"login":"ybinzu","id":1109847,"node_id":"MDQ6VXNlcjExMDk4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1109847?v=4","gravatar_id":"","url":"https://api.github.com/users/ybinzu","html_url":"https://github.com/ybinzu","followers_url":"https://api.github.com/users/ybinzu/followers","following_url":"https://api.github.com/users/ybinzu/following{/other_user}","gists_url":"https://api.github.com/users/ybinzu/gists{/gist_id}","starred_url":"https://api.github.com/users/ybinzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybinzu/subscriptions","organizations_url":"https://api.github.com/users/ybinzu/orgs","repos_url":"https://api.github.com/users/ybinzu/repos","events_url":"https://api.github.com/users/ybinzu/events{/privacy}","received_events_url":"https://api.github.com/users/ybinzu/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":14,"state":"open","created_at":"2018-08-13T09:06:15Z","updated_at":"2018-09-10T11:31:37Z","due_on":"2018-08-21T07:00:00Z","closed_at":null},"comments":5,"created_at":"2018-09-08T20:07:49Z","updated_at":"2018-09-10T13:48:03Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"При импорте https://drive.google.com/file/d/1SR7p8-W4KrhNkH6EKV4R6CUWEUdwimkI/view?usp=sharing\r\nС маппингом \"Дума 2011 тест неполн. перем.\"\r\nПоявляется сообщение об ошибке \r\n![image](https://user-images.githubusercontent.com/36114863/45258151-9e3f3980-b3bb-11e8-8d69-24a99cb06428.png)\r\nБаза заполняется медленно. В обработанной части проблем не вижу.\r\n"},"comment":{"url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/issues/comments/419918116","html_url":"https://github.com/GolosMovement/StatElectGenerator/issues/57#issuecomment-419918116","issue_url":"https://api.github.com/repos/GolosMovement/StatElectGenerator/issues/57","id":419918116,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTkxODExNg==","user":{"login":"ybinzu","id":1109847,"node_id":"MDQ6VXNlcjExMDk4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/1109847?v=4","gravatar_id":"","url":"https://api.github.com/users/ybinzu","html_url":"https://github.com/ybinzu","followers_url":"https://api.github.com/users/ybinzu/followers","following_url":"https://api.github.com/users/ybinzu/following{/other_user}","gists_url":"https://api.github.com/users/ybinzu/gists{/gist_id}","starred_url":"https://api.github.com/users/ybinzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybinzu/subscriptions","organizations_url":"https://api.github.com/users/ybinzu/orgs","repos_url":"https://api.github.com/users/ybinzu/repos","events_url":"https://api.github.com/users/ybinzu/events{/privacy}","received_events_url":"https://api.github.com/users/ybinzu/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T13:48:03Z","updated_at":"2018-09-10T13:48:03Z","author_association":"COLLABORATOR","body":"При этом, тест с `BulkExtensions` провалился на 500к записях - падает с ошибкой таймаута (`System.Data.SqlClient.SqlException: Timeout expired.`), хотя используется локальная БД (не azure).\r\n\r\nНо при этом, `BulkExtensions` и `SqlConnection ` работают примерно с одинаковой скоростью на 50к записей - 20 секунд. Возможно, даже если решить проблему с timeout у `BulkExtensions` то скорости это не добавит (будут те же 3 минуты с копейками).\r\n\r\n```csharp\r\nvar optionsBuilder = new DbContextOptionsBuilder<ModelContext>();\r\nvar modelContext = new ModelContext(optionsBuilder.UseSqlServer(\r\n    Configuration.GetConnectionString(\r\n        \"ElectionStatisticsDatabase\")).Options);\r\n\r\nvar mappingList = new List<Mapping>();\r\n\r\nfor (int i = 0; i < 500000; i++)\r\n{\r\n    var mapping = new Mapping();\r\n    mapping.Name = string.Format(\"{0}\", i);\r\n    mapping.DataLineNumber = i;\r\n    mappingList.Add(mapping);\r\n}\r\n\r\nmodelContext.BulkInsert(mappingList,\r\n    new BulkConfig { PreserveInsertOrder = true, SetOutputIdentity = true, BatchSize = 4000 });\r\n```\r\n\r\n<details>\r\n<summary>System.Data.SqlClient.SqlException</summary>\r\n\r\n```\r\nApplication startup exception: System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (258): Unknown error: 258\r\n   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)\r\n   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)\r\n   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(DatabaseFacade databaseFacade, RawSqlString sql, IEnumerable`1 parameters)\r\n   at EFCore.BulkExtensions.SqlBulkOperation.Merge[T](DbContext context, IList`1 entities, TableInfo tableInfo, OperationType operationType, Action`1 progress)\r\n   at ElectionStatistics.WebSite.Startup.ConfigureServices(IServiceCollection services) in /dotnet/StatElectGenerator/ElectionStatistics.WebSite/Startup.cs:line 144\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\r\nClientConnectionId:59cd08f9-9da0-4000-8250-570cd98e0795\r\nError Number:-2,State:0,Class:11\r\n\r\nUnhandled Exception: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: Unknown error: 258\r\n   --- End of inner exception stack trace ---\r\n   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)\r\n   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)\r\n   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlCommand(DatabaseFacade databaseFacade, RawSqlString sql, IEnumerable`1 parameters)\r\n   at EFCore.BulkExtensions.SqlBulkOperation.Merge[T](DbContext context, IList`1 entities, TableInfo tableInfo, OperationType operationType, Action`1 progress)\r\n   at ElectionStatistics.WebSite.Startup.ConfigureServices(IServiceCollection services) in /dotnet/StatElectGenerator/ElectionStatistics.WebSite/Startup.cs:line 144\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\r\n   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()\r\n   at ElectionStatistics.WebSite.Program.BuildWebHost(String[] args) in /dotnet/StatElectGenerator/ElectionStatistics.WebSite/Program.cs:line 21\r\n   at ElectionStatistics.WebSite.Program.Main(String[] args) in /dotnet/StatElectGenerator/ElectionStatistics.WebSite/Program.cs:line 17\r\ncrit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]\r\n      Application startup exception\r\nSystem.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (258): Unknown error: 258\r\n   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)\r\n   at System.Data.SqlClient.SqlCommand.InternalExecuteNon\r\n```\r\n</details>"}}
{"actor":{"display_login":"ybinzu"}}