[Lazarus] What is a TSQLTransaction and why do I need one?

Alexsander Rosa alexsander.rosa at gmail.com
Tue Nov 23 17:08:07 CET 2010

This was the main reason I gave up on sqldb and moved to Zeos.

2010/11/23 Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk>

> Before anything else I'd like to say that I'm entirely familiar with
> transactions in the SQL context. However I've been having a bit of
> difficulty sorting out the relationship between a TPQConnection, multiple
> TSQLQuery, and transaction object(s).
> I'm roughing out a program which I am trying to keep responsive even if
> getting updated data from the backend using SQL is slow. To do that I've got
> two TSQLQuery objects, one of which can be queried by code which updates the
> UI and the other of which will be updated the next time a query is to be run
> (at which point they'll be swapped).
> Since this is strictly read-only, I can't see why I need transactions, but
> I obviously respect the judgment of whoever designed the architecture.
> Am I correct in my understanding that in order to close the transaction I
> have to set Action (e.g. to caRollback) and then Active to False? It appears
> that if I don't do this the query never sees data being updated at the
> backend.
> To support the two TSQLQuery objects, do I need one or two TSQLTransaction
> objects? If I have to have two TSQLTransaction objects, does that imply that
> I also have to have two TPQConnection objects?
> --
> Mark Morgan Lloyd
> markMLl .AT. telemetry.co .DOT. uk
> [Opinions above are the author's, not those of his employers or colleagues]
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Alexsander da Rosa
Linux User #113925

"Extremismo na defesa da liberdade não é defeito.
Moderação na busca por justiça não é virtude."
-- Barry Goldwater
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20101123/a23776b4/attachment-0003.html>

More information about the Lazarus mailing list