Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SOAP Server ADO Implementation Issue

60 views
Skip to first unread message

Shannon Broskie

unread,
Aug 15, 2001, 10:03:18 PM8/15/01
to
Hello, I have an issue when trying to create a TADOConnection... When
doing so, the ISAPI DLL locks up and never seems to return. I can't even
unload it in IIS. The details...

I have a simple interface unit which contains the following snippets:

The types:

TAccountPortfolio = class (TRemotable)
private
FAccount, FPortfolio : string;
public
property Account : string read FAccount write FAccount;
property Portfolio : string read FPortfolio write FPortfolio;
end;

TAccountPortfolioArray = array of TAccountPortfolio;

IAccountPortfolio = interface(IInvokable)
['{3C306103-9E37-4904-A8A7-5E71078C29DE}']
function GetAccountPortfolios (out Rows: Integer): TAccountPortfolioArray;
stdcall;
end;

Initialization:
InvRegistry.RegisterInterface(TypeInfo(IAccountPortfolio));
RemClassRegistry.RegisterXSClass(TAccountPortfolio);
RemClassRegistry.RegisterXSClass(TAccountPortfolioArray);

The implemenation unit contains a data class. This class is what is used to
create the database connection and query the data. My issue is that when
the Constructor for my data class is called, the first line is to create the
TADOConnection. This is where it locks up. If I comment out the code in
this section, the dll loads fine, but of course, it's not ready to collect
data... Here's the TData class and methods...

TData = class
private
FConnection : TADOConnection;
FDataset : TADODataset;
protected
procedure OpenDataset (SQL : string);
procedure CloseDataset;
public
constructor Create;
destructor Destroy; override;
end;

implemenation
var
Data : TData;

constructor TData.Create;
begin
FConnection := TADOConnection.Create (nil); // *** This affects whether
it runs ok or not
FConnection.LoginPrompt := False;
FConnection.ConnectionString := 'Provider=MSDASQL.1;Persist Security
Info=False;Data Source=CamraData';
FDataset := TADODataset.Create (nil);
FDataset.Connection := FConnection;
end;

initialization
Data := TData.Create;

Again, if I comment out the code in the constructor the DLL runs fine (I can
pull up the WSDL). I commented out all of the code except for the first
FConnection := TADOConnection line and that hangs or freezes or something
the DLL. I wind up having to reboot the PC each time because the IIS
personal server can't unload it.

Any suggestions would be helpful. I thought I might have an issue when I
actually connected to the database, but not on just creating the
TADOConnection....

Thanks in advance for any help...


Shiv Kumar

unread,
Aug 16, 2001, 12:11:42 AM8/16/01
to
"Shannon Broskie" <sbro...@mediaone.net> wrote in message
news:3b7b2b58$1_1@dnews...

> Hello, I have an issue when trying to create a TADOConnection... When
> doing so, the ISAPI DLL locks up and never seems to return. I can't even
> unload it in IIS. The details...

I haven't looked deep into your code, but did you set the LogInPrompt to
False for the TADOConnection?

--
Shiv Kumar
The Delphi Apostle
http://www.matlus.com:8080
http://www.delphisoap.com:8080


Shannon Broskie

unread,
Aug 16, 2001, 8:17:19 AM8/16/01
to
Yes I did... But again... This happens on the creation of the
TADOConnection; not on the setting of properties of the connection.

FConnection := TADOConnection.Create (nil);


"Shiv Kumar" <sh...@erols.com> wrote in message news:3b7b4816_1@dnews...

Shannon Broskie

unread,
Aug 16, 2001, 8:18:08 AM8/16/01
to
Erols.com.... Are you in the Mid Atlantic area?


"Shiv Kumar" <sh...@erols.com> wrote in message news:3b7b4816_1@dnews...

Shannon Broskie

unread,
Aug 16, 2001, 9:55:49 AM8/16/01
to
As a follow up... I set up IIS for interactive debug mode w/ Delphi and
indeed the call from FConnection := TADOConnection.Create (nil) never
returns...

"Shiv Kumar" <sh...@erols.com> wrote in message news:3b7b4816_1@dnews...

Shannon Broskie

unread,
Aug 16, 2001, 10:06:47 AM8/16/01
to
I went ahead and posted the project in the attachments group. It's about as
simple as it can get...


"Shiv Kumar" <sh...@erols.com> wrote in message news:3b7b4816_1@dnews...

Shiv Kumar

