Subject Re: [firebird-support] Very fast read only transactions
Author Ivan Prenosil
> In a nutshell, can I go ahead and do what I am doing, that is to create a single database, a single transaction, and a single
> statement and reuse them indefinately? Like I said, I did not experience any adverse effects in my test.

If the transaction is both ReadOnly _and_ ReadCommitted, it is safe to hold it active indefinitely.


> Since I don't know a whole lot about SQL and FB, I would sincerely appreciate someone telling me if the firebird steps above (the
> pseudo-code for those not familiar with C++) are valid and will not cause unforeseen problems.

Small mistake in pseudo-code (not in code):

> Then in a continous loop of 1 million:
> - sets the 'PRIMARYKEY=?' to the next record to select
> - prepares the sql statement <<<< do not do this in loop
> - executes the sql statement
> - fetches the data and assigns it to application variables

Ivan