Hi,
I have something strange, i hope someone knows whats causing this.
In my vcl application i use several ways to execute sql statements, one is with a TUniQuery, with seperate transaction, i execute a StartTransaction on the UniQuery and execute for example a alter table statement, the result is that the command does not have effect until i perform a commit.
Great, thats what i want.
But, on another form, when i do the same statement but using a TUniScript, also with seperate transaction and with Starttransaction before i Execute the UniScript, the statement immediatly has effect, without commiting the transaction.
Of course there is no commit in the script and autocommit is false on both the uniconnection and the uniscript components.
Does anyone have an idea why UniScript seems to autocommit?
Unidac TUniscript with transaction
Re: Unidac TUniscript with transaction
I forgot to mention the database is a Firebird db.
Re: Unidac TUniscript with transaction
Additional: a 'alter table add' statement has effect without commiting, a insert into statement however works as expected, the new record is only visible after performing a commit.
Re: Unidac TUniscript with transaction
Someone pointed me to this: viewtopic.php?t=21995
which explains it, i don't suppose i can turn off the autocommit of ddl statements so i'll have to replace unidac with something else.
It would have been better if the AutoCommit property was split in 2 properties, AutoCommitDDL and AutoCommitDML, this way i could have turned it off.
which explains it, i don't suppose i can turn off the autocommit of ddl statements so i'll have to replace unidac with something else.
It would have been better if the AutoCommit property was split in 2 properties, AutoCommitDDL and AutoCommitDML, this way i could have turned it off.
Re: Unidac TUniscript with transaction
If you want us to implement the feature, please post it at our user voice forum: https://devart.uservoice.com/forums/104 ... 939-unidac. If the suggestion gets a lot of votes, we will consider the possibility to implement it.
Re: Unidac TUniscript with transaction
Well i'm not entirely sure anymore, i always assumed it would be possible to execute a ddl statement(like add a field to a table) in a transaction and then a dml statement (like put a value in the new created field) in the same transaction.
It seems that is a big mistake on my part, you can't do that, it's not possible in ibexpert either, and if i do the same with firedac, which does not commit the ddl statement automatically with Autocommit off, i get errors on the update statement because the field is not created yet.
So it all makes sense to me now that any ddl needs to commited when executing a script, so the way Unidac handles it is probably the good way.
Sorry for the misunderstanding, i'm not 100% used to work with transactiosn and it just confused me a bit.
It seems that is a big mistake on my part, you can't do that, it's not possible in ibexpert either, and if i do the same with firedac, which does not commit the ddl statement automatically with Autocommit off, i get errors on the update statement because the field is not created yet.
So it all makes sense to me now that any ddl needs to commited when executing a script, so the way Unidac handles it is probably the good way.
Sorry for the misunderstanding, i'm not 100% used to work with transactiosn and it just confused me a bit.
Re: Unidac TUniscript with transaction
Thank you for being interested in our products.
If you have any questions concerning our products, please don't hesitate to contact us - and we will try to help you resolve them.
If you have any questions concerning our products, please don't hesitate to contact us - and we will try to help you resolve them.