Class Edatabaseerror with message ' Invalid data packet '

Source: Internet
Author: User

Recently refactoring the code of a project, after refactoring, debugging will always occur to access database exceptions. The hint is ' Invalid data packet '.

At first, I thought it was a problem with the statement of the database operation, it is normal to put the corresponding exception statement into the SQL window of Oracle.

On the internet to find a lot of posts, have not found the answer. Later, according to the debugging problems, when a database operation exception, immediately after another database operation will be abnormal. And then in the place of the error in a number of consecutive breakpoints, debugging found that an interface has not run out and ran to execute another interface of the other statements back to continue the execution of the current interface. Then I realized that it was a multi-threaded mess.

Refactoring before the execution of the database is single-threaded, there is no such exception, after the refactoring has this exception, I have suspected multithreading problem. Only, the start of the database operation is multi-threaded, using the SendMessage method, but the initiating operation is to send the message to the main thread, the main thread unified operation. From this, it will feel that the operation of this database is not multithreaded. Behold, this is the SendMessage buried pit, although this message is sent to the main thread, but the initiating threads are also waiting for the message to execute, where debugging appears to be multithreaded.

Solution: In the need to initiate database operations in the method to use the on-line lock, to ensure that the database operation to initiate mutual exclusion, problem solving.

Class Edatabaseerror with message ' Invalid data packet '

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.