🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.opensource
Article #1

invalid transaction handle (expecting explicit transaction start)

#1
From: Pete
Date: Thu, 03 Jun 2004 06:10
150 lines
4452 bytes
Hi,

I'm using the IBX 6.07 component set with an interbase 6 Opensource DB
server. I have found that calling the DisplayUsers method of the
IBSecurityService component more than once at the same time will
produce the error above. I have been able to code a simple app that
when run 3 or more times on the same machine will die with this error.
My question is am I using the security service properly, am I calling
the DisplayUsers method correctly, is there something I am missing?

Any help would be greatly appreciated.

Thank you.

P.S. Do not email me, the email address has been deactivated.

The code (written in Delphi 6) follows:

----------------------------------Form1.dfm-------------------------------------
object Form1: TForm1
  Left = 267
  Top = 176
  Width = 465
  Height = 210
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCloseQuery = FormCloseQuery
  PixelsPerInch = 96
  TextHeight = 13
  object Button1: TButton
    Left = 376
    Top = 152
    Width = 75
    Height = 25
    Caption = 'Start'
    TabOrder = 0
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 288
    Top = 152
    Width = 75
    Height = 25
    Caption = 'Stop'
    Enabled = False
    TabOrder = 1
    OnClick = Button2Click
  end
  object IBSecurityService1: TIBSecurityService
    LoginPrompt = False
    TraceFlags = []
    SecurityAction = ActionAddUser
    UserID = 0
    GroupID = 0
    Left = 32
    Top = 24
  end
end
---------------------------------Form1.dfm--------------------------------------

---------------------------------Form1.pas--------------------------------------
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
  Dialogs, StdCtrls, IBServices;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    IBSecurityService1: TIBSecurityService;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    { Private declarations }
    Stopped: boolean;
    function CheckUser(const AUser: string): boolean;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  button1.enabled := false;
  button2.enabled := true;
  Stopped := False;
  while not Stopped do
  begin
    try
      CheckUser('FRED');
    except
      Button2Click(Sender);
      Raise;
    end;
    Application.ProcessMessages;
  end;
end;

function TForm1.CheckUser(const AUser: string): boolean;
begin
  with IBSecurityService1 do
  begin
    Protocol := TCP;
    ServerName := 'Localhost';
    Params.Clear;
    Params.Add('User_Name=SYSDBA');
    Params.Add('Password=masterkey');
    Active := True;
    try
      DisplayUser(AUser);
      Result := UserInfoCount = 1;
    finally
      if Active then Active := False;
    end;
  end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  button2.enabled := false;
  Stopped := True;
  button1.enabled := true;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose:
Boolean);
begin
  CanClose := button1.enabled;
end;

end.
------------------------------------Form1.pas-----------------------------------
Technical Details
Message-ID: <35846ff1.0406022210.437ea4af@posting.google.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 106772,8681a261a124eb5e,start
X-Google-Thread: fd38c,3a2490b9db9f2493,start
X-Google-Attributes: gid106772,gidfd38c,public
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews1.google.com!not-for-mail
From: pnbarber@hotmail.com (Pete)
Newsgroups: borland.public.interbase.opensource,borland.public.interbase.general
Subject: invalid transaction handle (expecting explicit transaction start)
Date: 2 Jun 2004 23:10:24 -0700
Organization: http://groups.google.com
Lines: 150
Message-ID: <35846ff1.0406022210.437ea4af@posting.google.com>
NNTP-Posting-Host: 203.32.193.21
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1086243025 19157 127.0.0.1 (3 Jun 2004 06:10:25 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 3 Jun 2004 06:10:25 +0000 (UTC)