I attach you a screenshot of how my DBModul looks alike.You are not showing everything. What are the properties of the databases and transaction.
Here are the copies, to me they look the same:Could you also show the relevant SQL components.
now, it works, but in a way, I am not happy.I'm not sure what you have now and what makes you unhappy.
I filled in before:
DataModule_24.IBDatabase_Aktien.connected:=true; DataModule_24.IBTransaction_Aktien.Active:=true;
I do not use this in the "working" version?
Contrary, when the database was "connected" on starting any sql query, this leads to troubles.
I did a full text search of my code and I cannot find such a line for the "working" database. If it MUST be connected, where can this happen?If you have a databasename in the Object Inspector set, and have it as Active or Connected = true, then this could cause problems.
Thank you for taking time to explain!Yes. But I would normally not hardcode this into the code.
This
"Db := <read it here>"
what is read it here? The full path to the database?
This would mean, that I must not use FlameRobin while my software is running?If you use a server-based Firebird instance on your computer (so connect to IP:/path/databasename instead of direct connection) you can connect multiple programs to the database at the same time. Only with embedded instances connecting multiple programs is a problem.
IBQuery has a orioperty silimar to "autoopen transaction" or so. I always check it. IBSQL does NOT have such a property, - or is it hidden? Neverthelesss it works, without I care about transaction starting and stopping in my first database. Or have I set "starting transaction automatically" anywhere in the database? I read all the properties and could not find any.For TIBSQL you indeed need to set the Transaction to active. This is and was always normal behavior for IBX. The AllowAutoActiveTransaction in TIBQuery is a addition which was added later on. But yes, for normal transactional database programming, you normally need to handle all transactions, it's just part of transaction database handling.
Do I have to set it explicitly to acitve = false every time as well?No, during the disconnect or cleanup of the transaction, the default transaction action will be done (rollback or commit, but usually a rollback).
At the moment I have one datamodul for two databases. It just holds a Tdatabase and a TTransaction each.There is nothing wrong with having "only" one connection and one Transaction for 1 (or more) Query-Objects (per Database), as long as you play by the rules:
Is it enough to keep the queries apart from each other? - Or may I mess up my database by using the same transaction?
I care to work clean by shutting down and active-inactive.
But caring to work clean and succeed in it are two aspects.
In IBQuery there is a checkbox autocommit, this I check usually.It could be that the default action of the transaction is commit. I normally set that to rollback so I don't commit something by accident.
IBSQL just works, if I care to start the transaction.