Document Type | Troubleshooting
Category | Administration
Applicable Product Version | 6FS07
Document Number | TADTS049
Issue
The following error occurs when calling a package, causing the execution to stop.
THROW. ec=ERROR_PKG_INSTANCE_INVALID(-14004) [ Package instance 'PA_SF_SBSN_TR_SFWWORKMT' is invalid.]
Cause
When using a package, the package is instantiated and stored in each session.
Even if the package is changed through DDL in another session afterwards, the changes are not immediately reflected in the existing sessions after the DDL completes. (lazy flush)
Therefore, when the package is called in another session, the package instance is stored in the session as the old version, so it must be instantiated again with the newly changed package.
This is because Tibero does not immediately update the instance in new sessions when the package changes.
If a mismatch occurs between the package (pkg) and the package instance (pkg instance) at the time of the call, Tibero flushes only the current session's package and then returns an error (-14004).
Solutions
You can change the error handling method by adjusting the parameter _PSM_NO_PKG_INVAL_ERROR.
Setting the value of _PSM_NO_PKG_INVAL_ERROR to Y allows the package to be instantiated and immediately recreated for normal execution.
_PSM_NO_PKG_INVAL_ERROR = Y
- When a mismatch between the package (pkg) and package instance (pkg instance) occurs during a package call, the package instance is immediately recreated and executed without error, ensuring transaction integrity.
_PSM_NO_PKG_INVAL_ERROR = N (Default)
- If a mismatch is detected during a package call, error 14004 occurs.
- Upon calling again, the package is newly instantiated and executes normally.