Subject | Re: [firebird-support] Understanding Sweep |
---|---|
Author | Helen Borrie |
Post date | 2007-10-24T12:29:40Z |
At 09:41 PM 24/10/2007, you wrote:
I would want to take total charge of it and call StartTransaction each time I want to open a provider...
./heLen
>Helen,Yes.
>
>I'm familiar with TSQLConnection and its methods to handle
>transactions, but I don't see how should you it when populating a
>ClientDataset. To populate a ClientDataset I just "open" it. Then
>Delphi (dbexpress or whatever) opens the database connection (if it's
>not already open) fetches the data and populate my ClientDataset. Are
>you telling me that I should hook some code in the middle of this
>process to proper handle transactions?
>Maybe if I set KeepConnection to False in TSQLConnection and let itThat won't work. If you don't close the provider datasets and commit the transaction, you would be "out of the frying pan into the fire".
>drop the connection when there is no datasets active, could help?
>IDon't confuse a connection with a transaction. They are not the same thing. Transactions run within the context of a connection. The TSQLConnection happens to embed a single transaction - one and only one. This means that you can't run multiple concurrent transactions within a single connection context - a limitation of DBX, not of Firebird. But it doesn't mean you can just ignore that transaction. Make sure you commit it when you have got what you want from it. The same (embedded) transaction object will then be ended (and become uninteresting, as long as you do NOT allow CommitRetaining to be called) and will be available to wrap the next transaction you need.
>just worry about the speed penalty for connecting and disconnecting
>all the time.
I would want to take total charge of it and call StartTransaction each time I want to open a provider...
./heLen