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: 

Shared Memory Objects: Automatic area build does not work for client-dependent area

daniel-hoehn
Explorer

Hi everyone,

I'm trying to build a shared memory buffer for client-dependent data: I implemented a shared-memory enabled root class. To support automatic area building I also implemented IF_SHM_BUILD_INSTANCE and the implementation works totally fine and creates an area instance that appears in SHMM and can be accessed from my coding once it is attached. But this works only if if_shm_build_instance~build is called manually in test mode. If I remove the area instance and try to "auto-create" the instance by calling the attach_for_read method I repeatedly get an cx_shm_no_active_version exception (even if a call attach_for_read in a loop to give it some time for the initialization). If I change the area to "client-independent" the auto build works fine - but it only buffers the data for the client that initiates auto build. Area Build Type is set to "Autostart for Read Request and Every Invalidation".

Any Ideas? Am I missing anything here or is it a (known) bug?

Best Regards,

Daniel

2 REPLIES 2

taryckbensaili
Participant

Hi,

I can't get IF_SHM_BUILD_INSTANCE~build works. So if you've got example I'll be glade.

Iget cx_shm_no_active_version text: build_not_finished

all the time...

manfredsprenger
Discoverer
0 Kudos

Hallo Daniel,

please try it in a way 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.


With a "wait to 1 seconds" and a second "attach_for_read" it should work.


Best regards

Manfred