Judging from the trace-outputs listed above, I would hazard a guess that the target is DB/2.
However, your mention of MySQL and locking brings up once again a point that I found to be hugely important: that you should always use transactions with SQLite, especially when writing, because otherwise SQLite will physically verify every write. There’s no buffering, no “lazy writing,” and this is by design (in the SQLite engine, AFAIK). I haven’t had need to keep up with driver-changes and so on for quite some time, so I don’t know what recently might have changed. I simply, as a blanket rule, use transactions for everything SQLite, including reads.
If the target is DB/2, then I am “entirely convinced” that the actual situation that the OP is facing right now is ... bogosity. The present behavior appears to be nonsensical, and most likely it is, because the root cause will likely to be “this version’s apples trying their best to talk to last version’s oranges, or vice-versa.” There is probably nothing fundamentally wrong with this source-code: the problem is in the particulars of the (not-quite right ...) environment in which the code is trying its best to execute. “Red herrings.” Oooh, I hate it when that happens.