Hi everybody,
I'm using Universal Data Access 3.0.010 to access a mysql 5.1 database.
Today the following has surprised me:
I'am using a tUniQuery to update some data with generated sql-statemens like
insert into foo(bar) values (:bar)
in the TUniQuery.SQL property. Then i execute the Insert with the TUniQuery.ExecSQL method. Because of some other testing in this TUniQuery-Component was UniDirectional set to TRUE.
This has been used in a loop so about 1.000 times. Because of the poor performance i checked the mysql.log-file and find out that every call to ExecSQL opens a new connection, execute the insert and close the connection afterwards.
Setting UniDirectional back to FALSE (the default) anything works as expected: 1 connection, many inserts and 1 disconnection.
Can anyone tell me what's wrong with UniDirectional=true and .ExecSQL?
Thank you
Robert
EDIT: I forget to mention, i use Delphi 2006
TUniQuery, UniDirectional=TRUE and ExecSQL
To solve the problem set the CreateConnection specific option of TUniQuery to False, like this:
You can find more detailed information about this option in the UniDAC help.
Code: Select all
UniQuery.SpecificOptions.Values['CreateConnection'] := 'False';