Board index » delphi » multitreaded COMServer freeze after a while on an ADOQuery.open

multitreaded COMServer freeze after a while on an ADOQuery.open

Hi!
        I know that many of you can make worked the ADOComponents (Delphi7,
both MS OLEDB Provider for MSSQLServer or Oracle) great in a
multithreaded server, but as far as Im concerned, I cannot get it worked!
        This is a Midas/COM server in an NT Service. I have an ADOConnection
per RemoteDataModule (Apartment or Free Threaded makes no great
differences... and I dont know really the one I must use) and many
datamodules with each one many ADOQueries. If only one client is
connected it seems to work fine but if the number of clients grows, the
server will crash more or less rapidly... I mean that all get stalled
and no-one can anymore connect him to the application or works within it!
        With a stresser application I see that it frozes on an ADOQuery.Open. I
saw also a montain of Acces Violations always read on the same addresses
(on the adoquery.open) that is not catch and makes no exceptions but
that we see on the eventlog.

        I tried many features (CoInit, CoUnInit, mutex, differents parameters,
only one ADOConnection for the app, etc...) with no success...
        The same application (with the same code) was working fine (and still
do yet because ado dont) with the BDE.

        Please, can you tell me a way to find out a solution, or post the code
that workes great for you... or something else that would help me.
        I'll really appreciate any kind of suggestions.

Best regards,
Michael
[Tell me if it is a wrong newsgroup]

 

Re:multitreaded COMServer freeze after a while on an ADOQuery.open


Oops..
        Im mean on a TADOConnection.Open the application Freeze... it is when a
new client is connecting... but access violation are on the adoquery.open!

Quote
>     I know that many of you can make worked the ADOComponents (Delphi7,
> both MS OLEDB Provider for MSSQLServer or Oracle) great in a
> multithreaded server, but as far as Im concerned, I cannot get it worked!
>     This is a Midas/COM server in an NT Service. I have an ADOConnection
> per RemoteDataModule (Apartment or Free Threaded makes no great
> differences... and I dont know really the one I must use) and many
> datamodules with each one many ADOQueries. If only one client is
> connected it seems to work fine but if the number of clients grows, the
> server will crash more or less rapidly... I mean that all get stalled
> and no-one can anymore connect him to the application or works within it!
>     With a stresser application I see that it frozes on an
> ADOQuery.Open.

        No ADOConnection.Open!

I saw also a montain of Acces Violations always read on

Quote
> the same addresses (on the adoquery.open)

        here, yes.

  that is not catch and makes no

Quote
> exceptions but that we see on the eventlog.

>     I tried many features (CoInit, CoUnInit, mutex, differents
> parameters, only one ADOConnection for the app, etc...) with no success...
>     The same application (with the same code) was working fine (and
> still do yet because ado dont) with the BDE.

>     Please, can you tell me a way to find out a solution, or post the
> code that workes great for you... or something else that would help me.
>     I'll really appreciate any kind of suggestions.

> Best regards,
> Michael
> [Tell me if it is a wrong newsgroup]

Re:multitreaded COMServer freeze after a while on an ADOQuery.open


Ive found the problem... but I need some light about it! ;-)
        In each datamodule we have ( in the OnCreate event) made this loop:

   For i := 0 to Self.ComponentCount-1 do
   begin
     if Self.Components[i].inheritsFrom(TAdoQuery)
     then TAdoQuery(Self.Owner).EnableBCD := False;
   end;        

                I remove this lines from each dms and it works perfectly!! The
datamodule are created when need and freeed at the deconnection.
        Why have we this behavoir ?

Regards,
Michael

Michael a crit:

Quote
> Oops..
>     Im mean on a TADOConnection.Open the application Freeze... it is
> when a new client is connecting... but access violation are on the
> adoquery.open!

>>     I know that many of you can make worked the ADOComponents
>> (Delphi7, both MS OLEDB Provider for MSSQLServer or Oracle) great in a
>> multithreaded server, but as far as Im concerned, I cannot get it worked!
>>     This is a Midas/COM server in an NT Service. I have an
>> ADOConnection per RemoteDataModule (Apartment or Free Threaded makes
>> no great differences... and I dont know really the one I must use) and
>> many datamodules with each one many ADOQueries. If only one client is
>> connected it seems to work fine but if the number of clients grows,
>> the server will crash more or less rapidly... I mean that all get
>> stalled and no-one can anymore connect him to the application or works
>> within it!
>>     With a stresser application I see that it frozes on an ADOQuery.Open.

