ccgus/fmdb — Issue #42: fmdb -rollback never returns
Author: coderyx
Created: 2012-01-11 13:35:39+00:00
State: open

In the following code fragment,

```obj-c
[mDatabase beginTransaction];
if ([mDatabase executeUpdate:sqlStatement])
{
[mDatabase commit];
}
else
{
NSLog(@"Error in SQL: %@", [mDatabase lastErrorMessage]);
[mDatabase rollback];
}
```
the -rollback never returns.

I wanted to test my error handling, by making the sqlStatement something intentionally faulty, like SELECT humbug();, where humbug() is an undefined function. Tracing the weird behaviour of -rollback above shows that sqlite thinks its DB file is locked and FMDB code loops endlessly in that situation.

Did I do something wrong here?