unread,
Aug 16, 2001, 10:20:14 AM8/16/01
to
"Shannon Broskie" <shannon...@tagfolio.com> wrote in message
news:3b7bbc29$1_1@dnews...

> Erols.com.... Are you in the Mid Atlantic area?

I'm on the East coast (VA) very close to DC.

Shannon Broskie

unread,
Aug 16, 2001, 10:44:48 AM8/16/01
to
Cool.... I'm in Richmond...

"Shiv Kumar" <sh...@erols.com> wrote in message news:3b7bd6b6_1@dnews...

Shiv Kumar

unread,
Aug 16, 2001, 2:15:14 PM8/16/01
to
If you ever plan to head north let me know, we can try and get in touch some
how...

Raoul du Plessis

unread,
Aug 16, 2001, 4:32:18 PM8/16/01
to
Shannon,

I have had this exact same problem - I posted it to this group some time
ago, I forget the thread subject line.

I never got really tenacious about this since I am not about to use Web
Services "in anger" as it were, but the long and the short of it was that
the ONLY way I could find to do ADO DB stuff with webservices was to connect
as part of the actual implementation object itself i.e. the ADOConnection
MUST be an instance variable of the class that implements the service
interface. Or a local variable of the actual method.

Nothing else I could do would work. Crash and burn on connect...

I noted that Shiv's demo on his (excellent) site did that same thing for
connections.

Hope this helps. Well, of course it doesn't, its a cop out. But at least you
can get stuff to work by connecting and disconnecting with every call.

Raoul


Dennis Passmore

unread,
Aug 16, 2001, 6:14:52 PM8/16/01
to

I was having the same problem and finally gave up on using a
TADOConnection all together and just set the "ConnectString" of the
TADOQuery I am using and do not have any more problems.


constructor TADOReader.Create; // override;
begin
inherited;
ADOQuery1 := TADOQuery.create(nil);
ADOQuery1.ConnectionString :=
'Provider=SQLOLEDB.1;Persist Security Info=False;
User ID='+fUserName+';'+
'Password='+fPassword+';Initial Catalog='+fDBName+';
Data Source='+fSQLServer;
ADOQuery1.CursorType := ctOpenForwardOnly;
end;

destructor TADOReader.Destroy; //override;
begin
ADOQuery1.Close;
ADOQuery1.Free;
inherited;
end;


Dennis Passmore
Ultimate Software, Inc

Shiv Kumar

unread,
Aug 16, 2001, 8:12:03 PM8/16/01
to
Shannon,

What I would do is put all of the data access stuff in a data module so you
get design time help (Plus set connected to true). Then in the
implementation, I'd simply create the DM and free it (or in init and
finalize as you do).

This is not a solution to your issue since you've already found one and
Dennis has given a proper explanation as to why you had the problem in the
first place, but it will solve your problem since you won't need to call
CoInit etc. explicitly.

John Ray

unread,
Aug 21, 2001, 6:06:43 PM8/21/01
to
Did the issue of using a ADO connection in a Data module in an ISAPI DLL
ever get resolved? I'm having difficulty with this. I have a

CGI web service that works just fine, but it hangs when running as a ISAPI.
I call coinitialize, create the datamodule and connect the ADO connection in
the initialization section. The dll hangs IIS indefinately when i send it
the /wsdl command.

What is the solution? To connect in each call? I have 20 ADO stored procs in
the datamodule - will they work thread safely? If I recall, IIS spawns a new
thread for each request...

/John

"Shiv Kumar" <sh...@erols.com> wrote in message news:3b7c6169_1@dnews...

mallik

unread,
Sep 1, 2001, 10:15:58 AM9/1/01
to
Hi,


I'm new to the CLR/webservices world, I have quite a good experience
with the COM+ Techies but finding diffucult to start off with .XML web
service world, i
have a few questions, i would appricicate any kind of infomration


1. Is there any easy way of publishing my components and their methods as a
web service ?
2. Can i still use ADO RecordSet as a parameter in method calls?
3. if i can, where does another developer get the information about the ADO
RecordSet ?


Thanks
Malli

"Shannon Broskie" <sbro...@mediaone.net> wrote in message
news:3b7b2b58$1_1@dnews...

mallik

unread,
Sep 3, 2001, 5:36:16 AM9/3/01
to

cristinal...@gmail.com

unread,
May 5, 2014, 9:40:38 AM5/5/14
to
hey can you help me with my connection???
0 new messages