>     No ADOConnection.Open!

> I saw also a montain of Acces Violations always read on

>> the same addresses (on the adoquery.open)

>     here, yes.

>  that is not catch and makes no

>> exceptions but that we see on the eventlog.

>>     I tried many features (CoInit, CoUnInit, mutex, differents
>> parameters, only one ADOConnection for the app, etc...) with no
>> success...
>>     The same application (with the same code) was working fine (and
>> still do yet because ado dont) with the BDE.

>>     Please, can you tell me a way to find out a solution, or post the
>> code that workes great for you... or something else that would help me.
>>     I'll really appreciate any kind of suggestions.

>> Best regards,
>> Michael
>> [Tell me if it is a wrong newsgroup]

Re:multitreaded COMServer freeze after a while on an ADOQuery.open


May be

      if Self.Components[i].inheritsFrom(TAdoQuery)
      then TAdoQuery(Self.Components[i]).EnableBCD := False;

You check Self.Components[i] and then work with Self.Owner. But it is most
probable is not TAdoQuery (of course if owner of your TDataModule is not
TAdoQuery).

----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server, MS Jet (MS Access)
and Interbase (through OLEDB) databases.

"Michael" <michael.r...@NOFOODapavealsacienne.com> ???????/???????? ?
???????? ?????????: news:3EF86CA5.4040100@NOFOODapavealsacienne.com...

Quote
> Ive found the problem... but I need some light about it! ;-)
> In each datamodule we have ( in the OnCreate event) made this loop:

>    For i := 0 to Self.ComponentCount-1 do
>    begin
>      if Self.Components[i].inheritsFrom(TAdoQuery)
>      then TAdoQuery(Self.Owner).EnableBCD := False;
>    end;

> I remove this lines from each dms and it works perfectly!! The
> datamodule are created when need and freeed at the deconnection.
> Why have we this behavoir ?

> Regards,
> Michael

> Michael a crit:
> > Oops..
> >     Im mean on a TADOConnection.Open the application Freeze... it is
> > when a new client is connecting... but access violation are on the
> > adoquery.open!

> >>     I know that many of you can make worked the ADOComponents
> >> (Delphi7, both MS OLEDB Provider for MSSQLServer or Oracle) great in a
> >> multithreaded server, but as far as Im concerned, I cannot get it
worked!
> >>     This is a Midas/COM server in an NT Service. I have an
> >> ADOConnection per RemoteDataModule (Apartment or Free Threaded makes
> >> no great differences... and I dont know really the one I must use) and
> >> many datamodules with each one many ADOQueries. If only one client is
> >> connected it seems to work fine but if the number of clients grows,
> >> the server will crash more or less rapidly... I mean that all get
> >> stalled and no-one can anymore connect him to the application or works
> >> within it!
> >>     With a stresser application I see that it frozes on an
ADOQuery.Open.

> >     No ADOConnection.Open!

> > I saw also a montain of Acces Violations always read on

> >> the same addresses (on the adoquery.open)

> >     here, yes.

> >  that is not catch and makes no

> >> exceptions but that we see on the eventlog.

> >>     I tried many features (CoInit, CoUnInit, mutex, differents
> >> parameters, only one ADOConnection for the app, etc...) with no
> >> success...
> >>     The same application (with the same code) was working fine (and
> >> still do yet because ado dont) with the BDE.

> >>     Please, can you tell me a way to find out a solution, or post the
> >> code that workes great for you... or something else that would help me.
> >>     I'll really appreciate any kind of suggestions.

> >> Best regards,
> >> Michael
> >> [Tell me if it is a wrong newsgroup]

Re:multitreaded COMServer freeze after a while on an ADOQuery.open


        Yes a very bad copy-past!
But i was surprised that it was working far fine with one user but
"only" have strange trouble with many....

Thank you
Michael

Viatcheslav V. Vassiliev a crit:

Quote
> May be

>       if Self.Components[i].inheritsFrom(TAdoQuery)
>       then TAdoQuery(Self.Components[i]).EnableBCD := False;

> You check Self.Components[i] and then work with Self.Owner. But it is most
> probable is not TAdoQuery (of course if owner of your TDataModule is not
> TAdoQuery).

Other Threads