You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Microsoft.Data.Sqlite and CommandBehavior.SingleResult throws exception #466
I am trying to retrieve a list of entries from a table.
columnMaps=(awaitconnection.QueryAsync<ColumnMap>("SELECT column_id, column_name, ordinal, data_type, variable_type FROM column_map ORDER BY ordinal;").ConfigureAwait(false)).ToList();
This exception is thrown.
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
at Microsoft.Data.Sqlite.SqliteCommand.d__52.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Dapper.SqlMapper.<QueryAsync>d__221.MoveNext() in D:\GitHub\dapper-dot-net\Dapper\SqlMapper.Async.cs:line 210
Removing CommandBehavior.SingleResult worked, though that is obviously not the universal answer.
This is actually a sqlite provider bug; a PR for this has been merged. I
get that it is vexing, though. I'm tempted to try and detect this error,
set a global flag, and retry (not setting this in future). This would mean
that it works with the optimisation when fixed at the provider.
This exception is thrown.
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior
behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior
behavior, CancellationToken cancellationToken)
at Microsoft.Data.Sqlite.SqliteCommand.d__52.MoveNext()
--- End of stack trace from previous location where exception was thrown
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)
at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1.ConfiguredTaskAwaiter.GetResult()
at Dapper.SqlMapper.d__221.MoveNext() in
D:\GitHub\dapper-dot-net\Dapper\SqlMapper.Async.cs:line 210
Removing CommandBehavior.SingleResult worked, though that is obviously
not the universal answer.
—
Reply to this email directly or view it on GitHub #466.
Fair enough! I was wondering if bugs with Dapper were actually bugs with a pre-release version of SQLite. I'll go ahead and close this one and watch for a new SQLite release.
@AdamDotNet I added a workaround for this into the code. Of course, that doesn't help if the parameters refuse to work at all (#467), but ... this bit won't bite after the next build ;)
Activity
mgravell commentedon Feb 22, 2016
This is actually a sqlite provider bug; a PR for this has been merged. I
get that it is vexing, though. I'm tempted to try and detect this error,
set a global flag, and retry (not setting this in future). This would mean
that it works with the optimisation when fixed at the provider.
On Mon, 22 Feb 2016 19:37 AdamDotNet [email protected] wrote:
AdamDotNet commentedon Feb 22, 2016
Fair enough! I was wondering if bugs with Dapper were actually bugs with a pre-release version of SQLite. I'll go ahead and close this one and watch for a new SQLite release.
Add SQLITE to test builds; add tests for issues #466 and #467; fix #466…
mgravell commentedon Feb 22, 2016
@AdamDotNet I added a workaround for this into the code. Of course, that doesn't help if the parameters refuse to work at all (#467), but ... this bit won't bite after the next build ;)
AdamDotNet commentedon Feb 22, 2016
Cool, thanks!
mgravell commentedon Feb 22, 2016
For reference: issue / pull request
mgravell commentedon Apr 1, 2016
deployed 1.50-beta9