Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
dotstatsuite-core-transfer
dotstatsuite-core-transfer
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 58
    • Issues 58
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 3
    • Merge requests 3
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • SIS-CC
  • Stat Suite
  • dotstatsuite-core-transferdotstatsuite-core-transfer
  • Issues
  • #40

Closed
Open
Created Oct 10, 2019 by Jens Dossé@dosse💬Owner

SqlBulkCopy error

The following SqlBulkCopy error was reported in the dotstatsuite-core-transfer-user.log:

2019-10-10 10:57:06,395|[7]|codebase-install-test|33|ERROR|DOTSTATCOR-DEV1|dotstatsuite-core-transfer|DotStatServices.Transfer.Controllers.ImportController+<>c__DisplayClass10_0`1+<<Import>b__0>d.MoveNext|Column 'DIM_52' does not allow DBNull.Value.|System.InvalidOperationException: Column 'DIM_52' does not allow DBNull.Value.
   at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata, Boolean isNull, Boolean& isSqlType, Boolean& coercedToDataFeed)
   at System.Data.SqlClient.SqlBulkCopy.ReadWriteColumnValueAsync(Int32 col)
   at System.Data.SqlClient.SqlBulkCopy.CopyColumnsAsync(Int32 col, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyRowsAsync(Int32 rowsSoFar, Int32 totalRows, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken)
   at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServer(IDataReader reader)
   at DotStat.Db.Repository.SqlServer.SqlDataStoreRepository.BulkInsertData(IEnumerable`1 observations, CodeTranslator translator, Dataflow dataflow, Int32 maxErrorCount)
   at DotStat.Transfer.Consumer.SqlConsumer.Save(TransferParam transferParam, Dataflow dataflow, TransferContent transferContent, Int32 maxErrorCount) in C:\GitLab\dotstatsuite-core-transfer\DotStat.Transfer\Consumer\SqlConsumer.cs:line 158
   at DotStat.Transfer.Manager.SdmxFileToSqlTransferManager.Transfer(SdmxFileToSqlTransferParam transferParam) in C:\GitLab\dotstatsuite-core-transfer\DotStat.Transfer\Manager\SdmxFileToSqlTransferManager.cs:line 21
   at DotStatServices.Transfer.Controllers.ImportController.<>c__DisplayClass10_0`1.<<Import>b__0>d.MoveNext() in C:\GitLab\dotstatsuite-core-transfer\DotStatServices.Transfer\Controllers\ImportController.cs:line 206
|(null)|(null)|(null)|(null)

Such an error should not happen, because all data input is validated before loading it into SQL, right?

Improve observations validation process; the data reader should take an optimistic approach, after the first validation error, the validator will iterate through the rest of the observations to detect more errors until it reaches the end of the file or the maximum number allowed errors, before the transaction is cancel.

Edited Oct 17, 2019 by Pedro Carranza
Assignee
Assign to
Release .Stat Suite .NET v2.0.0
Milestone
Release .Stat Suite .NET v2.0.0
Assign milestone
Time tracking
None
Due date
None