Have a Question?
Print

01045: Information about pinning programs in BBj

Title:

Information about pinning programs in BBj

Description:

Here’s some additional information about PINNING programs in BBj that may help to clarify why you would or would not want to do it: 
Pinning programs affects whether saved changes from the current interpreter session will be available to other interpreter sessions.

When pinning is turned off, all saved changes are immediately available to any interpreter session.  New interpreter sessions always load the most current copy of the program from disk but running interpreter sessions need to re”LOAD” the program to see the changes.

When pinning is turned on, new interpreter sessions initially load the most current copy from disk but then keep that copy cached and do not see any subsequent changes to the program even if the program is “LOAD”ed again.

When BBj opens a file it must search the prefix path to find the correct file. If you do not have pinned programs turned on then it will do this search every time that you open a file. If someone else has added a file with the same name into a directory that is earlier in your prefix than the file that you found the first time you did the open you need to find the new file. 

Once BBj determines the correct file (i.e. the complete path for the file that should be opened) it will check to see if the file exists in the program cache. If it finds the program in cache it must still do a check of the last modified time of the on-disk version to see if it matches the in-memory version. 

Both of these checks are expensive timewise. Especially the check of prefixes can take a very long time. 

If you have program pinning turned on then instead of doing these checks BBj will maintain a map of resolvedProgramNames. When you load a program, it will check to see if it has previously used that same name to load a program. If so, it will skip the prefix search. If it finds the program in cache it will also skip the time comparison. If you have not already used that name to load a program then it will still have to resolve the name to a complete path. But if it finds a program in cache with the resolved path name it will not do a date check. 

When you do CHDIR the list of resolvedProgramNames (which is specific to a BBj session) is cleared. So the next time you load a program BBj will search through your prefixes to find the correct full path name even if programs are pinned. 

“Pin Programs and Resources” allows the server to cache programs and resources server-wide. 

“Pin by BBj Session” checkbox just determines whether those programs and resources are pinned for the entire length of an individual session or not. 

Sessions can individually unpin with BBjAPI().getConfig().unpinSessionEntity(prog_or_resource$), which unpins a specific program/resource or unpinSession(), which unpins everything in the session. 

NOTE:  Starting with BBJ 20.20 and the Class Loader re-design, regardless of pinning settings the BBj Custom Objects (including the methods) will not be regenerated until you are in a new BBj session.

These settings are found in EM under BBjServices > Settings > Thin Client Performance.

Table of Contents
Scroll to Top