Subject | Re: [firebird-support] Delphi and Transactions |
---|---|
Author | Ann W. Harrison |
Post date | 2004-12-02T23:01:51Z |
At 05:21 PM 12/2/2004, Diego Barros wrote:
other than the default transaction. If you issue a SQL statement without
an active transaction the system starts a transaction for you. Unless
you commit, the system will rollback your changes when you disconnect
from the database.
is done in a different transaction - say from a different connection.
Regards,
Ann
>Hi all,You don't need a start transaction unless you want to start something
>
>I have a couple of questions regarding transactions and FB. When I do
>anything in a Delphi/FB application, I always have to have a
>StartTransaction and Commit/Rollback?
other than the default transaction. If you issue a SQL statement without
an active transaction the system starts a transaction for you. Unless
you commit, the system will rollback your changes when you disconnect
from the database.
>Even for a SELECT statement?Yes. Select statements are part of transactions.
> I noticed that when I was inserting a record in the database, it wasThat can happen if you haven't committed your inserts and the select
> being done correctly (I was using transactions), but when I did a select
> it was not being returned.
is done in a different transaction - say from a different connection.
>I've seen some code samples on the newsgroups which didn't have aIn purist circles, it's considered uncouth, but it works.
>StartTransaction call, but just a Commit after executing some SQL or
>stored proc. Is this OK to do?
> Or must I always use the start, commit/rollback combination? Do I needYes and the transaction must be started and ended by the client.
> transactions when using a stored procedure component and calling
> ExecProc() too?
Regards,
Ann