Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Concurrency

6 posts in AEP Last posting was on 2007-11-12 23:09:12.0Z
T Staples Posted on 2007-10-25 10:48:33.0Z
From: "T Staples" <timstaples@onetel.com>
Newsgroups: advantage.AEP
Subject: Concurrency
Date: Thu, 25 Oct 2007 11:48:33 +0100
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 213.78.51.55
Message-ID: <4720738a@solutions.advantagedatabase.com>
X-Trace: 25 Oct 2007 04:44:26 -0700, 213.78.51.55
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!213.78.51.55
Xref: solutions.advantagedatabase.com Advantage.AEP:595
Article PK: 1103873

Hi, any assistance would be greatly appreciated.

I have an application on a Web Server that calls an AEP on the Advantage
Server via an Execute Procedure call.

This works very well, and the AEP produces a report, the average execution
time being in the region of 15 - 45 seconds.

The problem is that it seems that only one instance of the AEP can run at
any time - I get the 5154 error message that the Startup Routine failed when
other calls are made to the AEP whilst the first is still running.

In the context of this application, a connection is established, a single
call to the AEP is made, the AEP completes processing and returns a result,
the connection is closed, and the calling application closes. In the
meantime a separate instance of the calling application may make another
call to the AEP, establishing it's own connection.

In this situation we see a big advantage in having (distributed) processing
being handled at the Advantage server due to the huge
lookup overhead and processing required, even though we are using the AEP in
an "open->one-call->close" manner.

My question is, why is a second instance of the AEP not able to run?
Tim Staples


Jeremy Mullin Posted on 2007-10-26 20:01:15.0Z
Date: Fri, 26 Oct 2007 20:01:15 +0000 (UTC)
Message-ID: <e96e9af234ca48c9e5efcf0d4651@devzone.advantagedatabase.com>
From: Jeremy Mullin <no@email.com>
Subject: Re: Concurrency
Newsgroups: Advantage.AEP
References: <4720738a@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 1098.1
NNTP-Posting-Host: 10.24.38.114
X-Trace: 26 Oct 2007 13:57:08 -0700, 10.24.38.114
Lines: 45
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.114
Xref: solutions.advantagedatabase.com Advantage.AEP:596
Article PK: 1103874

Hi Tim,

What language is the AEP written in?

Did you add any code to the startup function?

Are you using any global objects in your procedure, as opposed to session
specific objects? For example, are you using a global instance of a report
generator, rather than creating one inside the startup function and being
sure to use the same one inside your aep function?

J.D. Mullin
Advantage R&D

> Hi, any assistance would be greatly appreciated.
>
> I have an application on a Web Server that calls an AEP on the
> Advantage Server via an Execute Procedure call.
>
> This works very well, and the AEP produces a report, the average
> execution time being in the region of 15 - 45 seconds.
>
> The problem is that it seems that only one instance of the AEP can run
> at any time - I get the 5154 error message that the Startup Routine
> failed when other calls are made to the AEP whilst the first is still
> running.
>
> In the context of this application, a connection is established, a
> single call to the AEP is made, the AEP completes processing and
> returns a result, the connection is closed, and the calling
> application closes. In the meantime a separate instance of the
> calling application may make another call to the AEP, establishing
> it's own connection.
>
> In this situation we see a big advantage in having (distributed)
> processing
> being handled at the Advantage server due to the huge
> lookup overhead and processing required, even though we are using the
> AEP in
> an "open->one-call->close" manner.
> My question is, why is a second instance of the AEP not able to run?
> Tim Staples
>


T Staples Posted on 2007-10-29 12:09:07.0Z
From: "T Staples" <timstaples@onetel.com>
Newsgroups: Advantage.AEP
References: <4720738a@solutions.advantagedatabase.com> <e96e9af234ca48c9e5efcf0d4651@devzone.advantagedatabase.com>
Subject: Re: Concurrency
Date: Mon, 29 Oct 2007 12:09:07 -0000
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 213.78.51.55
Message-ID: <4725cc1a@solutions.advantagedatabase.com>
X-Trace: 29 Oct 2007 06:03:38 -0700, 213.78.51.55
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!213.78.51.55
Xref: solutions.advantagedatabase.com Advantage.AEP:597
Article PK: 1103878

Hi Jeremy

Many thanks for the reply - I am not very familiar with forum usage and so
never noticed the reply immediately. Your questions have certainly got me
thinking.

