[Share] DB2 returns sqlcode-818 Error

Source: Internet
Author: User

The last time I started a DB2-Based Embedded C language project, it was a strange thing to share with you.

At that time, in order to maintain the integrity of the test data and the data consistency of developers, and to reduce the pressure on dbserver, we had to create a DB instance for every two people. This started with a nightmare ....

Each time the handler A compiles the program and starts to run it, the handler B of the same dB instance also starts to compile and run it. At this time, the handler A will report "sql0818n a timestamp conflict occurred.. So, a starts to re-compile, run, OK, and start testing. At this time, B will report the error just reported by .......

At that time, I was not familiar with the embedded development of DB2 because I was just familiar with its principles. I thought it was a problem with DB2 or a problem with the client. So I uninstalled quest central, reinstall DB2 ..... The problem has not been solved.

Later, I found out why by searching for information and summarizing it. Is the process of creating a package.

 
Because only segment entries are used to identify the context in the application, the modified source files and packages are closely linked together and must always point to the same context. This is done by embedding a consistency mark (token) in the modified source file, also known as "timestamp )", in addition, the same value is stored in the package information in DB2 UDB. Each request from the application carries this consistency flag. The passed value must be compared with the value in the catalog table. If the two values are different and the timestamp and consistency mark of the loaded module are different, a "timestamp" error (sqlcode-818) will occur ).

The reason is that, as described above, I hope it will be 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.