Hi.
I found some strange problem in Zeos 7.1.3 Stable using Oracle 11g R2.
If I open many connections e close them, the database give me this error "ORA-12516: TNS:listener could not find available handler with matching" and the number of sessions in the database goes to the limit.
This problem does not happen using Zeos 6.
This is an example of my code:
-------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
MyThread1, MyThread2, MyThread3 : TMyThread;
begin
bStop := not bStop;
if bStop then
Button1.Caption := 'Stop'
else
Button1.Caption := 'Start';
Sleep(3000);
ZConnection1.HostName := edtHost.Text;
ZConnection1.Port := edtPort.Value;
zConnection1.Catalog := edtInstance.Text;
zConnection1.Database := edtInstance.Text;
ZConnection1.User := edtUser.Text;
ZConnection1.Password := edtPass.Text;
if bStop then
begin
MyThread1 := TMyThread.Create(False);
with MyThread1 do
begin
Sender := Self;
FreeOnTerminate := True;
Resume;
end; //with
MyThread2 := TMyThread.Create(False);
with MyThread2 do
begin
Sender := Self;
FreeOnTerminate := True;
Resume;
end; //with
MyThread3 := TMyThread.Create(False);
with MyThread3 do
begin
Sender := Self;
FreeOnTerminate := True;
Resume;
end; //with
end;
end;
{ TMyThread }
procedure TMyThread.Execute;
var
con: TZConnection;
qry: TZQuery;
begin
while Sender.bStop do
begin
try
con := TZConnection.Create(nil);
try
con.HostName := Sender.ZConnection1.HostName;
con.Port := Sender.ZConnection1.Port;
con.Catalog := Sender.zConnection1.Catalog;
con.Database := Sender.zConnection1.Database;
con.User := Sender.ZConnection1.User;
con.Password := Sender.ZConnection1.Password;
con.Protocol := Sender.ZConnection1.Protocol;
if not con.Connected then
con.Connect;
con.StartTransaction;
qry := TZQuery.Create(nil);
try
qry.Connection := con;
qry.SQL.Text := 'select * from dual';
qry.Open;
qry.Close;
finally
if Assigned(qry) then
FreeAndNil(qry);
end;
if con.InTransaction then
con.Commit;
if con.Connected then
con.Disconnect;
finally
if Assigned(con) then
FreeAndNil(con);
end;
except
on E: Exception do
Sender.SaveToFile(E.Message + #13#10, 'C:\ZeosOracle.txt');
end;
end;
inherited;
end;
-----------------------------------
Thx
Zeos 7 + Oracle 11g - BUG
Zeos 7 + Oracle 11g - BUG
You do not have the required permissions to view the files attached to this post.
Re: Zeos 7 + Oracle 11g - BUG
I found something that can cause this problem.
If I comment this part in the unit "ZDbcOracle.pas", then problem does not occur.
_______________________________________________
if OCI_CLIENT_CHARSET_ID = 0 then
begin
OCI_CLIENT_NCHARSET_ID := High(ub2);
GetPlainDriver.AttrGet(FHandle, OCI_HTYPE_ENV, @OCI_CLIENT_CHARSET_ID,
nil, OCI_ATTR_ENV_CHARSET_ID, FErrorHandle); //Get Server default CodePage
CheckCharEncoding(GetPlainDriver.ValidateCharEncoding(OCI_CLIENT_CHARSET_ID)^.Name);
if OCI_CLIENT_CHARSET_ID <> OCI_CLIENT_NCHARSET_ID then
begin
CleanupOnFail;
Open;
Exit;
end;
end;
If I comment this part in the unit "ZDbcOracle.pas", then problem does not occur.
_______________________________________________
if OCI_CLIENT_CHARSET_ID = 0 then
begin
OCI_CLIENT_NCHARSET_ID := High(ub2);
GetPlainDriver.AttrGet(FHandle, OCI_HTYPE_ENV, @OCI_CLIENT_CHARSET_ID,
nil, OCI_ATTR_ENV_CHARSET_ID, FErrorHandle); //Get Server default CodePage
CheckCharEncoding(GetPlainDriver.ValidateCharEncoding(OCI_CLIENT_CHARSET_ID)^.Name);
if OCI_CLIENT_CHARSET_ID <> OCI_CLIENT_NCHARSET_ID then
begin
CleanupOnFail;
Open;
Exit;
end;
end;