Article

Error 12164 from Statement Caching when accessing another user's cache

« Go Back

Information

 
Article Number000040544
EnvironmentProduct: OpenEdge
Version: 10.1C, 10.2B, 11.x
OS: All Supported Platforms
Other: RDBMS
Question/Problem Description

An error 12164 occurs when Client Database Request Statement Caching has been enabled for another Linux user and a query is done on the table _Connect or _MyConnection.
 
Steps to Reproduce- Create a program named LongCallStack.p with the code below
- Create a file called connectedUsers.p with the code below
- On the Linux machine with OpenEdge installed follow the below steps:

1) In the Gnome GUI of CentOS or Red Hat go to System -> Administration -> Users and Groups -> Add User and create 2 new Linux users for example john and mike

2) In the Gnome GUI of CentOS6 go to System Tools -> Terminal and open 2 additional tabs with Shift+Ctrl+T

3) In the first tab run <path_to_dlc>/bin/proenv

4) From proenv:

proenv>mkdir testdb
proenv>cd testdb
proenv>prodb testdb
proenv>proserve testdb

5) In the second tab do:

$$>su john
$$><path-to-dlc>/bin/proenv
proenv>cd ~
proenv>mpro testdb/testdb

6) Go back to the first tab and do:

proenv>promon testdb

7) Select R&D -> 1 -> 18 -> 1 -> 2 and select the Usr number of the user john then select P

8) Go back to the second tab open LongCallStack.p in the editor and run it

9) Go to the third tab and do:

$$>su mike
$$><path_to_dlc>/bin/proenv
proenv>cd ~
proenv>mpro testdb/testdb

10) Open connectedUsers.p in the editor and run it

An error similar to the below will now appear:
An error 13 occurred while attempting to open the (-o) output file
/home/john/usr~102b~wrk~testdb~testdb.2595.5.cst. The operation cannot continue. (12164)
Clarifying Information
/* LongCallStack.p */
DEFINE VARIABLE vCallStackLevel AS INTEGER     NO-UNDO.
DEFINE VARIABLE vCallStackSize  AS INTEGER     NO-UNDO.
ASSIGN vCallStackLevel = 0
       vCallStackSize  = 0
. /* ASSIGN */
REPEAT:
  ASSIGN vCallStackLevel = vCallStackLevel + 1.
  IF PROGRAM-NAME(vCallStackLevel) EQ ? THEN
  LEAVE.
  ASSIGN vCallStackSize = 
         vCallStackSize + LENGTH(PROGRAM-NAME(vCallStackLevel)).
END.

IF vCallStackSize LT 500 THEN
RUN VALUE(PROGRAM-NAME(1)).
ELSE
FOR FIRST _MyConnection:
  MESSAGE
    "_MyConn-UserId:" _MyConnection._MyConn-UserId SKIP
    "   _MyConn-Pid:" _MyConnection._MyConn-Pid    SKIP
    "         Useid:" USERID("DICTDB")             SKIP
    "CallStackLevel:" vCallStackLevel              SKIP
    " CallStackSize:" vCallStackSize
    VIEW-AS ALERT-BOX INFO BUTTONS OK.
  RETURN.
END.
/* connectedUsers.p */
DEFINE VAR  N AS INTEGER INITIAL 0 NO-UNDO.

FOR EACH _connect WHERE _connect-type = "SELF" OR _connect-type= "REMC" NO-LOCK :
      DISPLAY _connect-usr _connect-name _connect-device _connect-type.
      N=N + 1.
END.

DISPLAY "Total # of connections: " N.

Also when running the script generate_STCA_wait_entries.sh containing:

gnome-terminal --tab -e "sudo su - mike -c '/usr/102b/dlc/bin/mpro /usr/102b/wrk/testdb/testdb -p connectedUsers.txt'" --tab -e "sudo su - john -c '/usr/102b/dlc/bin/mpro /usr/102b/wrk/testdb/testdb -p connectedUsers.txt'" --tab -e "sudo su - mike -c '/usr/102b/dlc/bin/mpro /usr/102b/wrk/testdb/testdb -p connectedUsers.txt'" --tab -e "sudo su - john -c '/usr/102b/dlc/bin/mpro /usr/102b/wrk/testdb/testdb -p connectedUsers.txt'"

The 4 new 4GL database connections will be put in STCA wait as can be seen with the command:
promon testdb
with the options:
    1.  User Control
    1.  Display all entries

The output of the promon command will look similar to this: 

User Control:
  Usr Name     Type      Wait  Table               Dbkey     Trans      PID Sem Srv Login  Time    IPV# Remote Address
    0 progress BROK       --      0                    0         0     6854   0   0 06/07/13 14:07  
    5 mike     SELF/ABL   --      0                    0         0     6945   2   0 06/07/13 14:09  
    6 john     SELF/ABL   --      0                    0         0     6956   3   0 06/07/13 14:09  
    7 progress MON        --      0                    0         0     6972   3   0 06/07/13 14:10  
    8 progress MON        --      0                    0         0     7006   4   0 06/07/13 14:11  
    9 mike     SELF/ABL  STCA     0                    0         0     7035   4   0 06/07/13 14:12  
   10 john     SELF/ABL  STCA     0                    0         0     7036   5   0 06/07/13 14:12  
   11 mike     SELF/ABL  STCA     0                    0         0     7038   5   0 06/07/13 14:12  
   12 john     SELF/ABL  STCA     0                    0         0     7039   6   0 06/07/13 14:12  
 
Error MessageAn error <num> occurred while attempting to open the (-o) output file <filename>. The operation cannot continue. (12164)
Defect/Enhancement Number
Cause
When a client session is started in the home directory of a Linux user and this session has Client Database Request Statement Caching enabled, when the cache exceeds 255 characters, the .cst file is created in the working directory of this user's session.

When another user is then doing a query on the table  _Connect or _MyConnection, that user then get a Linux permission error on the .cst file located in the home directory of the user who has Client Database Request Statement Caching enabled. 

This is expected behavior.  When one user attempts to access the second user's working directory and permissions on the folder prevent access from other users, the error occurs indicating that user2 doesn't have access to the folder.
 
Resolution
Use one of the below solutions:
  1. Change the default permission of the home directory of the user who has Client Database Request Statement Caching enabled from drwx------ to drwxr-xr-x (755) or drwx---r-x (705).
  2.  Make sure all the users belongs to the same group as the user who has Client Database Request Statement Caching enabled. So that permission on the home directory can remain drwx------ (700).
  3.  Specify the directory where all temporary Database Request Statement Cache files (*.cst) can be stored using Promon as mentioned below. And make sure all users have appropriate permission to that temporary directory.
  • Promon <dbname> 
  •  R&D.  Advanced options
  •  Option 1. Status Displays
  •  Option 18. Client Database-Request Statement Cache
  •  Option 8. Specify Directory for Statement Cache Files
Workaround
Notes
Attachment 
Last Modified Date4/13/2018 1:28 PM


Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025