PRAGMA in Connection String

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
jgreen
Posts: 6
Joined: Mon 09 Jan 2012 11:39

PRAGMA in Connection String

Post by jgreen » Thu 08 Mar 2012 20:22

Hi,

I've tried passing "PRAGMA locking_mode = EXCLUSIVE;" in my connection string but Devart doesn't like this ...

Is this expected behaviour?? If so, why deviate from the norm?

Or is there a better way to assert only one session on the database?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Post by Pinturiccio » Mon 19 Mar 2012 11:31

dotConnect for SQLite do not support PRAGMA connection string parameters. Try using the following:

Code: Select all

SQLiteConnection conn = new SQLiteConnection(@"***");
SQLiteConnectionStringBuilder sb = new SQLiteConnectionStringBuilder();
sb.Locking = LockingMode.Exclusive;
conn.ConnectionString += sb.ConnectionString;
When you use sb.Locking = LockingMode.Exclusive; then 'PRAGMA locking_mode = EXCLUSIVE' will be executed in our inner code.

Post Reply