The AEP is written in Delphi 2006. No, I added no code to the startup
function. I see the Data Module is instantiated in the startup function and
the handle set for the connection. In my aep function I read incoming
params and set return params at the end very much per the provided template
application, but all of my report code is in the Data Module in a series of
procedures which are called from the aforementioned function. I basically
write the report to a temporary table and pass back a 'Success' string as
applicable.

My instinct tells me that this application could run fine as multiple
instances of an EXE, so I am sure I am missing a fundamental concept in the
way AEP's work and have made a basic error in the way I have implemented. I
think I have answered your question in that the DM is created in Startup,
and then used in my function, and I don't think I am using any global
objects.

TIA
Tim

"Jeremy Mullin" <no@email.com> wrote in message
news:e96e9af234ca48c9e5efcf0d4651@devzone.advantagedatabase.com...
> Hi Tim,
>
> What language is the AEP written in?
>
> Did you add any code to the startup function?
>
> Are you using any global objects in your procedure, as opposed to session
> specific objects? For example, are you using a global instance of a report
> generator, rather than creating one inside the startup function and being
> sure to use the same one inside your aep function?
>
> J.D. Mullin
> Advantage R&D
>
>> Hi, any assistance would be greatly appreciated.
>>
>> I have an application on a Web Server that calls an AEP on the
>> Advantage Server via an Execute Procedure call.
>>
>> This works very well, and the AEP produces a report, the average
>> execution time being in the region of 15 - 45 seconds.
>>
>> The problem is that it seems that only one instance of the AEP can run
>> at any time - I get the 5154 error message that the Startup Routine
>> failed when other calls are made to the AEP whilst the first is still
>> running.
>>
>> In the context of this application, a connection is established, a
>> single call to the AEP is made, the AEP completes processing and
>> returns a result, the connection is closed, and the calling
>> application closes. In the meantime a separate instance of the
>> calling application may make another call to the AEP, establishing
>> it's own connection.
>>
>> In this situation we see a big advantage in having (distributed)
>> processing
>> being handled at the Advantage server due to the huge
>> lookup overhead and processing required, even though we are using the
>> AEP in
>> an "open->one-call->close" manner.
>> My question is, why is a second instance of the AEP not able to run?
>> Tim Staples
>>
>
>


Jeremy Mullin Posted on 2007-11-01 21:08:18.0Z
Date: Thu, 1 Nov 2007 21:08:18 +0000 (UTC)
Message-ID: <e96e9af234f948c9eab02b368785@devzone.advantagedatabase.com>
From: Jeremy Mullin <no@email.com>
Subject: Re: Concurrency
Newsgroups: Advantage.AEP
References: <4725cc1a@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 1098.1
NNTP-Posting-Host: 10.24.38.114
X-Trace: 1 Nov 2007 15:04:46 -0700, 10.24.38.114
Lines: 88
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.114
Xref: solutions.advantagedatabase.com Advantage.AEP:598
Article PK: 1103880

I would be interesed in seeing your procedure code (including the data module).
If you feel like sending it in send it to advantage@ianywhere.com, attn: JD.

My gutt feel, however, is that your report generator is probably the thing
that is causing processing to be serialized. One easy way to check this
is to remove your calls to generate the report, and replace them with some
long sleep calls. Then run your test and see if you get concurrent access
with multiple clients.

My guess is you will. You'll need to verify the reporting tool can be run
concurrently, and doesn't have some factor that limits the engine to processing
one thread at a time.

J.D. Mullin
Advantage R&D

