#3 Connection cannot be re-used

closed
None
5
2004-07-01
2004-06-24
Marc Clifton
No

Frankly, I don't know if this is a SQLite problem or with
the ADO.NET drivers, but I can't re-use a connection--
open it, close it, open it again later, etc...

If I try my code with SQLServer, it works great. If I
instantiate a new connection with SQLite before doing
an Open, it works great too. Just can't re-use the same
connection!

Marc

Discussion

    • assigned_to: nobody --> alexhau
     
  • Logged In: YES
    user_id=1000441

    It would be great to have ab exceprt of the code which
    doesn't work. The simple Open/Close/Open/Close sequence
    works for me.

     
  • Marc Clifton
    Marc Clifton
    2004-06-29

    Logged In: YES
    user_id=675392

    The problem is in SQLiteConnection::Close().

    After the loop that does the UnCompile of the commands, the
    commands are cleared. When the connection is re-opened,
    the command list maintained by the connection is empty.
    Removing:

    mpCmds->Clear();

    solved the problem.

     
    • status: open --> closed