14.01.2020 Views

ABAP_to_the_Future

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Troubleshooting 14.4

send data from a shared memory object on one application server to its counterparts

on the other application servers, so a global invalidation ensures that the

shared memory always matches the database.

Having to reload the data on every application server may seem wasteful, but the

type of information you would want to pu t into shared memory is by definition

the type of information that would hardly ever get changed.

14.4 Troubleshooting

There are two very common problems that arise when working with shared

memory. This section explains how to fix both of them.

14.4.1 Data Inconsistency between Application Servers

If a database read on one application serverreturned a different result than a database

read on another application server, then no one would have faith in the computer

system anymore, and you would have a riot on your hands. With standard

SAP buffered tables, the runtime system ta kes care of making sure that the data

buffer is the same on all application se rvers. With shared memory, you have to

take care of this task yourself.

Section 14.3 talked about ho w to keep the shared memory area in line with the

database and mentioned the way that transactional areas handle this by affecting

all servers. However, many shared memory areas are not defined as transactional,

as they do not mirror an actual database table in its entirety. This section talks

about what to do when you do not have a transactional area.

In the following example, there is a shared memory area to buffer a subset of MARA

records. A user changes the material master record. Even if you have a routine in

a user exit that occurs on save of Transaction MM02 and you send out an invalidate

command, only the shared memory instance on the current application

server gets refreshed, because this is no t a transactional area. This means that if

you have six application servers, then only one has the current data in shared

memory, and the other five have incorrect data. That is a Bad Thing, because anything

reading the shared memory object on the other servers thereafter comes

back with the wrong result, which could have disastrous results.

649

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!