Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Exception CX_SHM_NO_ACTIVE_VERSION on first access of auto-created area

Former Member

I am using a shared memory area that is set to auto-create and is client-specific. (I followed the guide by ).

When testing accessing the area, the first access to the memory area, before it has been initialized, terminates with the exception CX_SHM_NO_ACTIVE_VERSION and the following message:

The lock on the instance '$DEFAULT_INSTANCE$' in client '305' of the area 'ZCL_DACS_SALAPPT_SHM' cannot be set because no active version exists. However, the area constructor was started to automatically build the area instance.

Because the area build was started, the next access is successful.

I see that a similar problem was experienced by someone else when the area is client-specific:

It's only a problem if the first access is done by a user in a productive environment as it will lead to an error, but this is obviously something we want to avoid.

Any hints for a workaround?

2 REPLIES 2

S0004562014
Explorer

Hi Martin

I call the build method own my own:

    zcl_shmo_area=>build( ).

Don't know if this causes any sideeffects, but as far as I can see it works fine.

BR

Hubertus

manfredsprenger
Discoverer
0 Kudos

Hello Martin,

i had a similar problem, solved it like this:

try.
     GR_SHM = ZFLIGHTS=>ATTACH_FOR_READ( ).
   catch CX_SHM_NO_ACTIVE_VERSION.
     wait up to 1 seconds.
     GR_SHM = ZFLIGHTS=>ATTACH_FOR_READ( ).
endtry.


Best regards

Manfred