Reexecute unidirectional query after restart the server
Reexecute unidirectional query after restart the server
Hallo,
I use UniConnection.OnConnectionLost() to ask the user to retry (rmReconnectExecute).
With SQL Server and MySQL all is fine after restart the server and reconnect.
But with PostgreSQL if I have a unidirectional UniQuery there is an error after reconnecting:
"Active transaction is required for using FetchAll = False mode." into the TPgSQLRecordSet.ExecCommand
Best Regards,
Cristian Peţa
I use UniConnection.OnConnectionLost() to ask the user to retry (rmReconnectExecute).
With SQL Server and MySQL all is fine after restart the server and reconnect.
But with PostgreSQL if I have a unidirectional UniQuery there is an error after reconnecting:
"Active transaction is required for using FetchAll = False mode." into the TPgSQLRecordSet.ExecCommand
Best Regards,
Cristian Peţa
Re: Reexecute unidirectional query after restart the server
Hello,
We cannot reproduce the problem, please specife the UniDAC and IDE versions
We cannot reproduce the problem, please specife the UniDAC and IDE versions
Re: Reexecute unidirectional query after restart the server
Hallo,
I use last UniDAC 4.6.12, XE3, PostgreSQL 9.2
I was send an email with a test project to you because it was not easy to reproduce outside my application.
Best Regards,
Cristian Peţa
I use last UniDAC 4.6.12, XE3, PostgreSQL 9.2
I was send an email with a test project to you because it was not easy to reproduce outside my application.
Best Regards,
Cristian Peţa
Re: Reexecute unidirectional query after restart the server
Hello,
Thank you for the information, we have reproduced the problem and will try to fix it as soon as possible. For the time being, to solve the problem, you can set the CursorWithHold option to True.
Thank you for the information, we have reproduced the problem and will try to fix it as soon as possible. For the time being, to solve the problem, you can set the CursorWithHold option to True.
Re: Reexecute unidirectional query after restart the server
Hallo,
thank you for the information.
Now I understand why there are two connections. Second is for opening transaction for FetchAll=False.
And a little suggestion. This second internal connection can use ApplicationName? First time I was not sure from where is this connection because on server ApplicationName is empty.
Best Regards,
Cristian Peţa
thank you for the information.
Now I understand why there are two connections. Second is for opening transaction for FetchAll=False.
And a little suggestion. This second internal connection can use ApplicationName? First time I was not sure from where is this connection because on server ApplicationName is empty.
Best Regards,
Cristian Peţa
Re: Reexecute unidirectional query after restart the server
Hello,
When setting the UniDirectional property to True, the FetchAll property is set automatically to False, as on FetchAll = True the UniDirectional option has no sense.
We have fixed the ApplicationName property setting for internal connections.
When setting the UniDirectional property to True, the FetchAll property is set automatically to False, as on FetchAll = True the UniDirectional option has no sense.
We have fixed the ApplicationName property setting for internal connections.
Re: Reexecute unidirectional query after restart the server
The UniDirectional mode use less memory only because it is not fetched all records?AlexP wrote: ... on FetchAll = True the UniDirectional option has no sense.
In this case if my query return only one row (or less than FetchRows) it is a non sens to use UniDirectional mode?
Best Regards,
Cristian Peţa
Re: Reexecute unidirectional query after restart the server
Hello,
The UniDirectional mode is designed for decreasing memory usage when reading a large dataset. This is achieved by the fact that memory stores only the number of records, that is specified in the FetchRows property; when obtaining a sequential portion of data, the previous data is deleted (navigation is also possible only within the current fetched block). If the number of data is less than the FetchRows value, the UniDirectional mode has no sense, since all data will be retrieved at once in any way.
The UniDirectional mode is designed for decreasing memory usage when reading a large dataset. This is achieved by the fact that memory stores only the number of records, that is specified in the FetchRows property; when obtaining a sequential portion of data, the previous data is deleted (navigation is also possible only within the current fetched block). If the number of data is less than the FetchRows value, the UniDirectional mode has no sense, since all data will be retrieved at once in any way.
Re: Reexecute unidirectional query after restart the server
Hello,
Thank you for clarification. I assumed wrong as there are other things out of fetched rows count with unidirectional mode because I recently moved from dbExpress (TSQLQuery and TSQLQuery+TDataSetProvider+TClientDataSet).
Best Regards,
Cristian Peţa
Thank you for clarification. I assumed wrong as there are other things out of fetched rows count with unidirectional mode because I recently moved from dbExpress (TSQLQuery and TSQLQuery+TDataSetProvider+TClientDataSet).
Best Regards,
Cristian Peţa