in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Using Sqlite in UnitTest

Last post 11-05-2007 6:06 AM by llf. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 11-02-2007 7:32 PM

    • llf
    • Top 500 Contributor
    • Joined on 08-26-2007
    • Posts 5

    Using Sqlite in UnitTest

    I ofter use sqlite for unit test. The way I use it is copy the db file to c:\ when "SetUp", delete it when "TearDown".

    It works fine until version 1.0.44.0.

    When I use 1.0.45.0 or 1.0.46.0 it failed with an exception said the file can not be deleted or created because others hold it.

    Any idea about that?

    Thanks.

    Filed under:
  • 11-02-2007 7:35 PM In reply to

    • llf
    • Top 500 Contributor
    • Joined on 08-26-2007
    • Posts 5

    Re: Using Sqlite in UnitTest

    I was thinking that may cause by new configurtion of "Pooling", but whatever I set it as "true" or "false", it all failed.

    Thanks.

  • 11-02-2007 7:54 PM In reply to

    • Nate
    • Top 10 Contributor
    • Joined on 08-28-2005
    • Fort Collins, CO
    • Posts 68

    Re: Using Sqlite in UnitTest

    For what it is worth I have the same issue with 1.0.46. After closing and even explicitly disposing of a sqliteconnection I cannot copy a database from the desktop to my pocketpc because it is in use still.

  • 11-03-2007 11:28 PM In reply to

    Re: Using Sqlite in UnitTest

    You've probably got an un-Dispose()'d command or datareader or transaction on the connection.  I plan on implementing some sort of fix for this in the next release ... ideally it is best to always make sure you dispose of all the objects when you're done with them.

    Robert

     

  • 11-04-2007 2:45 AM In reply to

    • llf
    • Top 500 Contributor
    • Joined on 08-26-2007
    • Posts 5

    Re: Using Sqlite in UnitTest

    Yes, I only close/dispose the connection but not dispose the command.

    I'll try it by dispose command.

    Thanks.

  • 11-05-2007 6:06 AM In reply to

    • llf
    • Top 500 Contributor
    • Joined on 08-26-2007
    • Posts 5

    Re: Using Sqlite in UnitTest

    It works. Thanks.

Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems