Recent

Author Topic: Lazarus e Firebird problem! ExecSQL not function correctly!  (Read 6062 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Lazarus e Firebird problem! ExecSQL not function correctly!
« on: August 02, 2010, 08:04:06 am »
My problem is this, I created a database firebird and I are connected with Lazarus, when I run the insert or update of these are made only for the life of the program. If I close and reopen the program inserts and updates performed with MiaConnessione.ExecSQL not there. Why?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

michaelthuma

  • Jr. Member
  • **
  • Posts: 51
Re: Lazarus e Firebird problem! ExecSQL not function correctly!
« Reply #1 on: August 02, 2010, 09:11:09 am »
Hallo!

2 Things:

a) Use TSQLQuery's ApplyUpdates to at least push the data to database without commiting. If you want to commit the data then Connection.Transaction.CommitRetaining or Connection.TransactionCommit (Closed the Query).

Post pushes the data into the queryies buffer. ApplyUpdates pushes the data to the database so data is still local to your application. Commit applys the changes ("writes it to disk"). --> Explained more or less unpreceise enough ... to keep things simple.

b) Set the transaction to whetever makes sense when the application is closed. Action:=caAbort - makes lot more sense.

xinyiman

  • Hero Member
  • *****
  • Posts: 2261
    • Lazarus and Free Pascal italian community
Re: Lazarus e Firebird problem! ExecSQL not function correctly!
« Reply #2 on: August 02, 2010, 12:57:51 pm »
RESOLVED with Transaction.CommitRetaining  after the ExecSQL

Thank you
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018