This was exactly the problem; I didn't realize the 'static' variables are
persisted between page views in ASP.Net

Adding an '_instance = null;' fixed the issue.

Thanks muchly.

Cheers,
Doug.

On Tue, Jul 19, 2011 at 11:58 AM, Joe Mistachkin <sql...@mistachkin.com>wrote:

>
> After reading the code, I noticed the following:
>
> 1. From the static Dump method, an instance of the DbLogger class is
> created via the static Get method and stored in the _instance static
> variable.
>
> 2. The connection itself is opened in the constructor for the DbLogger
> class via the InitDb method.
>
> 3. Prior to returning a result, the Dump method closes the connection
> and sets the _connection instance variable to null.
>
> 4. The second time the Dump method is executed, the existing instance
> of the DbLogger class will be used (i.e. the one stored in the static
> _instance variable).
>
> 5. This existing instance of the DbLogger class no longer has a valid
> connection because it was previously closed (and set to null).
>
> 6. Newly created commands will not have a valid connection.
>
> 7. Attempting to execute a command without a valid connection will
> result in the exception you are seeing.
>
> --
> Joe Mistachkin
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to