Database file is inexplicably locked during SQLite commit

后端 未结 9 742
深忆病人
深忆病人 2020-12-31 12:17

I\'m performing a large number of INSERTS to a SQLite database. I\'m using just one thread. I batch the writes to improve performance and have a bit of security in case of

9条回答
  •  無奈伤痛
    2020-12-31 13:11

    Is your database file on the same machine as the app or is it stored on a server?

    You should create a new connection in every thread. I would simplefy the creation of a connection, use everywhere: connection = new SQLiteConnection(connString.ToString());

    and use a database file on the same machine as the app and test again.

    Why the two different ways of creating a connection?

提交回复
热议问题