Recent

Author Topic: IBExpress - best practise to change to "active"?  (Read 776 times)

Nicole

  • Sr. Member
  • ****
  • Posts: 349
[solved] Re: IBExpress - best practise to change to "active"?
« Reply #15 on: August 17, 2022, 07:01:45 pm »
Thanks, I am two steps further:

If I set login-prompt to TRUE in the dataset.database, it works at design-time to check "active"
("false" in all other components)
So design-time is solved.

At runtime it works to login without prompt, if the setting is to FALSE in the dataset as well (yes, ok, this time it is logic).

and hint of the Compiler:

Code: Text  [Select][+][-]
  1. Have you included ibexpress in your program uses list?
  2.  


==> done & restarted

next error-messages:

Code: Text  [Select][+][-]
  1. ....
  2. Transaction is not active
  3.  


Is there a way to make start the transaction automatically if it is needed?
If not, when and where shall I start the transaction?
What is the syntax?

Do I have to close then transaction again?
And: Does it make sense to have an own transaction for every dataset?


« Last Edit: August 20, 2022, 11:18:39 am by Nicole »

rvk

  • Hero Member
  • *****
  • Posts: 4947
Re: IBExpress - best practise to change to "active"?
« Reply #16 on: August 17, 2022, 07:09:27 pm »
Yes, I would always use a transaction per action.
Sometimes this is for one TIBQuery. Other times it's one transaction per several TIBQueries.
It depends on what you use it for.

You can set the AllowAutoStart of a transaction to true.
But you really need to know what transactions do and when you need to commit them (or roll them back).

If you don't care about transaction you can just use the defaulttransaction for every query but don't forget to commit when needed.

Nicole

  • Sr. Member
  • ****
  • Posts: 349
Re: IBExpress - best practise to change to "active"?
« Reply #17 on: August 17, 2022, 07:31:46 pm »
Many, many years ago I messed around with transactions of Interbase.
Then I had FireDAC and it just worked without it.
I hardly can remember this old code. Did not save it neither.

Back to the transactions:
I cannot find a property "AllowAutostart" in my TIBtransaction.

rvk

  • Hero Member
  • *****
  • Posts: 4947
Re: IBExpress - best practise to change to "active"?
« Reply #18 on: August 17, 2022, 08:03:00 pm »
I cannot find a property "AllowAutostart" in my TIBtransaction.
I'm probably thinking of IBX for Delphi.

In IBX for Lazarus there is a TIBQuery.AllowAutoActivateTransaction which you can set to true.
And if you set the default Action of the transaction to TACommit you almost have the same as in FireDAC.

Many, many years ago I messed around with transactions of Interbase.
Then I had FireDAC and it just worked without it.
I hardly can remember this old code. Did not save it neither.
FireDAC also uses transaction (behind the scenes) but you have much less control over it.

 

TinyPortal © 2005-2018