Re: difference between Query and Transaction

From: Philip Lijnzaad <lijnzaad_at_ebi.ac.uk>
Date: 25 Oct 2000 10:13:10 +0100
Message-ID: <u7n1ftjnbt.fsf_at_o2-3.ebi.ac.uk>


> Hello
> Can anyone tell me or refer me to any sources related to the answer
> to the above question?

The are orthogonal. A transaction is essentially one or more operations (writing _and_ reading) on a database that are treated as one unit. This unit either succeeds completely, or fails completely. It is there to provide the ACID (atomicity, consistency, integrity and durability) properties that are needed in serious work.

Many transactions change the data in the database, but this is not essential: reading one consistent set of data from the database is often also done as a transaction, simply because while you are reading, someone else may be altering the database, giving you a set of values that could be inconsistent.

A query is simply 'getting stuff from the database'. A query is always part of a transaction (one transaction can contain more than one query). To change things in the database, you usually need a query as well, just to select the things that need changing.

                                                                      Philip

-- 
Time passed, which, basically, is its job. -- Terry Pratchett (in: Equal Rites)
-----------------------------------------------------------------------------
Philip Lijnzaad, lijnzaad_at_ebi.ac.uk \ European Bioinformatics Institute,rm A2-24
+44 (0)1223 49 4639                 / Wellcome Trust Genome Campus, Hinxton
+44 (0)1223 49 4468 (fax)           \ Cambridgeshire CB10 1SD,  GREAT BRITAIN
PGP fingerprint: E1 03 BF 80 94 61 B6 FC  50 3D 1F 64 40 75 FB 53
Received on Wed Oct 25 2000 - 11:13:10 CEST

Original text of this message