Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#5 PATCH FOR databases with limited stmt handles connection

closed
nobody
None
5
2005-07-18
2004-04-01
Thierry Nivon
No

I'm using sapdb with dbexpress
and sapdb has limited statmement handle by connection
(about 32000)
but If I take a look at how is kept this notion I see
that there is only two solutions
0 (infinite) or one handle by connection
so I have modified
DbxOpenOdbc with this

function FindFreeConnection: PConnectionStatement;
var
i: Integer;

begin
//***************************
if
fConnectionStatementList.Count<fStatementPerConnection then
begin
result:=new(PConnectionStatement) ;
result.fHCon:=fhCon ;
result.fHStmt:=SQL_NULL_HANDLE ;
fConnectionStatementList.Add(result) ;
end ; // if
fConnectionStatementList.Count<fStatementPerConnection then
//***************************
for i := 0 to (fConnectionStatementList.Count - 1) do
begin
Result := fConnectionStatementList[i];
if (Result.fhCon <> SQL_NULL_HANDLE) and
(Result.fHStmt = SQL_NULL_HANDLE) then
exit;
end;
Result := nil; // not found
end;

It's not the best solution as it doesn't keep a list
for each connection. But It works for SAP, as we'll
never reach the limit for a single connection

Discussion

    • status: open --> closed