Attached Buffer(LAB) vs Buffer Pool(LPB)

Hi,

I am Junior Developer new with Adabas and Natural.

I created a Program in Natural for Windows to read from the DB Demo and set up LAB(Attached Buffer, NUC Parameter) on 50M. When I try several times, LAB reach its limit and an error is thrown. The buffer pool in the other hand doesn’t seems to change at all.

I used:
$ adaopr
$ db=12
$ di=high_water

My understanding of a Buffer Pool is that it’s used to add the data from disk to memory each time there is a new call to DB (if the data is not already in the buffer pool), so every change or future retrieval can be speed up. If the Buffer Pool reach full size, there could be a flush buffer and the data is persisted on DB releasing space, so the latest files can be added into the buffer pool.

I can see that the attached buffer is acting like the buffer pool (following my understanding) however I don’t understand why the data is not in the buffer pool. Or how can I flush the attached buffer, so, I can continue using my program.

I am searching around the documentation but doesn’t seems to be a proper definition of the Attached Buffer or how to flush it. Or if I can redirect the data to be add it into the pool buffer.

Thanks in advance for your help.

Andres

PD (Sorry I am trying to move it to the Adabas Open Systems Forum)

If you could post the Natural program you are executing and what the output and error message is, we could probably help a bit more.

The Attached Buffers are used for interregion communication - they are usually in use for the duration of the message being sent to Adabas and the response returned. If you exhaust these buffers, you will get an Adabas Response code 255, reason code 1.

The Buffer Pool is a different area of memory that is used as you mention - to cache data read from the disk in memory. How much of the BP is used will depend on what your program(s) are reading from the disk. An application program cannot “flush the buffer pool” directly.

The demo database used to be quite small and would fit within a 50MB buffer pool with room to spare. I haven’t checked the size of it lately, but doubt that flushing the buffer pool will have any benefit to your program.

My guess is that there is something you are doing in your application program, perhaps due to a misunderstanding of how Natural should be coded, that is causing whatever error code you are encountering.

Hi Douglas,

Just to confirm, is the Attached Buffer(LAB) used only during the communication between Adabas and Natural? or is it used to temporarily store the data that is being read from disk, and then this data on the LAB is both return to Natural and cached in the Buffer Pool?.

I ask because it looks like the data was being keep in the LAB. So, each time there was a call to read from Adabas, the data was placed again on the LAB. So its size was increasing more and more and that is why it was reaching the limit.

Best regards and thank you for your help.

Andres

PD:
I could not reproduce the error, so I don’t know if the data was on the Buffer Pool too.

It looks like there was a configuration issue. I was using Adabas 6.4, however, yesterday I installed Adabas 6.3 and ran the program again. I could see how the data was cached on the Buffer Pool(just once as it should be). And the Attached Buffer was not increasing with each call.

The Code was


DEFINE DATA
GLOBAL USING GDA01
LOCAL USING LDA01
END-DEFINE
*
RP1. REPEAT
*
  INPUT USING MAP 'MAP01'
*    
  IF #NAME-START = '.' THEN
    ESCAPE BOTTOM (RP1.)
  END-IF
*  
  IF #NAME-END = ' ' THEN
    MOVE #NAME-START TO #NAME-END
  END-IF  
*    
  RD1. READ EMPLOYEES-VIEW BY NAME
    STARTING FROM #NAME-START
    ENDING AT #NAME-END
*
    IF LEAVE-DUE >=20 THEN
     PERFORM MARK-SPECIAL-EMPLOYEES
    ELSE
     RESET #MARK
    END-IF
*
    RESET #MAKE #MODEL
    CALLNAT 'SPGM01' PERSONNEL-ID #MAKE #MODEL    
*
    WRITE TITLE
     / '*** PERSONS WITH 20 OR MORE DAYS LEAVE DUE ***'
     / '*** ARE MARKED WITH AN ASTERISK            ***' //
*   
    DISPLAY 1X '//N A M E' FULL-NAME
            1X '//DEPT'    DEPT
            1X '/LV/DUE'   LEAVE-DUE
               ' '         #MARK
            1X '//MAKE'    #MAKE
            1X '//MODEL'   #MODEL
*
  END-READ
*
  IF *COUNTER (RD1.) = 0 THEN
    REINPUT 'No employees meet your criteria.'
  END-IF
*  
END-REPEAT
*
END

I did not include the MAP, Local and Global Data Areas or Sub-Routines or Sub-Programs, since the error was present even in the first steps of the tutorial.

Your READ statement will be translated by the compiler into a call to Adabas. The call will pass a handful of parameter blocks specifying which data to retrieve. Upon return from Adabas, the Record Buffer contains the values for the fields listed in your Employees view.

Adabas receives the parameter blocks in its Attached Buffers and places the retrieved values there. To populate the Record Buffer, Adabas reads a data block into its Buffer Pool.

The Buffer Pool is used to reduce I/O to the physical storage device. The Attached Buffers are used for communication with the calling program. Both contain your data, but in different forms.

I got it now. Thank you very much to both.

Best Regards,

Andres