Page 1 of 1

PRAGMA in Connection String

Posted: Thu 08 Mar 2012 20:22
by jgreen
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?

Posted: Mon 19 Mar 2012 11:31
by Pinturiccio
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.