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

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Nov 26 14:49:49 CET 2010

Michael Van Canneyt wrote:

> But by making it as it is, we made sure from the start that we support
> the maximum options. If we had started with the DBExpress approach, the 
> additional options would have been very unnatural and probably rather 
> complicated.

It's curious that Borland didn't similarly attempt to support all 
facilities provided by Firebird/Interbase. They probably forgot about it.

>> I've tried to use sqldb but it adds too much unneeded overhead. Under 
>> PostgreSQL it actually locks the tables for DDL
>> modifications by default, rendering the development machines ridden 
>> with "IDLE in transaction" connections while the apps
>> are running, even for mere SELECT's.

Which locks- Postgres or sqldb?

>> In these machines, it's normal to 
>> add columns and constraints to tables while people
>> are coding and testing. To create a simple FK constraint I would need 
>> to kill all connections or ask to everybody stop
>> working -- otherwise the CREATE CONSTRAINT will wait several 
>> seconds/minutes while the SELECT's are being made. If someone
>> is programming an yearly report that takes one minute to run, 
>> everybody has to wait.
>> That's why I moved to Zeos.
> Well, that's the easy way, which doesn't help us.
> (I understand the move, if you're in need of a quick solution, this is 
> not a reproach.)
> In the long term, however, it is better to try and convince us to make 
> the model more open to other databases.
> We will do so, but bugging us (or providing patches) is the best way of 
> getting faster results.

Allowing that what I'm doing now is the first time that I've played with 
the FPC/Lazarus database stuff "in anger", I'm generally pleased with 
what's available. However I'm fudging around with a thread to get 
updates from the table when notified so as not to risk having an 
unresponsive app if that takes a few seconds, what would be really 
useful from my point of view would be an idle callback from the 
connection or query object.

So far I'm not familiar enough with the system to volunteer to do the work.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the Lazarus mailing list