On Fri, 28 Feb 2003 19:26:55 +0900, Jean-Christian Imbeault
<jc@mega-bucks.co.jp> wrote:
>I have written an application that prints out data from a database. One
>problem I am encountering is in the time it takes to generate the print
>file the data may have changed.
> [...]
>Is locking the rows the best (or simplest) solution?
The simplest (and IMHO best) solution is:
BEGIN;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT <this> ...
SELECT <that> ...
SELECT <whatever> ...
COMMIT;
If your entire report is generated from the result of a single SELECT,
you don't even need that BEGIN/SET TRANSACTION/COMMIT stuff.
Servus
Manfred