> Hi Jeremy
>
> Many thanks for the reply - I am not very familiar with forum usage
> and so never noticed the reply immediately. Your questions have
> certainly got me thinking.
>
> The AEP is written in Delphi 2006. No, I added no code to the startup
> function. I see the Data Module is instantiated in the startup
> function and the handle set for the connection. In my aep function I
> read incoming params and set return params at the end very much per
> the provided template application, but all of my report code is in the
> Data Module in a series of procedures which are called from the
> aforementioned function. I basically write the report to a temporary
> table and pass back a 'Success' string as applicable.
>
> My instinct tells me that this application could run fine as multiple
> instances of an EXE, so I am sure I am missing a fundamental concept
> in the way AEP's work and have made a basic error in the way I have
> implemented. I think I have answered your question in that the DM is
> created in Startup, and then used in my function, and I don't think I
> am using any global objects.
>
> TIA
> Tim
> "Jeremy Mullin" <no@email.com> wrote in message
> news:e96e9af234ca48c9e5efcf0d4651@devzone.advantagedatabase.com...
>
>> Hi Tim,
>>
>> What language is the AEP written in?
>>
>> Did you add any code to the startup function?
>>
>> Are you using any global objects in your procedure, as opposed to
>> session specific objects? For example, are you using a global
>> instance of a report generator, rather than creating one inside the
>> startup function and being sure to use the same one inside your aep
>> function?
>>
>> J.D. Mullin
>> Advantage R&D
>>> Hi, any assistance would be greatly appreciated.
>>>
>>> I have an application on a Web Server that calls an AEP on the
>>> Advantage Server via an Execute Procedure call.
>>>
>>> This works very well, and the AEP produces a report, the average
>>> execution time being in the region of 15 - 45 seconds.
>>>
>>> The problem is that it seems that only one instance of the AEP can
>>> run at any time - I get the 5154 error message that the Startup
>>> Routine failed when other calls are made to the AEP whilst the first
>>> is still running.
>>>
>>> In the context of this application, a connection is established, a
>>> single call to the AEP is made, the AEP completes processing and
>>> returns a result, the connection is closed, and the calling
>>> application closes. In the meantime a separate instance of the
>>> calling application may make another call to the AEP, establishing
>>> it's own connection.
>>>
>>> In this situation we see a big advantage in having (distributed)
>>> processing
>>> being handled at the Advantage server due to the huge
>>> lookup overhead and processing required, even though we are using
>>> the
>>> AEP in
>>> an "open->one-call->close" manner.
>>> My question is, why is a second instance of the AEP not able to run?
>>> Tim Staples


T Staples Posted on 2007-11-09 08:14:06.0Z
From: "T Staples" <timstaples@onetel.com>
Newsgroups: advantage.AEP
References: <4725cc1a@solutions.advantagedatabase.com> <e96e9af234f948c9eab02b368785@devzone.advantagedatabase.com>
Subject: Re: Concurrency
Date: Fri, 9 Nov 2007 08:14:06 -0000
Lines: 127
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 213.78.51.55
Message-ID: <47341596@solutions.advantagedatabase.com>
X-Trace: 9 Nov 2007 01:08:54 -0700, 213.78.51.55
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!213.78.51.55
Xref: solutions.advantagedatabase.com Advantage.AEP:599
Article PK: 1103881

Removing the call to my report code and using long sleep calls was not
sufficient to enable concurrent access. But when I replaced my DM with the
blank template DM which has an Input and Output table and a Data connection
on it, then 2 instances would run no problem.

There are 2 confusing and somewhat contradictory entries in the Advantage
8.0 documentation under "AEP's Tips & Tricks - Do's and Don'ts" regarding
connections and aliases, and my suspicions were with connections so I added
a single AdsQuery component back to the template DM specifying an Alias as
the DatabaseName. Even though this alias resolves using a UNC path in
Ads.ini, when I attempted a simple lookup (on a AdsCdx table), it would not
run concurrently. The minute I pointed the AdsQuery to DataConn and not an
alias, it worked fine. I also noticed that the mere presence of an
AdsSettings component on the DM seemed to prevent concurrency.

I reverted to my DM with it's approx. 1200 lines of code and changed all the
DatabaseName properties to DataConn (and removed AdsSettings) and all is now
working perfectly.

Thanks Jeremy for your assistance. You may like to follow up with a final
post to comment on my experiences and hopefully this topic will prove
helpful to others. The Do and Don't entries in question are copied in below
for reference.
Tim

DO - Use UNC (\\SERVERNAME\SHARE) when making connections or opening tables
from inside an AEP. Also use UNC for any TDataSet aliases that are used from
inside an AEP. Failure to do so may result in 7077 and 7008 errors.

DON'T - If writing an AEP using the Advantage TDataSet Descendant, always
use a TAdsConnection component. Do not open tables without first pointing
them to a TAdsConnection component.

