Consistency token

 

The program and its associated SQL package contain a consistency token that is checked when a call is made to the SQL package.

The consistency tokens must match; otherwise, the package cannot be used. It is possible for the program and SQL package to appear to be uncoordinated. Assume that the program and the application server are on two distinct i5/OS® operating systems. The program is running in session A and it is re-created in session B (where the SQL package is also re-created). The next call to the program in session A might cause a consistency token error. To avoid locating the SQL package on each call, SQL maintains a list of addresses for SQL packages that are used by each session. When session B re-creates the SQL package, the old SQL package is moved to the QRPLOBJ library. The address to the SQL package in session A is still valid. You can avoid this situation by creating the program and SQL package from the session that is running the program, or by submitting a remote command to delete the old SQL package before creating the program.

To use the new SQL package, you should end the connection with the remote system. You can either sign off the session and then sign on again, or you can use the interactive SQL (STRSQL) command to issue a DISCONNECT for unprotected network connections or a RELEASE followed by a COMMIT for protected connections. RCLDDMCNV should then be used to end the network connections. Call the program again.

 

Parent topic:

Considerations for creating an SQL package