Hi,

I'm using version 1.7.1 and trying to use connection pooling, but the connections just grow and grow until I get a timeout. I've looked on the web and know about using the same connection string, but it doesn't seem to work.

in Web.Config, I have:

<add key="ConnectionString" value="User=SYSDBA;Password=masterkey;Database=C:\ChARMTeamData\ChARM.fdb;DataSource=localhost;Charset=NONE;Pooling=false;MinPoolSize=10;MaxPoolSize=200;Connection Lifetime=5;ServerType=0" />

and a sample Delphi function is (The call 'GetConnectionString' returns the above entry):

function TActivityDB.AddActivityIssue(MyGroup, MyProject, MyActivity,
  MyIssue: Integer): Boolean;
var
 cmd  : FBCommand;
 conn : FBConnection;
 parameterGroupID : FBParameter;
 parameterProjectID : FBParameter;
 parameterActivityID : FBParameter;
 parameterRiskID : FBParameter;
begin
  conn := FBConnection.Create;
  cmd := FbCommand.Create('PADDACTIVITYISSUE', conn);

  conn.ConnectionString := GetConnectionString;
  cmd.CommandType := CommandType.StoredProcedure;

  parameterGroupID := FBParameter.Create('@fGroupID', FBDbType.BigInt);
  parameterProjectID := FBParameter.Create('@fProjectID', FBDbType.BigInt);
parameterActivityID := FBParameter.Create('@fActivityID', FBDbType.BigInt);
  parameterRiskID := FBParameter.Create('@fIssueID', FBDbType.BigInt);

  cmd.Parameters.Add(parameterGroupID);
  cmd.Parameters.Add(parameterProjectID);
  cmd.Parameters.Add(parameterActivityID);
  cmd.Parameters.Add(parameterRiskID);

  parameterGroupID.Value := TObject(MyGroup);
  parameterProjectID.Value := TObject(MyProject);
  parameterActivityID.Value := TObject(MyActivity);
  parameterRiskID.Value := TObject(MyIssue);

  cmd.Connection.Open;
  try
    cmd.ExecuteNonQuery;
  except
  end;
  cmd.Free;
  Conn.Close;
  Conn.Dispose;
end;

If I run just this function 10 times, there are 10 connections in Firebird .... I don't see what I'm doing wrong, but I'm sure someone will .... the connection string is the same always and I do call Close and Dispose.

Any ideas ....

Thanks

Eric


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to