in

System.Data.SQLite

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

Setting SQLiteCommand.Connection

Last post 08-21-2009 3:11 PM by SqlRanger. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-20-2009 1:11 AM

    • yngve
    • Not Ranked
    • Joined on 08-20-2009
    • Posts 1

    Setting SQLiteCommand.Connection

    Hi, Is there any associated problems by reusing SQLiteCommand objects by setting its Connection property? I imagine something like the following:

    // In the main thread:
    SQLiteConnection connA = ...
    SQLiteCommand cmdA = connA.CreateCommand(...);
    
    // In some other thread:
    SQLiteConnection connB = connA.Clone();
    SQLiteCommand cmdB = cmdA.Clone();
    cmdB.Connection = connB;
    
    Thanks in advance. - Yngve
  • 08-21-2009 3:11 PM In reply to

    Re: Setting SQLiteCommand.Connection

    SQLiteCommands are not thread safe, but I don't see any problem with your code as long as you use command clones.

    Regards

    Jesús López

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