| View previous topic :: View next topic |
| Author |
Message |
srdaniel Guest
|
Posted: Tue Jan 27, 2004 11:18 pm Post subject: Implicit Transactions |
|
|
When do implicit transactions happen? Does it matter if I'm using a
TSQLDataSet or TClientDataSet? Does it matter if I am doing a SELECT
v.s. UPDATE, DELETE, INSERT queries?
srdaniel
|
|
| Back to top |
|
 |
Bill Todd (TeamB) Guest
|
Posted: Tue Jan 27, 2004 11:44 pm Post subject: Re: Implicit Transactions |
|
|
All of those things matter but the thing that matters most is what
database you are using and we don't know that.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
| Back to top |
|
 |
srdaniel Guest
|
Posted: Tue Jan 27, 2004 11:48 pm Post subject: Re: Implicit Transactions |
|
|
Bill Todd (TeamB) wrote:
| Quote: | All of those things matter but the thing that matters most is what
database you are using and we don't know that.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
Sorry, I should have known better.....Interbase it is.
|
|
| Back to top |
|
 |
Bill Todd (TeamB) Guest
|
Posted: Wed Jan 28, 2004 3:39 am Post subject: Re: Implicit Transactions |
|
|
It is impossible to access data in an InterBase database in any way
outside the context of a transaction. So, if you are viewing,
inserting, updating or deleting data you have an active transaction.
If you did not start it then it is an implicit transaction. The IBX
components will start transactions for you but you have to end the
transaction by calling commit or rollback. Personally, I think it is
better to start each transaction explicitly so it is clear when they
start and when they end.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
| Back to top |
|
 |
srdaniel Guest
|
Posted: Wed Jan 28, 2004 4:39 pm Post subject: Re: Implicit Transactions |
|
|
Bill Todd (TeamB) wrote:
| Quote: | It is impossible to access data in an InterBase database in any way
outside the context of a transaction. So, if you are viewing,
inserting, updating or deleting data you have an active transaction.
If you did not start it then it is an implicit transaction. The IBX
components will start transactions for you but you have to end the
transaction by calling commit or rollback. Personally, I think it is
better to start each transaction explicitly so it is clear when they
start and when they end.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
Ok, couple more questions then...
1) Does IBX stand for dbExpress?
2) So with I try the following, I am leaving a transaction uncommited
because it was started automatically and I didn't commit it?
aSQLConnection: TSQLConnection;
aSQLDataSet: TSQLDataSet;
aSQLConnection := TSQLConnection.Create(nil);
aSQLDataSet := TSQLDataSet.Create(nil);
try
// Setup Connection
...
aSQLDataSet.SQLConnection := aSQLConnection;
aSQLDataSet.CommandText := 'Insert into blah blah';
aSQLDataSet.ExecSQL;
finally
FreeAndNil( aSQLConnection );
FreeAndNil( aSQLDataSet );
end;
|
|
| Back to top |
|
 |
Bill Todd (TeamB) Guest
|
Posted: Wed Jan 28, 2004 11:08 pm Post subject: Re: Implicit Transactions |
|
|
On Wed, 28 Jan 2004 10:39:31 -0600, srdaniel <srdaniel (AT) hotmail (DOT) com>
wrote:
| Quote: | 1) Does IBX stand for dbExpress?
|
No. InterBase Express.
| Quote: |
2) So with I try the following, I am leaving a transaction uncommited
because it was started automatically and I didn't commit it?
|
That is correct.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
| Back to top |
|
 |
|