Hello, I found the problem. The
"[Transactional(TransactionalTypes.TransactionScope)]" decoation was keeping a
lock on the database. So that prompts another question.. What is the best way
to implement Transactions?
thanks,
Jason
From: Jason Gray <jason.g...@rocketmail.com>
To: "sqlite-users@sqlite.org" <sqlite-users@sqlite.org>
Sent: Monday, June 27, 2011 7:28:52 AM
Subject: [sqlite] Basebase Locked Error
Hello, I hope you can help me with a problem I'm having. I'm using CLSA
business objects and SQLite as the datastore. Essentially this is what I'm
trying to do, shouldn't this work?
[Transactional(TransactionalTypes.TransactionScope)]
protected override void DataPortal_Insert()
{
using (SQLiteConnection conn = new SQLiteConnection(DataBase.Conn()))
{
conn.Open();
using (SQLiteCommand cmd = new SQLiteCommand(conn))
{
//do stuff
cmd.ExecuteNonQuery();
}
}
using (SQLiteConnection conn2 = new SQLiteConnection(DataBase.Conn()))
{
conn2.Open();
}
}
I get the "Database is locked" error on conn2.Open(). Even if I call .Close()
and .Dispose() is still get the same error.
What am i doing wrong?
thanks,
Jason
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users