Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-08

TSQLTransaction.Action property not implemented

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Chris Crori

Hi guys,
i was under the impression that the ?Action? property had a value in TSQLTransaction component... correct me if i am wrong but in testing i did and in code (sqldb.pp) i saw that it doesn?t matter the value i put in the property, the default action when a transaction closes is rollback.

And now the question part
a) am i right?
b) is this a todo?
c) is there a timeline?
or
a) am i wrong?
b) is there a part of code i am missing?
c) how would i use a transaction in a correct manner?

ps : please forgive any misuse of english
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130807/d5e3f1db/attachment.html>

Reply by email

Michael Van Canneyt
to Chris Crori
Chris Crori wrote 6 lines
Hi guys, ??? i was under the impression that the ?Action? property had a value in TSQLTransaction component... correct me if i am wrong but in testing i did and in code (sqldb.pp) i saw that it doesn?t matter the value i put in the property, the default action when a transaction closes is rollback. ? And now the question part ??? a) am i right?

Yes.

??? b) is this a todo?

No, it is already done in trunk.

??? c) is there a timeline?

It is done.

In SQLDB, it is better to call explicitly Commit, Rollback or RollBackRetaining. It may require a typecast:

(Q.Transaction as TSQLTransaction).Commit;

Unless you have the transaction object declared somewhere, in which case you don't need the typecast.

Michael.

Reply by email

Chris Crori
to Michael Van Canneyt

Thanks! :)
I just reinstalled my Operating systems so i haven't looked up the trunk for a while, i guess i have to!!! :P
The main idea is to build a form that "autosaves" any changes, so i have to explicitly call just rollback uppon cancelation. Is there another reason to prefer to call Commit myself?

-----?????? ??????-----

Earlier message 45 lines
From: Michael Van Canneyt Sent: Wednesday, August 07, 2013 11:49 AM To: Lazarus mailing list Subject: Re: [Lazarus] TSQLTransaction.Action property not implemented On Wed, 7 Aug 2013, Chris Crori wrote: > Hi guys, > i was under the impression that the ?Action? property had a value in > TSQLTransaction component... > correct me if i am wrong but in testing i did and in code (sqldb.pp) i saw > that it doesn?t matter the value i put in the property, the default action > when a transaction closes is rollback. > > And now the question part > a) am i right? Yes. > b) is this a todo? No, it is already done in trunk. > c) is there a timeline? It is done. In SQLDB, it is better to call explicitly Commit, Rollback or RollBackRetaining. It may require a typecast: (Q.Transaction as TSQLTransaction).Commit; Unless you have the transaction object declared somewhere, in which case you don't need the typecast. Michael. --

Reply by email

Michael Van Canneyt
to Chris Crori
Chris Crori wrote 6 lines
Thanks! :) I just reinstalled my Operating systems so i haven't looked up the trunk for a while, i guess i have to!!! :P The main idea is to build a form that "autosaves" any changes, so i have to explicitly call just rollback uppon cancelation. Is there another reason to prefer to call Commit myself?

Yes.
The data in the form may be invalid, in which case the insert/update/whatever may fail.

Michael.

Show quoted text 59 lines
-----?????? ??????----- From: Michael Van Canneyt Sent: Wednesday, August 07, 2013 11:49 AM To: Lazarus mailing list Subject: Re: [Lazarus] TSQLTransaction.Action property not implemented On Wed, 7 Aug 2013, Chris Crori wrote: > Hi guys, > i was under the impression that the ?Action? property had a value in > TSQLTransaction component... > correct me if i am wrong but in testing i did and in code (sqldb.pp) i saw > that it doesn?t matter the value i put in the property, the default action > when a transaction closes is rollback. > > And now the question part > a) am i right? Yes. > b) is this a todo? No, it is already done in trunk. > c) is there a timeline? It is done. In SQLDB, it is better to call explicitly Commit, Rollback or RollBackRetaining. It may require a typecast: (Q.Transaction as TSQLTransaction).Commit; Unless you have the transaction object declared somewhere, in which case you don't need the typecast. Michael. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Chris Crori
to Michael Van Canneyt

Good point, any of my validation checks may be outdated in an update... stupid of me not to think about that, thanks!

-----?????? ??????-----

Earlier message 92 lines
From: Michael Van Canneyt Sent: Wednesday, August 07, 2013 12:19 PM To: Lazarus mailing list Subject: Re: [Lazarus] TSQLTransaction.Action property not implemented On Wed, 7 Aug 2013, Chris Crori wrote: > Thanks! :) > I just reinstalled my Operating systems so i haven't looked up the trunk > for > a while, i guess i have to!!! :P > The main idea is to build a form that "autosaves" any changes, so i have > to > explicitly call just rollback uppon cancelation. Is there another reason > to > prefer to call Commit myself? Yes. The data in the form may be invalid, in which case the insert/update/whatever may fail. Michael. > > -----?????? ??????----- > From: Michael Van Canneyt > Sent: Wednesday, August 07, 2013 11:49 AM > To: Lazarus mailing list > Subject: Re: [Lazarus] TSQLTransaction.Action property not implemented > > > > On Wed, 7 Aug 2013, Chris Crori wrote: > >> Hi guys, >> i was under the impression that the ?Action? property had a value in >> TSQLTransaction component... >> correct me if i am wrong but in testing i did and in code (sqldb.pp) i >> saw >> that it doesn?t matter the value i put in the property, the default >> action >> when a transaction closes is rollback. >> >> And now the question part >> a) am i right? > > Yes. > >> b) is this a todo? > > No, it is already done in trunk. > >> c) is there a timeline? > > It is done. > > In SQLDB, it is better to call explicitly Commit, Rollback or > RollBackRetaining. > It may require a typecast: > > (Q.Transaction as TSQLTransaction).Commit; > > Unless you have the transaction object declared somewhere, in which case > you > don't need the typecast. > > Michael. > > > > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > --

Reply by email