DB2 return SQLCODE-818 Error

Source: Internet
Author: User
Tags db2

In the embedded C language project based on DB2, there is a very strange thing to share with you.

In order to maintain the integrity of the test data and developer data consistency, but also in order to reduce the pressure of dbserver, so for each two people do a db instance nightmare begins.

Whenever the performer a compiles a program, and then starts running, the same DB instance's performer B begins to compile and runs, at which time the performer a will report "sql0818n a timestamp conflict occurred." Mistakes like that. So, a begins to recompile, run, OK, start testing, and at this point B will report a report of the error just a.

At that time, due to just contact DB2, its embedded development is not familiar with its principle, I think it is DB2 or client out of the problem, so, uninstall Quest, reinstall DB2. has not solved the problem.

Later, by looking for information, summed up, finally find out why. The following figure is the process of creating a package.

Because only paragraph entries are used to identify the context in the application, the modified source files and packages are tightly linked and must be guaranteed to always point to the same context. This is done by embedding a consistency flag (token) in the modified source file, also known as a timestamp (timestamp), and storing the same value in the package information within the DB2 UDB. Each request from the application has this consistency flag, and the passed-in value is compared to the value in the Catalog table. If the two values are different and the timestamp of the loaded module is not the same as the consistency flag, a "timestamp" error (SQLCODE-818) occurs.

The reason is that, as mentioned above, hope is useful to you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.