System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
2014-11-07
23:51 Closed ticket [daeaf3150a]: SQLiteCommand.Execute SQLiteExecuteType.Reader support plus 4 other changes artifact: 98ef69fbee user: mistachkin
23:48
Defer disposing of the connection created by the static SQLiteCommand.Execute method when a data reader is returned. Fix for [daeaf3150a]. check-in: ad79758d0c user: mistachkin tags: trunk
22:37 Ticket [daeaf3150a] SQLiteCommand.Execute SQLiteExecuteType.Reader support status still Open with 6 other changes artifact: 17a1ed23ec user: mistachkin
2014-11-05
19:58 New ticket [daeaf3150a]. artifact: 7ab32977ad user: anonymous

Ticket Hash: daeaf3150ae6023320f31b628fe792234dc52342
Title: SQLiteCommand.Execute SQLiteExecuteType.Reader support
Status: Closed Type: Code_Defect
Severity: Important Priority: Blocker
Subsystem: Command Resolution: Fixed
Last Modified: 2014-11-07 23:51:02
Version Found In: 1.0.94.0
User Comments:
anonymous added on 2014-11-05 19:58:03:
I tried (at the F# repl) using the static SQLiteCommand.Execute method to execute a query (specifying  SQLiteExecuteType.Reader). The method did indeed return a reader (Execute did not raise an exception), but the reader was effectively useless because (I believe) the connection that created it was already disposed. E.g.:

> reader.HasRows;;
System.ObjectDisposedException: Cannot access a disposed object.

Looking at the code in SQLiteCommand, I see that ExecuteReader is called in a using block which will dispose the connection.

Suggestion: when the executeType is Reader, do not dispose the connection after a successful ExecuteReader; instead, include CommandBehavior.CloseConnection in the commandBehavior flags so that closing the returned reader closes the connection as well.

mistachkin added on 2014-11-07 23:51:02:
Fixed on trunk via check-in [ad79758d0c].