"Jeremy Mullin" <no@email.com> wrote in message
news:e96e9af234f948c9eab02b368785@devzone.advantagedatabase.com...
>I would be interesed in seeing your procedure code (including the data
>module). If you feel like sending it in send it to advantage@ianywhere.com,
>attn: JD.
>
> My gutt feel, however, is that your report generator is probably the thing
> that is causing processing to be serialized. One easy way to check this
> is to remove your calls to generate the report, and replace them with some
> long sleep calls. Then run your test and see if you get concurrent access
> with multiple clients.
>
> My guess is you will. You'll need to verify the reporting tool can be run
> concurrently, and doesn't have some factor that limits the engine to
> processing one thread at a time.
>
> J.D. Mullin
> Advantage R&D
>
>> Hi Jeremy
>>
>> Many thanks for the reply - I am not very familiar with forum usage
>> and so never noticed the reply immediately. Your questions have
>> certainly got me thinking.
>>
>> The AEP is written in Delphi 2006. No, I added no code to the startup
>> function. I see the Data Module is instantiated in the startup
>> function and the handle set for the connection. In my aep function I
>> read incoming params and set return params at the end very much per
>> the provided template application, but all of my report code is in the
>> Data Module in a series of procedures which are called from the
>> aforementioned function. I basically write the report to a temporary
>> table and pass back a 'Success' string as applicable.
>>
>> My instinct tells me that this application could run fine as multiple
>> instances of an EXE, so I am sure I am missing a fundamental concept
>> in the way AEP's work and have made a basic error in the way I have
>> implemented. I think I have answered your question in that the DM is
>> created in Startup, and then used in my function, and I don't think I
>> am using any global objects.
>>
>> TIA
>> Tim
>> "Jeremy Mullin" <no@email.com> wrote in message
>> news:e96e9af234ca48c9e5efcf0d4651@devzone.advantagedatabase.com...
>>
>>> Hi Tim,
>>>
>>> What language is the AEP written in?
>>>
>>> Did you add any code to the startup function?
>>>
>>> Are you using any global objects in your procedure, as opposed to
>>> session specific objects? For example, are you using a global
>>> instance of a report generator, rather than creating one inside the
>>> startup function and being sure to use the same one inside your aep
>>> function?
>>>
>>> J.D. Mullin
>>> Advantage R&D
>>>> Hi, any assistance would be greatly appreciated.
>>>>
>>>> I have an application on a Web Server that calls an AEP on the
>>>> Advantage Server via an Execute Procedure call.
>>>>
>>>> This works very well, and the AEP produces a report, the average
>>>> execution time being in the region of 15 - 45 seconds.
>>>>
>>>> The problem is that it seems that only one instance of the AEP can
>>>> run at any time - I get the 5154 error message that the Startup
>>>> Routine failed when other calls are made to the AEP whilst the first
>>>> is still running.
>>>>
>>>> In the context of this application, a connection is established, a
>>>> single call to the AEP is made, the AEP completes processing and
>>>> returns a result, the connection is closed, and the calling
>>>> application closes. In the meantime a separate instance of the
>>>> calling application may make another call to the AEP, establishing
>>>> it's own connection.
>>>>
>>>> In this situation we see a big advantage in having (distributed)
>>>> processing
>>>> being handled at the Advantage server due to the huge
>>>> lookup overhead and processing required, even though we are using
>>>> the
>>>> AEP in
>>>> an "open->one-call->close" manner.
>>>> My question is, why is a second instance of the AEP not able to run?
>>>> Tim Staples
>
>


Jeremy Mullin Posted on 2007-11-12 23:09:12.0Z
Date: Mon, 12 Nov 2007 23:09:12 +0000 (UTC)
Message-ID: <1b468bc82d4a38c9f35d7fb5f5ae@devzone.advantagedatabase.com>
From: Jeremy Mullin <no@email.com>
Subject: Re: Concurrency
Newsgroups: Advantage.AEP
References: <47341596@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 1098.1
NNTP-Posting-Host: 10.24.38.114
X-Trace: 12 Nov 2007 16:03:55 -0700, 10.24.38.114
Lines: 17
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.114
Xref: solutions.advantagedatabase.com Advantage.AEP:600
Article PK: 1103883

Tim, glad to hear you got it working.

> DON'T - If writing an AEP using the Advantage TDataSet Descendant,
> always use a TAdsConnection component. Do not open tables without
> first pointing them to a TAdsConnection component.

I think you were doing this. You were assigning a path to the databasename
property of the TAdsQuery, instead of pointing it at the AdsConnection object,
correct? That makes the TDataSet Descendant use an internal connection pool,
instead of your dm-specific connection. That explains the serialization you
were seeing. All threads were sharing a single connection from the internal
TDataSet connection pool.

J.D. Mullin
Advantage R&D