CN101425070A - Deadlock positioning method, deadlock positioning device and data system - Google Patents

Deadlock positioning method, deadlock positioning device and data system Download PDF

Info

Publication number
CN101425070A
CN101425070A CNA2008101457076A CN200810145707A CN101425070A CN 101425070 A CN101425070 A CN 101425070A CN A2008101457076 A CNA2008101457076 A CN A2008101457076A CN 200810145707 A CN200810145707 A CN 200810145707A CN 101425070 A CN101425070 A CN 101425070A
Authority
CN
China
Prior art keywords
affairs
deadlock
sacrificed
data
tables
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA2008101457076A
Other languages
Chinese (zh)
Other versions
CN101425070B (en
Inventor
成勇斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Kingdee Tianyanyun Computing Co ltd
Original Assignee
SHENZHEN KINGDEE MIDDLEWARE CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN KINGDEE MIDDLEWARE CO Ltd filed Critical SHENZHEN KINGDEE MIDDLEWARE CO Ltd
Priority to CN2008101457076A priority Critical patent/CN101425070B/en
Publication of CN101425070A publication Critical patent/CN101425070A/en
Application granted granted Critical
Publication of CN101425070B publication Critical patent/CN101425070B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment in the invention relates to a deadlock positioning method, a deadlock positioning device and a data system. The method is as follows: after the course of a database is deadlocked, acquiring the failed affairs in the deadlock and the affairs related to the generation of deadlock, combining a datasheet used by the affairs with the corresponding affairs, extracting the program execution statements corresponding to the same datasheet combination, examining a statement call stack according to the extracted program execution statements, and determining the generating device of deadlock. After the course of the database is deadlocked, the deadlock positioning method, deadlock positioning device and data system combine the datasheets used by the affairs with the corresponding affairs, examine the statement call stack according to the extracted program execution statements, and determine the generating position of deadlock, so that the information contents requiring for manual analysis for positioning the deadlock are greatly reduced; the deadlock is easily positioned; and the efficiency is increased.

Description

A kind of method of deadlock positioning, deadlock positioning device and data system
Technical field
The present invention relates to field of computer technology, especially relate to a kind of method, deadlock positioning device and data system of deadlock positioning.
Background technology
In each process implementation of computing machine, often, be called deadlock because of fighting for the phenomenon that resource or programming problem cause a kind of mutual wait to continue to carry out.At database also deadlock situation can often take place.SQL (Structured Query Language, Structured Query Language (SQL)) database is based upon on one or more relation database tables the operation of data, by to classification, the merging of these relation database tables, connect or the management that computing realizes data such as choose; Therefore, deadlock situation often takes place in SQL database, and for example process 1 is pinned tables of data A and waited for tables of data B, and process 2 is pinned tables of data B wait tables of data A; If no external force effect, the process that relates to all can't advance down, and this moment, system then was in deadlock state, and those processes that can't advance are called the deadlock process.
Remove deadlock state, must determine the position that deadlock takes place.The affairs that prior art generally depends on the technician to be provided deadlock information and database are followed the tracks of the observation analysis of report, perhaps depend on the deadlock lookup tool that each database producer provides, after a large amount of information of manual analysis, find out the SQL statement that causes deadlock, call the application code of this SQL statement, determine deadlock position again.The process that finds out application code is called deadlock positioning.
In research and practice process to prior art, the present inventor finds that there is following problem in prior art:
Prior art needs the technician quite familiar to the entire database system to the scheme of database deadlock positioning, and the deadlock that needs to be familiar with each database producer and provide is searched related tool, and need a large amount of information of manual analysis, do not provide the toy data base of relevant deadlock lookup tool to have no way of doing it to some in addition.To sum up, the deadlock positioning method of prior art is too dependent on manual analysis, and the process information amount is big, inefficiency.
Summary of the invention
The technical matters that the embodiment of the invention will be removed provides a kind of method, deadlock positioning device and data system of deadlock positioning, simple realization deadlock positioning more, and can reduce information processing capacity, raise the efficiency.
For removing above-mentioned technical matters, embodiment provided by the present invention is achieved through the following technical solutions:
A kind of method of deadlock positioning: behind the process generation deadlock of database operation, obtain the affairs of in deadlock, being sacrificed and with the related affairs of generation of deadlock; With described affairs of being sacrificed and making up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock; Extract identical tables of data and make up pairing program perform statement; Check the statement call stack according to the described program perform statement of extracting, determine the occurrence positions of deadlock.
Preferably, obtain in deadlock the affairs of being sacrificed and be specially: carry out the tracking results that db transaction is followed the tracks of according to the Apusic application server with the related affairs of generation of deadlock, obtain the affairs and the described beginning and ending time of being sacrificed affairs of in deadlock, being sacrificed, and, obtain in the described beginning and ending time the related affairs of generation with deadlock according to beginning and ending time of described affairs of being sacrificed.
Preferably, carry out the tracking results that db transaction is followed the tracks of according to the Apusic application server, obtaining the affairs of being sacrificed and described beginning and ending time of being sacrificed affairs is specially: the deadlock abnormal information in the tracking results of following the tracks of according to the db transaction on the Apusic application server filters out the affairs of being sacrificed, and obtains the described beginning and ending time of being sacrificed affairs according to described trace log and Transaction Identifier of being sacrificed affairs again.
Preferably, with described affairs of being sacrificed and make up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock and to be specially: described affairs of being sacrificed and and the related affairs of generation of deadlock in choose affairs as the analysis source, make up after the time order and function series arrangement of tables of data with the use of described analysis source, make up after the tables of data of other each affairs uses beyond the described analysis source is arranged with the backward of program perform statement execution time sequencing with the execution of program perform statement.
Preferably, extracting identical tables of data makes up pairing program perform statement and be specially: the tables of data combination that the analysis source is used compares with other each affairs beyond the analysis source, obtain like combinations, extract the pairing program perform statement of like combinations.
Preferably, be combined as in twos and make up.
A kind of deadlock positioning device comprises: obtain transaction units, be used for behind the process generation deadlock of database operation, obtain the affairs of in deadlock, being sacrificed and with the related affairs of generation of deadlock; Assembled unit is used for and will obtains the described affairs of being sacrificed that transaction units obtains and make up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock; Extraction unit is used to extract identical tables of data and makes up pairing program perform statement; Positioning unit is used for checking the statement call stack according to the described program perform statement that extraction unit extracts, and determines the occurrence positions of deadlock.
Preferably, assembled unit comprises: the acquisition time unit, be used for carrying out the tracking results that db transaction is followed the tracks of according to the Apusic application server, and obtain the affairs and the described beginning and ending time of being sacrificed affairs of in deadlock, being sacrificed; Obtain transaction units, be used to obtain in the described beginning and ending time and the related affairs of generation of deadlock; The tables of data assembled unit is used for described affairs of being sacrificed and making up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock.
Preferably, the tables of data assembled unit comprises: first assembled unit, be used for described affairs of being sacrificed and with the related affairs of generation of deadlock in choose affairs as the analysis source, make up after the time order and function series arrangement that the tables of data that described analysis source is used is carried out with the program perform statement; Second assembled unit makes up after the tables of data that is used for that other each affairs beyond the described analysis source are used is arranged with the backward of program perform statement execution time sequencing.
A kind of data system comprises: the Apusic application server is used to carry out db transaction and follows the tracks of; The deadlock positioning device, be used for behind the process generation deadlock of described database operation, according to tracking results obtain in deadlock the affairs of being sacrificed and with the related affairs of generation of deadlock, and make up with described affairs of being sacrificed and with the corresponding affairs separately of tables of data of the related affairs of the generation of deadlock use, check the statement call stack according to the identical corresponding program perform statement of extracting of tables of data combination, determine the occurrence positions of deadlock.
By technique scheme as can be seen, the embodiment of the invention is by obtaining and the related affairs of the generation of deadlock, with the employed tables of data correspondence of described affairs separately affairs make up, check the statement call stack according to the identical corresponding program perform statement of extracting of tables of data combination again, determine the occurrence positions of deadlock, making to locate in the deadlock process needs the quantity of information of manual analysis to reduce greatly, and more the simple realization deadlock positioning is raised the efficiency.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the method flow synoptic diagram of the embodiment of the invention one;
Fig. 2 is the method flow synoptic diagram of the embodiment of the invention two;
Fig. 3 is the method flow synoptic diagram of the embodiment of the invention three;
Fig. 4 is the structural representation of embodiment of the invention deadlock positioning device;
Fig. 5 is the structural representation of embodiment of the invention data system.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The enforcement environment of the embodiment of the invention is: newdata storehouse affairs are followed the tracks of on the Apusic application server, data source on the Apusic application server that appointment will be followed the tracks of, data source be database an agency on the Apusic application server with convenient after deadlock takes place, determine in deadlock, to be sacrificed information such as beginning and ending time of affairs and Transaction Identifier ID.Can determine and the related affairs of the generation of deadlock according to these information, then to analyzing with the combination of corresponding each affairs of the employed tables of data of the related affairs of the generation of deadlock, after extracting identical tables of data and making up pairing program perform statement, check the statement call stack, then can determine the occurrence positions of deadlock.
Because of the differentiation that the shielding of Apusic application server is communicated by letter with disparate databases, for the application access database provides unified interface, then can support Universal Database, so the embodiment of the invention can solve the deadlock positioning problem at all types database.
Embodiment one, describe in detail referring to Fig. 1, Fig. 1 is the method flow synoptic diagram of present embodiment one.
Step 101: behind the process generation deadlock of database operation, obtain the affairs of in deadlock, being sacrificed and with the related affairs of generation of deadlock.
Behind described database generation deadlock, might show as visit failure, system alarm etc., the embodiment of the invention determines that the affairs of being sacrificed reach and the related affairs of generation of deadlock are investigated the deadlock source in deadlock, obviously, during the database resource of described affairs on using the Apusic application server, can be traced into by the db transaction following function on the Apusic application server.
With the related affairs of the generation of deadlock in deadlock by the affairs of being sacrificed in the process of implementation, other affairs of carrying out are closely related with the generation of deadlock synchronously.Obtain and the related affairs of the generation of deadlock, need to sacrifice according to the definite quilt of the tracking results of the tracking of the db transaction on the Apusic application server earlier the beginning and ending time of affairs, then determine that according to this beginning and ending time which affairs is relevant with quilt sacrifice affairs.This beginning and ending time can obtain according to described trace log and affairs ID attribute of being sacrificed affairs.
Step 102: the affairs that will be sacrificed in deadlock reach and make up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock.
The affairs of being sacrificed in deadlock to be reached and make up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock, earlier in described affairs selected affairs as the analysis source, with the analysis source, make up with corresponding respectively affairs separately of tables of data that related other affairs of the generation of deadlock are used in program process.The analysis source can be the affairs of being sacrificed in deadlock.
Step 103: extract identical tables of data and make up pairing program perform statement.
The corresponding program perform statement of like combinations in the combination of the tables of data of using in the process of implementation with the analysis source with related other affairs of the generation of deadlock extracts, and determines that further contention for resource may be relevant with the execution of which program perform statement.
Step 104: the program perform statement according to described extraction is checked the statement call stack, determines the occurrence positions of deadlock.
Result according to step 103 analysis, the scope of deadlock occurrence positions is narrowed down to the common tables of data of using of different offices, extract the program perform statement of tables of data correspondence, and check program perform statement call stack, the deadlock reason is navigated on the concrete application code.
Deadlock state is removed in the execution that can be adjusted this code position or cancel this code after the location.
The embodiment of the invention is checked the statement call stack according to the identical corresponding program perform statement of extracting of tables of data combination, and making to locate in the deadlock process needs the quantity of information of manual analysis to reduce greatly, and more the simple realization deadlock positioning is raised the efficiency.
Following examples two describe in detail and will cause the process that makes up with the corresponding affairs separately of tables of data of the related affairs use of the generation of deadlock, and the program perform statement is example with the SQL statement.
Embodiment two, describe in detail referring to Fig. 2, Fig. 2 is the schematic flow sheet of present embodiment.
Step 201: behind the program generation deadlock of database operation, carry out the tracking results that db transaction is followed the tracks of, obtain the beginning and ending time of the affairs of in deadlock, being sacrificed according to the Apusic application server.
After system's produce of deadlock phenomenon, as visit failure, system alarm etc., embodiment of the invention locating device determines to be sacrificed the beginning and ending time of affairs in deadlock according to database trace daily record, affairs ID attribute etc., when this is sacrificed the data source of affairs on using the Apusic application server, can be traced into the beginning and ending time by db transaction following function on the Apusic application server.
Step 202: filter out and the related affairs of the generation of deadlock according to the described beginning and ending time.
In the implementation of affairs, may with the affairs produce of deadlock of concurrent execution in the same time, get access to the affairs of concurrent execution in the beginning and ending time of being sacrificed affairs, help finding apace the SQL statement that causes deadlock.
Step 203: sacrificed affairs and with the related affairs of generation of deadlock in specify affairs as the analysis source, the combination of the used tables of data in extraction and analysis source.
The analysis source affairs of extracting are carried out the time order and function series arrangement that all tables of data of the use of SQL statement are carried out with SQL statement, can be to make up in twos, and for example the tables of data of Shi Yonging has A, B, C three tables, and its combination of making up in twos has A-B, B-C, A-C.
Step 204: extract described by sacrifice affairs and with the related affairs of the generation of deadlock in the combination of corresponding affairs separately of the used tables of data of other affairs except that the analysis source.
Sacrificed affairs and carried out the time order and function backward arrangement in proper order that all tables of data of the use of SQL statement are carried out with SQL statement what extract with other affairs except that the analysis source in the related affairs of generation of deadlock, the corresponding combination of affairs separately can be to make up in twos, the backward of the tables of data B that for example uses, A, C three tables is C, A, B, and its combination of making up in twos has C-B, C-A, A-B.
Step 205: in the combination of the used tables of data in analysis source and the used tables of data combination of other affairs except that the analysis source, extract the identical corresponding SQL statement of tables of data combination.
Tables of data time order and function order and the source of the analysis affairs of carrying out the use of SQL statement when other affairs are carried out tables of data sequencing that SQL statement uses when opposite, might cause the conflict of contention for resource, so the backward of the tables of data sequencing of the use of other affairs execution SQL statement is generally identical with the tables of data sequencing that the source of analysis affairs are used.
Therefore, carry out in the combination of the combination of all tables of data of SQL statement and all tables of data that other affairs are carried out SQL statement analyzing the source affairs, the identical corresponding SQL statement of tables of data combination is extracted, help determining fast the position that deadlock takes place.
For example analyze source affairs carry out SQL statement all tables of data be combined as A-B, B-C, A-C in twos, other affairs carry out SQL statement all tables of data be combined as C-B, C-A, A-B in twos, wherein the A-B combination is identical, then analyze source affairs and described other affairs and might cause contention for resource in the process of implementation and cause deadlock, so this tables of data combination is extracted.
Step 206: judging whether that all relevant issues have all been analyzed finishes, and is then to change step 207 over to, otherwise changes step 203 over to.
Multianalysis after the situation of the related affairs of generation of all and deadlock, change step 207 over to; Otherwise change step 203 over to.
Step 207: the corresponding SQL statement of tables of data combination according to described extraction is checked the SQL statement call stack, determines the occurrence positions of deadlock.
The SQL statement call stack is the path that code is carried out, and such as called the b function in a function, that call stack is exactly a-〉b, therefore, can know from call stack and to find out which concrete application code carried out described SQL statement.
According to the identical tables of data combination of extracting, call situation at the tables of data that may cause deadlock state, access and the corresponding SQL perform statement of this tables of data combination, reduced the quantity of information of manual analysis; Check the SQL statement call stack again, determine to call the concrete application code of this SQL perform statement, then simply determined the position that deadlock takes place, improved the efficient of deadlock positioning.
Deadlock state is removed in the execution that can be adjusted this code position or cancel this code after the location.
Following examples three are an example in the actual application environment.
Embodiment three, referring to Fig. 3, Fig. 3 is the method flow synoptic diagram of the embodiment of the invention.
Step 301: newly-built tracking on the data source monitoring tools of Apusic application server.
The Apusic server provides unified interface for the application access database, can support Universal Database.
Step 302: choose the data source that will follow the tracks of, this data source is positioned on the Apusic server.
Step 303: after deadlock takes place, check tracking results.
Which affairs is the abnormal information that tracking results shows can find sacrificed in deadlock, promptly is terminated execution.For example can directly find out affairs ID from abnormal information is that 11 affairs are terminated execution.
Step 304: receive the instruction of deadlock analysis, get access to the affairs ID that is sacrificed affairs.
When clicking " deadlock analysis " button, locating device receives the instruction of beginning deadlock analysis; The affairs ID of affairs is sacrificed in input, and locating device gets access to the affairs ID that is sacrificed affairs.For example, finding out the affairs ID that is sacrificed the affairs correspondence from tracking results is 11, then imports 11 behind click " deadlock analysis " button.
Step 305: demonstration and the affairs of being conflicted by the generation of sacrifice affairs.
The beginning and ending time of the affairs that locating device is sacrificed according to definite quilts such as database trace daily record, affairs ID attributes on the backstage, and filter out the affairs ID of the affairs that are associated with deadlock according to the described beginning and ending time.For example, obtaining with being sacrificed the affairs ID that affairs produce conflict transaction from analysis result is 16.
Locating device extracts the combination in twos that affairs ID is 11 used all tables of data of affairs on the backstage, by the time order and function series arrangement of carrying out with SQL statement; Extract affairs ID and be the combination in twos of 16 used all tables of data of affairs, the backward of the time order and function order of carrying out with SQL statement with all tables of data of carrying out SQL statement is arranged, and extracts the SQL statement of identical table pack correspondence, obtains analysis result.
For example, analysis result is as shown in the table:
SQL statement Affairs ID
UPDATE?B?SET?name=’bb’WHERE?id=’1’ 11
UPDATE?A?SET?name=’ba’WHERE?id=’1’ 11
UPDATE?A?SET?name=’aa’WHERE?id=’1’ 16
UPDATE?B?SET?name=’ab’WHERE?id=’1’ 16
Learn that by last table affairs ID is that 11 and 16 affairs possibility is because cause conflict cause deadlock in the use of Table A and table B.
Step 306: check call stack, determine the occurrence positions of deadlock.
Check the call stack of the SQL statement correspondence that step 305 analysis result is listed, can navigate to affairs ID and be the code line in 11 and 16 the application program, determine the position that deadlock takes place.The concrete application code of using is such as determine affairs ID to be 11 affairs when the SQL statement that invocation step 305 analysis results are listed according to call stack: atcom.apusic.test.statment.TestStatementBean.transB (TestStatementBean.Java:549), then determined the position that deadlock takes place.
A kind of method of deadlock positioning more than is provided, and the embodiment of the invention also provides a kind of deadlock positioning device.
A kind of deadlock positioning device, referring to Fig. 4, Fig. 4 is the structural representation of embodiment of the invention database deadlock positioning device, comprising:
Obtain transaction units 401, be used for behind the process generation deadlock of database operation, obtain the affairs of being sacrificed and with the related affairs of generation of deadlock;
Assembled unit 402 is used for and will obtains the described affairs of being sacrificed that transaction units 401 obtains and make up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock;
Extraction unit 403 is used to extract identical tables of data and makes up pairing program perform statement;
Positioning unit 404 is used for checking program perform statement call stack according to the described program perform statement that extraction unit 403 extracts, and determines the deadlock occurrence positions.
Described assembled unit 402 comprises subelement:
Acquisition time unit 4021 is used for carrying out the tracking results that db transaction is followed the tracks of according to the Apusic application server, obtains and is sacrificed affairs and described beginning and ending time of being sacrificed affairs;
Obtain transaction units 4022, be used to obtain in the described beginning and ending time and the related affairs of generation of deadlock;
Tables of data assembled unit 4023, the affairs that are used for being sacrificed reach and make up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock.
Described tables of data assembled unit 4023 comprises subelement:
First assembled unit 4024 is used for choosing affairs as the analysis source in described and the related affairs of generation deadlock, makes up after the time order and function series arrangement of tables of data with the execution of program perform statement with the use of described analysis source
Second assembled unit 4025 makes up after the tables of data that is used for that other each affairs beyond the described analysis source are used is arranged with the backward of program perform statement execution time sequencing.
Behind the process generation deadlock of described database operation, obtain transaction units 401 obtain the affairs of being sacrificed and with the related affairs of generation of deadlock, assembled unit 402 will obtain the described affairs of being sacrificed that transaction units obtains and make up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock, the identical tables of data that extracts extraction unit 403 makes up pairing program perform statement, positioning unit 404 is checked program perform statement call stack according to the described program perform statement that extraction unit 403 extracts, and determines the deadlock occurrence positions.
Wherein, the tracking results that db transaction is followed the tracks of is carried out according to the Apusic application server in acquisition time unit 4021 in the assembled unit 402, obtain and sacrificed affairs and described beginning and ending time of being sacrificed affairs, after obtaining transaction units 4022 and obtaining related affairs of the generation with deadlock in the described beginning and ending time, tables of data assembled unit 4023 makes up with described affairs of being sacrificed and with the corresponding affairs separately of tables of data of the related affairs use of the generation of deadlock.
Further, first assembled unit 4024 in the tables of data assembled unit 4023 is chosen affairs as the analysis source in described and the related affairs of generation deadlock, make up after the time order and function series arrangement of tables of data with the execution of program perform statement with the use of described analysis source, the tables of data that second assembled unit 4025 then uses other each affairs beyond the described analysis source makes up after arranging with the backward of program perform statement execution time sequencing.
A kind of data system, referring to Fig. 5, Fig. 5 is the structural representation of embodiment of the invention data system, system comprises:
Apusic application server 501 is used to carry out db transaction and follows the tracks of;
Deadlock positioning device 502, be used for behind the process generation deadlock of described database operation, according to tracking results obtain in deadlock the affairs of being sacrificed and with the related affairs of generation of deadlock, and make up with described affairs of being sacrificed and with the corresponding affairs separately of tables of data of the related affairs of the generation of deadlock use, check the statement call stack according to the identical corresponding program perform statement of extracting of tables of data combination, determine the occurrence positions of deadlock.
Described deadlock positioning device 502 can use the concrete structure of aforementioned a kind of deadlock positioning device, does not influence the realization of the embodiment of the invention.
The embodiment of the invention is by behind the process generation deadlock of described database operation, to make up with the corresponding affairs separately of tables of data that the related affairs of the generation of deadlock are used, check the statement call stack according to the identical corresponding program perform statement of extracting of tables of data combination, determine the occurrence positions of deadlock, make the location deadlock need the quantity of information of manual analysis to reduce greatly, the simple realization deadlock positioning is raised the efficiency.
And because of the differentiation that the shielding of Apusic application server is communicated by letter with disparate databases, for the application access database provides unified interface, then can support Universal Database, so the embodiment of the invention can solve the deadlock positioning problem at all types database.
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
The present invention can be used for numerous general or special purpose computingasystem environment or configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, the system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC, small-size computer, mainframe computer, comprise distributed computing environment of above any system or equipment or the like.In addition, the present invention can also describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in distributed computing environment, put into practice the present invention, in these distributed computing environment, by by communication network connected teleprocessing equipment execute the task.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
More than method, deadlock positioning device and the data system of a kind of database deadlock positioning that the embodiment of the invention provided is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1, a kind of method of deadlock positioning is characterized in that:
Behind the process generation deadlock of database operation, obtain the affairs of in deadlock, being sacrificed and with the related affairs of generation of deadlock;
With described affairs of being sacrificed and making up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock;
Extract identical tables of data and make up pairing program perform statement;
Check the statement call stack according to the described program perform statement of extracting, determine the occurrence positions of deadlock.
2, the method for database deadlock positioning according to claim 1 is characterized in that:
Describedly obtain in deadlock the affairs of being sacrificed and be specially with the related affairs of generation of deadlock:
Carry out the tracking results that db transaction is followed the tracks of according to the Apusic application server, obtain the affairs and the described beginning and ending time of being sacrificed affairs of in deadlock, being sacrificed, and, obtain in the described beginning and ending time the related affairs of generation with deadlock according to beginning and ending time of described affairs of being sacrificed.
3, the method for database deadlock positioning according to claim 2 is characterized in that:
Describedly carry out the tracking results that db transaction is followed the tracks of, obtain the affairs and the described beginning and ending time of being sacrificed affairs of being sacrificed to be specially according to the Apusic application server:
Filter out the affairs of being sacrificed according to the deadlock abnormal information in the tracking results of the tracking of the db transaction on the Apusic application server, obtain the described beginning and ending time of being sacrificed affairs according to described trace log and Transaction Identifier of being sacrificed affairs again.
4, the method for database deadlock positioning according to claim 1 is characterized in that:
The described combination with described affairs of being sacrificed and with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock is specially:
Described affairs of being sacrificed and with the related affairs of generation of deadlock in choose affairs as the analysis source, make up after the time order and function series arrangement of tables of data with the use of described analysis source, make up after the tables of data of other each affairs uses beyond the described analysis source is arranged with the backward of program perform statement execution time sequencing with the execution of program perform statement.
5, the method for database deadlock positioning according to claim 4 is characterized in that:
The identical tables of data of described extraction makes up pairing program perform statement and is specially:
The tables of data combination that the analysis source is used compares with analysis source other each affairs in addition, obtains like combinations, extracts the pairing program perform statement of like combinations.
6, according to the method for claim 4 or 5 described database deadlock positioning, it is characterized in that:
Described being combined as in twos made up.
7, a kind of deadlock positioning device is characterized in that, comprising:
Obtain transaction units, be used for behind the process generation deadlock of database operation, obtain the affairs of in deadlock, being sacrificed and with the related affairs of generation of deadlock;
Assembled unit is used for and will obtains the described affairs of being sacrificed that transaction units obtains and make up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock;
Extraction unit is used to extract identical tables of data and makes up pairing program perform statement;
Positioning unit is used for checking the statement call stack according to the described program perform statement that extraction unit extracts, and determines the occurrence positions of deadlock.
8, deadlock positioning device according to claim 6, described assembled unit comprises:
The acquisition time unit is used for carrying out the tracking results that db transaction is followed the tracks of according to the Apusic application server, obtains the thing and the described beginning and ending time of being sacrificed affairs of being sacrificed in deadlock;
Obtain transaction units, be used to obtain in the described beginning and ending time and the related affairs of generation of deadlock;
The tables of data assembled unit is used for described affairs of being sacrificed and making up with the corresponding affairs separately of the employed tables of data of the related affairs of the generation of deadlock.
9, deadlock positioning device according to claim 7, described tables of data assembled unit comprises:
First assembled unit, be used for described affairs of being sacrificed and with the related affairs of generation of deadlock in choose affairs as the analysis source, make up after the time order and function series arrangement that the tables of data that described analysis source is used is carried out with the program perform statement;
Second assembled unit makes up after the tables of data that is used for that other each affairs beyond the described analysis source are used is arranged with the backward of program perform statement execution time sequencing.
10, a kind of data system is characterized in that, comprising:
The Apusic application server is used to carry out db transaction and follows the tracks of;
The deadlock positioning device, be used for behind the process generation deadlock of described database operation, according to tracking results obtain in deadlock the affairs of being sacrificed and with the related affairs of generation of deadlock, and make up with described affairs of being sacrificed and with the corresponding affairs separately of tables of data of the related affairs of the generation of deadlock use, check the statement call stack according to the identical corresponding program perform statement of extracting of tables of data combination, determine the occurrence positions of deadlock.
CN2008101457076A 2008-08-11 2008-08-11 Deadlock positioning method, deadlock positioning device and data system Expired - Fee Related CN101425070B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101457076A CN101425070B (en) 2008-08-11 2008-08-11 Deadlock positioning method, deadlock positioning device and data system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101457076A CN101425070B (en) 2008-08-11 2008-08-11 Deadlock positioning method, deadlock positioning device and data system

Publications (2)

Publication Number Publication Date
CN101425070A true CN101425070A (en) 2009-05-06
CN101425070B CN101425070B (en) 2011-04-20

Family

ID=40615690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101457076A Expired - Fee Related CN101425070B (en) 2008-08-11 2008-08-11 Deadlock positioning method, deadlock positioning device and data system

Country Status (1)

Country Link
CN (1) CN101425070B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521033A (en) * 2011-12-14 2012-06-27 华南理工大学 Deadlock detection and relieving method for monitoring system dispatching
CN105426234A (en) * 2015-10-30 2016-03-23 小米科技有限责任公司 Deadlock detection method and apparatus for database
CN106682101A (en) * 2016-12-05 2017-05-17 福建天晴数码有限公司 Method and system for detecting operation anomalies of database script
CN106874391A (en) * 2017-01-12 2017-06-20 无线生活(杭州)信息科技有限公司 A kind of deadlock treatment method and device
CN108337911A (en) * 2015-04-01 2018-07-27 起元技术有限责任公司 Db transaction is handled in distributed computing system
CN111221869A (en) * 2018-11-27 2020-06-02 北京京东振世信息技术有限公司 Method and device for tracking database transaction time and analyzing database lock
CN112559195A (en) * 2020-12-25 2021-03-26 恒生电子股份有限公司 Database deadlock detection method and device, test terminal and medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE521433C2 (en) * 1998-07-22 2003-11-04 Ericsson Telefon Ab L M A method for managing the risk of a total lock between simultaneous transactions in a database
AU2001232565A1 (en) * 2000-02-11 2001-08-20 Telefonaktiebolaget Lm Ericsson (Publ) Active cooperation deadlock detection system/method in a distributed database network
US7185339B2 (en) * 2001-08-03 2007-02-27 Oracle International Corporation Victim selection for deadlock detection
JP2005122560A (en) * 2003-10-17 2005-05-12 Fujitsu Ltd Program for detecting deadlock beforehand

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521033A (en) * 2011-12-14 2012-06-27 华南理工大学 Deadlock detection and relieving method for monitoring system dispatching
CN108337911A (en) * 2015-04-01 2018-07-27 起元技术有限责任公司 Db transaction is handled in distributed computing system
CN105426234A (en) * 2015-10-30 2016-03-23 小米科技有限责任公司 Deadlock detection method and apparatus for database
CN105426234B (en) * 2015-10-30 2019-02-19 小米科技有限责任公司 Database deadlocks detection method and device
CN106682101A (en) * 2016-12-05 2017-05-17 福建天晴数码有限公司 Method and system for detecting operation anomalies of database script
CN106682101B (en) * 2016-12-05 2019-09-20 福建天晴数码有限公司 A kind of database script is operating abnormally the method and system of detection
CN106874391A (en) * 2017-01-12 2017-06-20 无线生活(杭州)信息科技有限公司 A kind of deadlock treatment method and device
CN106874391B (en) * 2017-01-12 2019-12-10 无线生活(杭州)信息科技有限公司 deadlock processing method and device
CN111221869A (en) * 2018-11-27 2020-06-02 北京京东振世信息技术有限公司 Method and device for tracking database transaction time and analyzing database lock
CN112559195A (en) * 2020-12-25 2021-03-26 恒生电子股份有限公司 Database deadlock detection method and device, test terminal and medium
CN112559195B (en) * 2020-12-25 2021-12-21 恒生电子股份有限公司 Database deadlock detection method and device, test terminal and medium

Also Published As

Publication number Publication date
CN101425070B (en) 2011-04-20

Similar Documents

Publication Publication Date Title
CN101425070B (en) Deadlock positioning method, deadlock positioning device and data system
CN100451989C (en) Software testing system and testing method
CN101237326B (en) Method, device and system for real time parsing of device log
CN103425572B (en) Code analysis methods and code analysis system
US20070234306A1 (en) Tracing performance of machine-readable instructions
WO2020238130A1 (en) Big data log monitoring method and apparatus, storage medium, and computer device
US8463811B2 (en) Automated correlation discovery for semi-structured processes
CN103577310A (en) Method and device for recording software debugging logs
US9311345B2 (en) Template based database analyzer
CN110737594A (en) Database standard conformance testing method and device for automatically generating test cases
CN110737689A (en) Data standard conformance detection method, device, system and storage medium
CN109857631A (en) Code coverage statistical method, device, equipment and storage medium based on artificial intelligence
CN103164312A (en) Method and system for preparing interface testing data
CN112685017A (en) Workflow engine facing mobile internet
CN104866425A (en) Database pressure testing method
CN108089978A (en) A kind of diagnostic method for analyzing ASP.NET application software performance and failure
CN112182065A (en) Asset management system and method based on automatic acquisition and multi-source import
Shershakov et al. System runs analysis with process mining
CN116483831B (en) Recommendation index generation method for distributed database
CN102193859B (en) Code analysis method and system
CN107633094B (en) Method and device for data retrieval in cluster environment
CN109582582A (en) A kind of automated testing method and system of web interface
CN115495508A (en) Generating method and device of SQL (structured query language) statement for report and electronic equipment
CN101887455B (en) Method and system for managing multi-version report data
CN107992567A (en) Collecting method and data collecting system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP03 Change of name, title or address

Address after: South South technology twelve road 518057 in Guangdong province Shenzhen City Guangdong streets Nanshan District high tech Industrial Park, No. 2, Kingdee Software Park building A floor 2 South Block

Patentee after: SHENZHEN JINDIE TIANYAN MIDDLEWARE Co.,Ltd.

Address before: 518057 Guangdong City, Nanshan District province high tech Zone in the middle of the industrial zone of the sparrow tower M-6 building, floor 1, area 3, second, 4

Patentee before: SHENZHEN KINGDEE MIDDLEWARE Co.,Ltd.

CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: South South technology twelve road 518057 in Guangdong province Shenzhen City Guangdong streets Nanshan District high tech Industrial Park, No. 2, Kingdee Software Park building A floor 2 South Block

Patentee after: Shenzhen Kingdee tianyanyun computing Co.,Ltd.

Address before: South South technology twelve road 518057 in Guangdong province Shenzhen City Guangdong streets Nanshan District high tech Industrial Park, No. 2, Kingdee Software Park building A floor 2 South Block

Patentee before: SHENZHEN JINDIE TIANYAN MIDDLEWARE Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110420