Consultor Eletrônico



Kbase 18993: Apptivity Delayed Construction DataSource May Hang On Create
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   23/05/2001
This document applies to: Apptivity Runtime and Developer
Version and Release Number: 3.1

SUMMARY:

When using delayed construction DataSources, a call to
abEnv.doDSCreate() can hang. This condition will occur after the
following sequence of events:

1) abEnv.doDSCreate() has been called more than once for a DataSource.

2) abDataSource.close() is called at least once, but a corresponding
call to abDataSource.close() has not been issued FOR EACH CALL to
abEnv.doDSCreate().

3) abEnv.doDSCreate() is called again.


EXPLANATION:

The reason the method abEnv.doDSCreate() hangs in this scenario is
that the server side reference count is increased with each call to
doDSCreate(), but the client side reference count is not increased
with each call. This means that after after multiple calls to
doDSCreate() (without a corresponding close() for each), the server
side reference count is greater than one, but the client side
reference count remains constant at one.

Each call to abDataSource.close() removes a reference to the
DataSource, and therefore decrements the reference count for that
DataSource. When the first call to close() is then issued, the client
side abDataSource object is destroyed, because its reference count has
become zero. The server side reference count, however, is still
greater than zero, so the query is not closed.

A subsequent call to the server to create the query will cause the
existing query's reference count to increase, but no NEW_QUERY message
will be issued to reconstruct the abDataSource object. The
doDSCreate() method will then hang, waiting for the DataSource object.


SOLUTION:

The workaround is to make sure that the server side reference count
for a DataSource does not become greater than one. This can be done by
checking for the existance of a DataSource before trying to create it,
as in the following code:

if (theApp().getDataSource("<dsname>") != null){
theApp().doDSCreate("<dsname>");
}

This has been logged as SCR 5931.