Suppose we need to read two tables in an isolated way, so no db change is 
visible to the connection between first and second readout. As far as I see, 
there's no such SQL or API for that at the moment. 

In other words:

1: // with the first step() the read lock is taken:
2: while(stmt1.step()) { read(stmt1); }   
3: // with the last step() the read lock has been released

4: // with the first step() the read lock is taken again, but...
5: // there might have been changes since line 3
6: while(stmt2.step()) { read(stmt2); }   

So if there's some constraints between tables read with these two statements, 
we can get an inconsistent readout.

One obvious workaround would be to keep a dummy table, like Oracle's "dual", 
and take one step() reading it to retrieve read lock, then release read lock by 
resetting this statement. Of course we can "begin immediate", but since no 
writing is going to be done, obtaining reserved lock will be a waste.

My question, is there maybe any direct way to obtain a read lock, which I 
missed from the docs? If not, can this be a minor feature request?

Thanks!
Igor


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to