Page 1 of 1

connection transaction questions (since update to 5.5.11)

Posted: Mon 06 Oct 2014 16:22
by tonymeadors
We just upgraded to 5.5.11
and have begun regression testing our apps - first with Firebird.

It seems several UNIDAC changes affect how transactions are handled.
More flexibility is good.

We find that the Connection InTransaction property is now generally
True after opening a Query - that shouldn't affect too many people.

[b]But if you close the dataset the connection remains that way,
inTransaction=TRUE.[/b]

I tried a variety of autocommit and autoclose specificoptions but
have been unable to change this behavior.

We have thousands of queries occuring, many embedded within manually controlled
transactions, so we are getting errors and loss of transaction control
when a simple open+close starts a permanent transaction.

I must be missing something.
I read about the oldtransactionbehavior global - is that how we can
regain control of transactions?
(We do understand the old behavior was to employ an internal transaction for
each db action & that was how we built everything - [i]expecting autocommit
unless we were doing it manually[/i]).

We are on hold till we get this smoothed out.

thanks,
tonyM
ClearCycle Inc.

ps. The same apps work with ms sql and oracle as well so we have
to maintain the same action for all.

Re: connection transaction questions (since update to 5.5.11)

Posted: Tue 07 Oct 2014 07:12
by ViktorV
Yes, the point is, that in UniDAC since version 5.0.1 we added the DefaultTransaction transaction property. All datasets that use the TUniConnection component, use its DefaultTransaction for all operations under data. We added the property because a lot of our users asked us to do it.
In earlier UniDAC versions, all the datasets that used TUniConnection, used implicitly created internal transaction. This transaction always remained open, and it was not possible to control it.
In order to provide backward compatibility with older UniDAC versions, we added the OldTransactionBehaviour global variable declared in "Uni.pas". The default variable value is "False". So, if you want to have old behaviour, you should set the variable to "True".
Add the following code to the main form module of your application and check its work:

Code: Select all

initialization
  OldTransactionBehaviour := True;
If the problem persists, please send a small sample to viktorv*devart*com to demonstrate the issue, including a script to create database objects.