Page 1 of 1
Latest UniDac error "connection is not connected"
Posted: Mon 12 Sep 2016 13:58
by badmood
Sirs,
with the latest version of uniDac, just recompiling a program that never had this issue, I have an intermittent "connection is not connected" error message closing a form. Same identical form with previous version was ok.
Database: PostgreSQL 9.5.4
Delphi 10.1 Berlin
UniDAC 6.4.14
This is the code I use on the formclose event.
Code: Select all
for N := 0 to ComponentCount - 1 do
begin
C := Components[N];
if C is TUniQuery then TUniQuery(C).Close;
end;
Sergio.
Re: Latest UniDac error "connection is not connected"
Posted: Mon 12 Sep 2016 14:29
by AlexP
Hello,
The code you have provided works without errors. Please send a complete sample to support*devart*com
Re: Latest UniDac error "connection is not connected"
Posted: Mon 12 Sep 2016 14:58
by badmood
I know that this code works, it's there from an age...
I debugged the program, the error shows when you exit from the main form of the program:
(with DBConnection1 in connected status)
Code: Select all
if dmMain.DBConnection1.Connected then
dmMain.DBConnection1.Connected := False;
same if you use
Code: Select all
if dmMain.DBConnection1.Connected then
dmMain.DBConnection1.Disconnect;
The code is on the formclose event of the program main form.
Sorry, but right now I can't send you a sample code.
Re: Latest UniDac error "connection is not connected"
Posted: Tue 13 Sep 2016 10:23
by AlexP
This code doesn't lead to the error as well. We need a complete project reproducing the issue. Please try to compose a small application demonstrating this situation and send it to us.
Re: Latest UniDac error "connection is not connected"
Posted: Tue 13 Sep 2016 11:45
by badmood
I'm very sorry, but I can't send to you any code, because if I drop some element maybe the problem goes away and to give you something I must give to you some "patented" code and I really can't do this.
But... if the previous version never give me any error, and the latest do - only recompiling -, I can think that something have changed in your disconnection routines.
If debugging my code I see that I have an active connection an then the program execute the disconnect and I see "connection is not connected" I can only imagine that some change, maybe in your code, can lead to that message, who knows.
As a workaround I've put the lines on a try/on exception code.
Regards.
Re: Latest UniDac error "connection is not connected"
Posted: Wed 14 Sep 2016 09:09
by AlexP
Unfortunately, we can't tell the exact reasons for such behavior without reproducing the problem.