BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Implicit Transactions

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress)
View previous topic :: View next topic  
Author Message
srdaniel
Guest





PostPosted: Tue Jan 27, 2004 11:18 pm    Post subject: Implicit Transactions Reply with quote



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





PostPosted: Tue Jan 27, 2004 11:44 pm    Post subject: Re: Implicit Transactions Reply with 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)
Back to top
srdaniel
Guest





PostPosted: Tue Jan 27, 2004 11:48 pm    Post subject: Re: Implicit Transactions Reply with quote



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





PostPosted: Wed Jan 28, 2004 3:39 am    Post subject: Re: Implicit Transactions Reply with 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)
Back to top
srdaniel
Guest





PostPosted: Wed Jan 28, 2004 4:39 pm    Post subject: Re: Implicit Transactions Reply with quote

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





PostPosted: Wed Jan 28, 2004 11:08 pm    Post subject: Re: Implicit Transactions Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.