[Haskell] HDBC Transactions with Sqlite3
Tom Hawkins
tomahawkins at gmail.com
Sat Jan 14 10:12:07 EST 2006
I have HDBC running with Sqlite3, but I'm getting a SqlError due to a
locked table. Please excuse my SQL ignorance, but what may be causing
the problem? In SQL, are we not allowed to select, update, and delete
from a table within a single transaction? If not, what are the rules
for transactions?
Thanks for any help!
-Tom
SELECT * FROM freeKey;
SELECT * FROM nextKey;
INSERT INTO nextKey VALUES (1);
SELECT * FROM freeKey;
SELECT * FROM nextKey;
UPDATE nextKey SET key = 2 WHERE key = 1;
SELECT * FROM freeKey;
SELECT * FROM nextKey;
UPDATE nextKey SET key = 3 WHERE key = 2;
INSERT INTO freeKey VALUES (0);
INSERT INTO freeKey VALUES (1);
SELECT * FROM freeKey;
DELETE FROM freeKey WHERE key = 0;
SqlError {seState = "", seNativeError = 1, seErrorMsg = "step:
database table is locked"}
More information about the Haskell
mailing list