CN104793988A - Cross-database distributed transaction implementation method and device - Google Patents

Cross-database distributed transaction implementation method and device Download PDF

Info

Publication number
CN104793988A
CN104793988A CN201410025961.8A CN201410025961A CN104793988A CN 104793988 A CN104793988 A CN 104793988A CN 201410025961 A CN201410025961 A CN 201410025961A CN 104793988 A CN104793988 A CN 104793988A
Authority
CN
China
Prior art keywords
database
manipulation
distributed transaction
line identifier
row
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
CN201410025961.8A
Other languages
Chinese (zh)
Other versions
CN104793988B (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.)
Advanced New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410025961.8A priority Critical patent/CN104793988B/en
Publication of CN104793988A publication Critical patent/CN104793988A/en
Application granted granted Critical
Publication of CN104793988B publication Critical patent/CN104793988B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a cross-database distributed transaction implementation method. The method comprises the first step of receiving distributed transaction activation requests and distributing transaction identifiers to distributed transactions, the second step of receiving operation requests or an operation request collection of the distributed transactions which the transaction identifiers are distributed to for database operations, the third step of acquiring information of a target database of the database operations according to all the operation requests and sending the database operations to the target database for execution in accordance with the ACID principle, and the fourth step of clearing the distributed transactions after all the database operations are executed. The invention further provides a cross-database distributed transaction implementation device. By means of the method, the cross-database distributed transactions which are lightweight and easy to maintain and meet the ACID principle can be realized.

Description

The implementation method of integration across database distributed transaction and device
Technical field
The application relates to distributing real time system field, is specifically related to a kind of implementation method of integration across database distributed transaction.The application provides a kind of implement device of integration across database distributed transaction simultaneously.
Background technology
Along with the development of internet and the continuous change of user's request, various applied business becomes increasingly complex.In order to provide better support to business, first floor system gets more and more, and serve more and more concentrated, level is also more and more darker.For a service request, no longer just can be completed by the database of accessing in some service sub-systems, two or more the cooperation of service sub-system of usual needs, and different subsystems uses different databases, that is, in once asking, may need to access the data in multiple target database, and require that accessing operation meets the demand of high real-time.
When multiple integration across database service request is concurrent, if adopt the mode of asynchronous operation, easily cause the inconsistent of whole target database system data, in order to address this problem, usual needs design retry mechanism to ensure data consistent and integrality in the system in middle layer, not only reduce the treatment effeciency of service request, too increase cost simultaneously.In this context, in order to meet the Concurrency Access demand of multi-service integration across database, there is the concept of distributed transaction.
So-called affairs are operating units in database, operation all in this operating unit or all successful, all failed, execution result is irreversible, and affairs possess four basic characteristics: atomicity, consistance, isolation, persistence, also referred to as the ACID characteristic of affairs.Distributed transaction then refer to affairs participant, support that the server of affairs, Resource Server and task manager lay respectively on the different nodes of different distributed systems.Because distributed transaction is across multiple database resource, therefore to require that distributed transaction meets ACID attribute for the data consistency safeguarded on all database resources be very important, therefore evaluate affairs and whether support distributed calling, mainly see the ACID principle whether meeting affairs in its distributed invoked procedure.
In order to realize distributed transaction, prior art uses two-phase commitment protocol usually.Stage one: transaction coordination person inquires whether all affairs participants (such as: each target database) can submit respective operation to, and each affairs participant, according to the resource situation of oneself, sends the response whether can submitted to transaction coordination person.In the stage two: what feed back in the first stage as all affairs participants is all affirmative acknowledgement, and so coordinator just can initiate this stage, that is, notify that all affairs participants are submitted to affairs, all participants submit to and completely again can notify coordinator.In order to realize distributed transaction, a kind of agreement must be used between each participant of distributed transaction to transmit transaction context information, such as: IIOP(Internet Inter-ORBProtocol internet internal object request broker agreement) agreement, the affairs participant of different developer's exploitation also must support same standard agreement, could realize distributed affairs.
Specific to realization, prior art adopts CORBA(Common Object Request BrokerArchitecture usually, Common Object Request Broker Architecture) a kind of OO application program system specification of standard formulated, solve the interconnected of software systems in distributed processing environment.CORBA standard is mainly divided into three parts: the Interoperability Protocol IIOP between IDL (Interface Definition Language) (IDL), Object Request Broker (ORB) and ORB.Adopt CORBA architecture, for the application on different machines provides interoperability under isomery distributional environment, and be seamlessly integrated with multiple objective system, by distributed object technology is combined with Transaction processing technology, utilize two-phase commitment protocol and recover the technology such as daily record, thus ensureing the ACID character of distributed transaction.
The distributed transaction framework that above-mentioned prior art adopts, need to build comparatively complicated distributed treatment center, and require that distributed treatment center and destination server or target database system must be configured for all kinds of complex protocols realizing distributed operation, more too fat to move on the one hand, be unfavorable for safeguarding and using, the service of the customizable of lightweight also cannot be provided for different business on the other hand.
Summary of the invention
The application provides a kind of implementation method of integration across database distributed transaction, too complicated with the implementation framework solving existing distributed transaction, to be not easy to maintenance problem.The application provides a kind of implement device of integration across database distributed transaction in addition.
The application provides a kind of implementation method of integration across database distributed transaction, comprising:
Receive the startup request of distributed transaction, and be that described distributed transaction distributes Transaction Identifier;
Receive the operation requests for database manipulation or the operation requests set that are assigned with the distributed transaction of Transaction Identifier;
For each operation requests, obtain the target data library information of described database manipulation, and follow ACID principle described database manipulation is sent to described target database perform;
Treat that all database manipulations are finished, remove described distributed transaction.
Optionally, the target data library information of the described database manipulation of described acquisition specifically refers to, the target database of specifying according to described database manipulation and/or the title of table, search the database description information pre-set, therefrom obtain the target data library information corresponding with the title of described target database and/or table.
Optionally, described in follow ACID principle described database manipulation is sent to described target database perform, comprising:
Obtain the type of described database manipulation;
Resolve described database manipulation, obtain the line identifier of described database manipulation impact;
Obtain the current accessed state of row corresponding to described line identifier;
The current accessed state of row corresponding according to described line identifier and the type of described database manipulation, judge whether to need the access waiting for the row that described line identifier is corresponding to terminate; If so, then perform wait, the access of the row that described line identifier is corresponding by the time terminates, then performs following step; If not, continue to perform following step;
According to the type of described database manipulation, judging whether to need to obtain the access control to row corresponding to described line identifier, is if so, then perform following step after the row interpolation access control that described line identifier is corresponding; If not, following step is performed;
Described target database is sent to perform described database manipulation;
Requesting party to described distributed transaction returns the execution result of described database manipulation.
Optionally, after performing the described step sending to described target database to perform described database manipulation, if do not receive the execution result that target database returns within the time preset, then obtained the execution result of described database manipulation by the mode of active access destination database.
Optionally, the type of described database manipulation comprises: newly-increased operation, renewal rewards theory, deletion action or query manipulation.
Optionally, the described database manipulation of described parsing, obtains the line identifier of described database manipulation impact, comprising:
If the type of described database manipulation is newly-increased operation, be then the line identifier of described newly-increased operation distribution this row of unique identification, and described line identifier is added in newly-increased operation;
Otherwise, perform following step:
Described database manipulation is resolved to the query manipulation of the acquisition line identifier adopting the same terms;
Described target database is sent to perform described query manipulation;
Receive the line identifier that described target database returns, using the line identifier that the line identifier returned affects as described database manipulation.
Optionally, the current accessed state of the described row corresponding according to described line identifier and the type of described database manipulation, judge whether to need the access waiting for the row that described line identifier is corresponding to terminate, specifically refer to:
If the type of described database manipulation is newly-increased operation or query manipulation, be then judged to not need the access waiting for the row that described line identifier is corresponding to terminate;
If the type of described database manipulation is renewal rewards theory or deletion action, whether do not accessed by the office outside current distributed transaction before then judging the trade that described line identifier is corresponding further, though or by the transactions access outside current distributed transaction but less than locked, if so, be then judged to not need the access waiting for the row that described line identifier is corresponding to terminate; Otherwise, be judged to need the access waiting for the row that described line identifier is corresponding to terminate.
Optionally, the described type according to described database manipulation, judges whether to need to obtain the access control to row corresponding to described line identifier, specifically refers to:
If the type of described database manipulation is newly-increased operation, renewal rewards theory or deletion action, be then judged to need to obtain the access control to row corresponding to described line identifier.
Accordingly, the described row being described line identifier is corresponding adds access control, specifically refers to, allows to perform for row that described line identifier is corresponding adds the process lock that query manipulation but do not allow performs newly-increased operation, renewal rewards theory and deletion action.
Optionally, before the described step sending to described target database to perform described database manipulation, perform following operation: if the type of described database manipulation is query manipulation, and there is the row of the affairs locking outside by current distributed transaction in described line identifier, then adopt following step to re-construct query manipulation:
The type of the database manipulation performed before obtaining the described locked trade;
If the type of the database manipulation performed before the described locked trade is newly-increased operation, described locked rower is designated as discontented sufficient querying condition;
If the type of the database manipulation performed before the described locked trade is renewal rewards theory or deletion action, then judge whether described locked row met the condition of described query manipulation before performing current renewal rewards theory or deletion action further, if so, then record meets the row of the condition of described query manipulation; Otherwise, described locked rower is designated as discontented sufficient querying condition;
Generate the query manipulation not meeting the line identifier of querying condition described in eliminating;
Accordingly, described described database manipulation is sent to described target database perform refer to, send to described target database to perform the query manipulation re-constructed.
Accordingly, the execution result that the described requesting party to described distributed transaction returns described database manipulation refers to, by the execution result of described query manipulation, merge with the row meeting the condition of described query manipulation recorded, and the result after merging is returned to the requesting party of described distributed transaction.
Optionally, described method also comprises:
The relevant information write of the database manipulation relevant information of described distributed transaction and described distributed transaction comprised identifies in corresponding internal storage data with described distributed transaction.
Optionally, the relevant information of described distributed transaction comprises: the Transaction Identifier of described distributed transaction, executing state and time-out are arranged;
The relevant information of the database manipulation that described distributed transaction comprises comprises: the type of the content of the row before the line identifier of target data library information, impact, renewal rewards theory or deletion action perform, lock status, executing state, Proactive authentication mistiming, data base manipulation statement and database manipulation.
Optionally, the described distributed transaction of described removing comprises:
The row execution locked described distributed transaction unlocks operation;
Delete described distributed transaction mark and the internal storage data relevant to described distributed transaction.
Optionally, described method also comprises:
Obtain the execution result of database manipulation, if the arbitrary database manipulation in described distributed transaction fails to run succeeded, then rollback operation is performed to other database manipulations of the successful execution in described distributed transaction, return to the state before the execution of described distributed transaction.
Optionally, described method also comprises:
Judge the duration of described distributed transaction, if the described duration is greater than the time preset, then triggers exception handler and process.
Optionally, described method also comprises:
The implementation of described distributed transaction and described distributed transaction are write in journal file the amendment that target database is made.
Optionally, described method also comprises:
Read described journal file, and according to the information of the distributed transaction recorded in described journal file, rollback operation is performed to the database manipulation of the successful execution in the distributed transaction not yet completed.
Accordingly, the application also provides a kind of implement device of integration across database distributed transaction, comprising:
Affairs start unit for receiving the startup request of distributed transaction, and is that described distributed transaction distributes Transaction Identifier;
Operation receiving element, for receiving the operation requests for database manipulation or the operation requests set of the distributed transaction being assigned with Transaction Identifier;
Operation execution unit, for for each operation requests, obtains the target data library information of described database manipulation, and follow ACID principle described database manipulation is sent to described target database perform;
Affairs clearing cell, for after described distributed transaction is finished, removes described distributed transaction.
Optionally, described operation execution unit obtains the target data library information of described database manipulation in the following way: the target database of specifying according to described database manipulation and/or the title of table, search the database description information pre-set, therefrom obtain the target data library information corresponding with the title of described target database and/or table.
Optionally, described operation execution unit comprises:
Target data library inquiry subelement, for the title of the target database of specifying according to described database manipulation and/or table, search the database description information pre-set, therefrom obtain the target data library information corresponding with the title of described target database and/or table;
Action type obtains subelement, for obtaining the type of described database manipulation;
Line identifier obtains subelement, for resolving described database manipulation, obtains the line identifier of described database manipulation impact;
Access status obtains subelement, for obtaining the current accessed state of row corresponding to described line identifier;
Wait for subelement, for according to the current accessed state of row corresponding to described line identifier and the type of described database manipulation, judge whether to need the access waiting for the row that described line identifier is corresponding to terminate; If so, then perform wait, the access of the row that described line identifier is corresponding by the time terminates, then performs following step; If not, continue to perform following step;
Access control subelement, for the type according to described database manipulation, judges whether to need to obtain the access control to row corresponding to described line identifier, is if so, then that the row that described line identifier is corresponding adds access control;
Operation performs subelement, for sending to described target database to perform described database manipulation;
Result returns subelement, for returning the execution result of described database manipulation to the requesting party of described distributed transaction.
Optionally, described operation execution unit also comprises:
Operation overtime process subelement, for when not receiving the execution result that target database returns within the time preset, obtains the execution result of described database manipulation by the mode of active access destination database.
Optionally, the action type that described action type acquisition subelement obtains comprises: newly-increased operation, renewal rewards theory, deletion action or read operation.
Optionally, described line identifier acquisition subelement comprises:
Line identifier distributes subelement, for when the type of described database manipulation is for newly-increased operation, is the line identifier of described newly-increased operation distribution this row of unique identification, and is added to by described line identifier in newly-increased operation;
Line identifier inquiry subelement, for described database manipulation being resolved to the query manipulation of the acquisition line identifier adopting the same terms, and send to described target database to perform described query manipulation, the line identifier that the line identifier described target database returned affects as described database manipulation.
Optionally, described wait subelement specifically for, when the type of described database manipulation be newly-increased operation or query manipulation time, do not perform wait; When the type of described database manipulation be renewal rewards theory or deletion action time, if not by the transactions access outside current distributed transaction before the trade that described line identifier is corresponding, though or by the transactions access outside current distributed transaction but less than locked, then do not perform wait, otherwise perform wait.
Optionally, described access control subelement specifically for, when the type of described database manipulation be newly-increased operation, renewal rewards theory or deletion action time, allow to perform query manipulation for row that described line identifier is corresponding adds but do not allow to perform the process lock of newly-increased operation, renewal rewards theory and deletion action.
Optionally, described operation execution unit also comprises:
Query manipulation reconstruct subelement, during for being query manipulation when the type of described database manipulation and there is the row of the affairs locking outside by current distributed transaction in described line identifier, re-constructs query manipulation.
Described query manipulation reconstruct subelement comprises:
Lock line action type obtains subelement, for the type of database manipulation performed before obtaining the described locked trade;
Querying condition checking subelement, for when the type of the database manipulation performed before the described locked trade is for newly-increased operation, is designated as discontented sufficient querying condition by described locked rower; When the type of the database manipulation performed before the described locked trade is renewal rewards theory or deletion action and described locked row met the condition of described query manipulation before performing current renewal rewards theory or deletion action, record meets the row of the condition of described query manipulation, otherwise, described locked rower is designated as discontented sufficient querying condition;
Query manipulation generates subelement, for generate eliminate described in do not meet the query manipulation of the line identifier of querying condition;
Accordingly, described operation performs subelement specifically for sending to described target database to perform the query manipulation re-constructed.
Accordingly, described result return subelement specifically for, by the execution result of described query manipulation, merges with the row meeting the condition of described query manipulation recorded, and the result after merging is returned to the requesting party of described distributed transaction.
Optionally, described device also comprises:
Data write unit, the relevant information write for the database manipulation relevant information of described distributed transaction and described distributed transaction comprised identifies in corresponding internal storage data with described distributed transaction.
Optionally, described affairs clearing cell comprises:
Unlock subelement, and the row execution for locking described distributed transaction unlocks operation;
Data dump subelement, for deleting described distributed transaction mark and the internal storage data relevant to described distributed transaction.
Optionally, described device also comprises:
Rollback unit, for obtaining the execution result of database manipulation, when certain database manipulation in described distributed transaction fails to run succeeded, rolling back action is performed to other database manipulations of the successful execution in described distributed transaction, returns to the state before the execution of described distributed transaction.
Optionally, described device also comprises:
Exception processing unit, for judging the duration of described distributed transaction, if described distributed transaction fails to complete within the time preset, then triggers exception handler and performs rolling back action.
Optionally, described device also comprises:
Log management unit, for writing the implementation of described distributed transaction and described distributed transaction in journal file the amendment that target database is made.
Optionally, described device also comprises:
Transaction recovery unit, for reading described journal file, and according to the information of the distributed transaction recorded in described journal file, performs rolling back action to the distributed transaction not yet completed.
Compared with prior art, the application has the following advantages:
The implementation method of the integration across database distributed transaction adopting the application to provide, by using unique line identifier in target database system, and adopt access control mechanisms to carry out unified management to the accessing operation of distributed transaction, avoid the problem causing data inconsistent to the asynchronous operation of target database, achieve lightweight, be easy to safeguard and meet the integration across database distributed transaction of ACID principle.
A kind of preferred implementation that the application provides, by adding process lock to the write operation (comprising newly-increased operation, renewal rewards theory and deletion action) in distributed transaction, that is: other distributed transactions are allowed to read the row of described write operation impact but write operation can not be performed to described row, additionally use the mode of reconstruct query statement, Fusion query result simultaneously, avoid reading the process data that other affairs are not yet submitted to, thus while realizing " reading to submit to " isolation level of integration across database distributed transaction, also obtain good concurrency effect.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the embodiment of the implementation method of the integration across database distributed transaction of the application;
Fig. 2 is the schematic diagram of the embodiment of the implement device of the integration across database distributed transaction of the application.
Embodiment
Set forth a lot of detail in the following description so that fully understand the application.But the application can be much different from alternate manner described here to implement, those skilled in the art can when doing similar popularization without prejudice to when the application's intension, and therefore the application is by the restriction of following public concrete enforcement.
In this application, provide a kind of implementation method of integration across database distributed transaction, additionally provide a kind of implement device of integration across database distributed transaction simultaneously, be described in detail one by one in the following embodiments.
Please refer to Fig. 1, it is the schematic flow sheet of the embodiment of the implementation method of a kind of integration across database distributed transaction of the application.Described method comprises the steps:
Step 101: the startup request receiving distributed transaction, and be that described distributed transaction distributes Transaction Identifier.
The implementation method of the integration across database distributed transaction that the application provides, by taking centralized control to the Concurrency Access of multiple target database, achieving based on the distributed affair mechanism called, meeting the ACID principle of affairs.In order to understand the technical scheme of the application better, first concise and to the point description is done to the concept of affairs and distributed transaction.
The logical process that so-called affairs one of being made up of a series of database manipulation is complete is an indivisible operating unit.In relational database, affairs can be SQL statement, also can be one group of SQL statement or even whole program.By affairs, one group of operation that logic is relevant binds together, to keep integrality and the consistance of data.Such as bank transfer, from former account amount deducted, and adds the amount of money to target account, and the summation of these two database manipulations forms a complete logical process, and can not be split, this process is called as affairs.
Affairs must meet four characteristics: atomicity (Atomicity), consistance (Consistency), isolation (Isolation, also known as independence), persistence (Durability), are called for short the ACID characteristic of affairs.
So-called atomicity, refers to that affairs must be atom-work units, for its data modification, or all performs, or all do not perform, and affairs only can not perform half and just stop.Why require affairs Atomicity, be because the operation associated with certain affairs has common target usually, and be complementary, if system only performs a subset of these operations, then may destroy the overall goal of affairs, cause the situation occurring that data are inconsistent.Atomicity eliminates the possibility of system process operation subset.But in fact the requirement of atomic operation is difficult to be guaranteed, the problem of often encountering because the damage of hardware or other factors cause the operation in affairs to be interrupted, therefore, in the Database Systems of routine, transaction rollback mechanism and journaling techniques is usually adopted to realize the atomicity of affairs.On the one hand, if any one SQL statement performs failure in affairs, the SQL statement so run succeeded in these affairs also must be cancelled, and make database positioning return back to the state before performing affairs, this process is just called transaction rollback mechanism; On the other hand, the renewal that log recording affairs are done database is adopted, if during system generation catastrophic event, just can according to daily record, cancel the renewal that affairs have been done to database, make database return to the original state before performing affairs, thus ensure the atomicity of affairs.
Consistance refers to, after terminating with affairs before the transaction started, the integrity constraint of database is not destroyed, affairs are when completing, all data must be made still to be consistent state, and such as, integrity constraint requires a+b=10, if affairs change a, so b also should change thereupon.If Database Systems break down in running, some affairs not yet completes and is just forced to interrupt, the amendment that database is made of these affairs not yet completed some write physical database, at this moment database is just in a kind of incorrect state, or perhaps inconsistent state.The consistance of visible affairs and the atomicity of affairs are closely-related, when there is not many transaction concurrencies, can think like this, if the process of each database manipulation to data in affairs is correct, and the execution of affairs meets the requirement of atomicity, we just can think that the consistance of data is not destroyed, and affairs meet conforming requirement.
But under the scene performed at multiple transaction concurrency, even if each affairs can keep atomicity and consistance, because these affairs may access identical data, and their operation may intersect execution in certain mode not expected, causes data to occur inconsistent state.Therefore affairs be also been proposed to the requirement meeting isolation.
Isolation, refers in concurrent environment, and when different affairs handle identical data simultaneously, each affairs have respective relatively independent, relatively complete data space.The amendment made by concurrent transaction must be isolated to a certain extent with being modified in of doing of any other concurrent transaction, that is: can not interfere with each other between each affairs of concurrence performance, there are other affairs in the imperceptible system of each affairs in execution, thus also just can ensure the consistance of database.Data base management system (DBMS) adopts lock mechanism to realize the isolation of affairs usually.The isolation level of affairs is divided into four classes usually: read not submit (read uncommitted) to, read to submit (readcommitted), repeatable read (read repeatable), serializability (serializable) to.
Persistence refers to, after affairs complete, it is permanent for the impact of system.That is: once affairs successfully terminate, it just must get off by persistence to the renewal that database does, even if system or medium break down, the even catastrophic event such as generation systems collapse, after system restart, database can also return to the state at the end of affairs success.The redundant backup function that persistence can be provided by Database Systems and Restoration Mechanism ensure.
So-called distributed transaction is then the new ideas occurred on the basis of above-mentioned affairs, specifically refer to, the participant of affairs, the server of support affairs, Resource Server and task manager lay respectively on the different nodes of different distributed systems, also namely: distributed transaction is the affairs affecting multiple resource.Integration across database distributed transaction described in the application, refer to that the execution of distributed transaction will cross over multiple different target data base resource, the situation of the identical target data base resource of different transaction concurrencies can be there is in nature, in order to ensure the data consistency in whole target data base resource, the ACID attribute forcing integration across database distributed transaction to meet affairs is necessary.Also can understand like this, evaluate affairs and whether support distributed calling, mainly see whether the ACID principle of affairs in its distributed invoked procedure meets, this is also the core place of technical scheme.
For convenience of description, in the present embodiment, by implementing the module of the implementation method of the integration across database distributed transaction that the application provides, application or system, referred to as tracking layer.
The implementation method of the integration across database distributed transaction adopting the application to provide, when operation system has the processing demands of distributed transaction, do not need to send directly to each target database each database manipulation comprised in its distributed transaction, but the startup request of distributed transaction is first sent to tracking layer, after tracking layer receives the startup request of this distributed transaction, for these affairs create a new Transaction Identifier, and this Transaction Identifier is returned to the operation system proposing startup request, thus complete the operation distributing Transaction Identifier.In addition, in the data that the Transaction Identifier write tracking layer newly created also will be safeguarded by tracking layer (about the explanation of tracking layer data see the relevant portion in step 102), and in the follow-up implementation of this distributed transaction, use described Transaction Identifier to distinguish mutually with other distributed transactions.Concrete tracking layer can adopt multi-thread mechanism to realize the management of multiple concurrent transaction in force, that is: tracking layer is that each distributed transaction creates a new thread, is responsible for the follow-up relevant treatment of the distributed transaction corresponding with it and operation by this thread.
Operation system sends the startup application of distributed transaction to tracking layer, and mutual between follow-up and tracking layer, can be realized by function call, message mechanism and the various ways such as to connect.In order to ensure that operation system can set up exchange channels with tracking layer, can by the function interface of necessity, tracking layer address information and the code inside of the information hardnesses such as required user name, password in operation system that connects, also mode more flexibly can be adopted, by in above-mentioned information write configuration file, each operation system, by reading the information in configuration file, sets up exchange channels with tracking layer.These interaction mechanisms are not the cores of the application, and the application does not do concrete restriction.
Step 102: receive the operation requests for database manipulation or the operation requests set that are assigned with the distributed transaction of Transaction Identifier.
After completing steps 101, operation system obtains the mark of distributed transaction needing to perform, and just can send the operation requests of described distributed transaction for database manipulation to tracking layer.Only can comprise a database manipulation in a distributed transaction, also can comprise one group of database manipulation that is mutually related.The database manipulation that described distributed transaction can comprise by operation system sends to tracking layer once, and tracking layer processes the database manipulation of reception one by one, and by operation result uploading operation system; Operation system also can only send a database manipulation at every turn, issues next database manipulation again after receiving the execution result that tracking layer returns.These two kinds of embodiments can realize the technical scheme of the application.
Realize the integration across database distributed transaction that the application provides, tracking layer needs to learn which database manipulation each distributed transaction comprises, and these database manipulations are on the impact of database resource, like this make a mistake or abnormal time could realize the rollback function of affairs, ensure the atomicity of affairs; In addition, in order to realize the access control of each concurrent transaction to target data base resource, tracking layer also needs to know that the database manipulation of the current execution of each distributed transaction relates to the access to which database resource, and whether these database resources are by information such as other distributed transaction access, and carry out corresponding access control according to these information, the operating collision between different affairs can be avoided, ensure consistance and the correctness of data.In addition, tracking layer also will be distinguished and unified management multiple concurrent distributed transaction, therefore tracking layer needs the details of depositing the database manipulation that middle maintenance comprises about distributed transaction and distributed transaction within it, and this is also realize the indispensable part of technical scheme.
The data that tracking layer is safeguarded are divided three classes, a class global data, and a class is the data that affairs are relevant, also has a class to be the data relevant to database manipulation.Global data comprises: target database description, transaction list, affairs clearance time etc.; Affairs related data, for recording the information of each affairs, comprising: the time-out of Transaction Identifier, database manipulation set that each affairs comprise, affairs is arranged, the executing state etc. of affairs; The data that database manipulation is correlated with, for recording the details of each database manipulation, comprising: the type etc. of the database data content before the line identifier of target data library information, impact, write operation (comprising renewal rewards theory and deletion action) perform, access control, data base manipulation statement, database manipulation.
In an object lesson of the present embodiment, target database system is the relevant database supporting SQL operation, operation system sends to the database manipulation of tracking layer to be exactly concrete SQL statement, access control is realized (this part illustrates the relevant portion referred in step 103) by lock mechanism, and the data that tracking layer is safeguarded are as shown in the table:
Table one: global data
Table two: affairs related data
Table three: database manipulation related data
Tracking layer, to the maintaining method of above-mentioned data and using method, has further instruction in the description below.Data in upper table are only the data in an object lesson of the present embodiment; in other embodiments; tracking layer can safeguard the data being different from table; also other data can be increased newly; as long as it is just passable to the regulatory requirement of distributed transaction to meet tracking layer, specifically safeguard the type of which data and data, these are to the change of embodiment; do not depart from the core of the application, all within the protection domain of the application.
In this step, after the database manipulation request that tracking layer receives described distributed transaction or operation requests set, by data corresponding with described distributed transaction for the relevant information of described database manipulation write tracking layer.In an object lesson of the present embodiment, the SQL statement of reception is added in an array element of SQL set by tracking layer.
Step 103: for each operation requests, obtains the target data library information of described database manipulation, and follow ACID principle described database manipulation is sent to described target database perform.
The implementation method of the integration across database distributed transaction that the application provides, its target is exactly the distributed transaction realizing meeting ACID principle.Wherein, atomicity machine-processed and log mechanism realization by the rollback of tracking layer of affairs, persistence passes through the functional realiey such as the redundancy backup of target database system, and the operation in this step is mainly by the access control to concurrent transaction, and the isolation realized in multiple concurrent transaction implementation, thus ensure the consistance of data.This step is the core of technical scheme.For the ease of understanding, below first to the subject matter that concurrent transaction exists, and isolation level makes brief description.
Concurrent transaction may handle the identical data in same target database simultaneously, and therefore the inconsistent problem of data can occur, and these problems comprise: lose upgrade, dirtyly to read, non-repeatable read and illusion read.
A) lose renewal: when two or more affairs select the same a line in database, when then upgrading this row based on initial selected value, can occur to lose replacement problem.Each affairs do not know the existence of other affairs.Last renewal will rewrite the renewal done by other offices, and this will cause loss of data.
B) dirtyly to read: just refer to when affairs are just at visit data, and revise data, and this amendment is not also submitted in database, at this moment, another one affairs also access these data, then employ this data.Because these data are the data also do not submitted to, these data that so another one affairs are read are process data (also referred to as dirty data), and the operation done according to this process data may be incorrect.
C) non-repeatable read: in same affairs, needs the same data of twi-read, and between twi-read, other affairs may be had to change data, and the content causing first affairs twi-read to obtain is different.
D) unreally to read: in same affairs, read twice with same operation, and between twi-read, other affairs may be had to perform update, the record number causing twice inquiry of first affairs to obtain is not identical.
In order to solve the problems referred to above that concurrent transaction exists, on the one hand, require that concurrent transaction must conduct interviews control to the write operation of data (that is: renewal rewards theory, newly-increased operation or deletion action), that is: affairs are whenever only allowed to perform write operation to identical data, before these affairs are submitted to, prevent the data resource that other transactions modify are identical, this point is the basic demand to concurrent transaction access control, so just may avoid out the phenomenon that active upgrades.On the other hand, by the access control adopting different access control policies and increase read operation, solving the problem in above-mentioned other three in varying degrees, the different isolation level between concurrent transaction can that is be realized.
So-called isolation level refers to, the degree that affairs data change that must carry out with other affairs is isolated.Isolation level between usual concurrent transaction has following four kinds:
A) read not submit to (read uncommitted): this is minimum isolation level, under this isolation level, all affairs can be seen and read the data that other affairs not yet submit to.At this isolation level, may occur dirtyly reading, non-repeatable read and unreally to read, therefore this isolation level is rarely used in practical application.
B) read to submit (read committed) to: this is the isolated by default rank of most of Database Systems.It achieve so a kind of isolation: affairs can only see the change having submitted to office to make, that is: the data that view of affairs or be the state of another transactions modify before it, be the state of another transactions modify after it, affairs can not view the data of intermediateness.But when affairs perform read operation, the resource that other affairs may relate to this transactions read operations upgrades and submits to, therefore may there is non-repeatable read and the unreal problem read in this isolation level, and that is same query manipulation may return Different Results.
C) repeatable read (read repeatable): to guarantee in same affairs multiple operates in when reading data for this rank, can see same data line.This rank solves the problem of non-repeatable read, but performs newly-increased operation because other affairs can read in the process of data in these affairs, causes these affairs may occur the unreal problem read.
D) serializability (serializable, also referred to as serializability): this is the highest isolation level, it is by forcing transaction orderings, and making it can not mutually conflict, thus solves and unreally read problem.When affairs serializability, from one group can the result that obtains of the affairs of executed in parallel with by continuous run that each office obtains come to the same thing.
Lower isolation level can strengthen the ability of transaction concurrency data, but too increases concurrent spinoff that each affairs may run into (such as dirty read) possibility, that is may reduce integrality and the correctness of data.On the contrary, the type of concurrent spinoff of higher isolation level owing to decreasing affairs and may run into, therefore integrality and the correctness of data can be ensured better, but need the access control carrying out relative complex, too increase the possibility (other affairs must wait for that these affairs terminate) of other affairs of Transaction Blocking simultaneously, affect the concurrency performance of affairs.
Although serializability for affairs guarantee data in database free in correctness quite important, always but many affairs do not require to isolate completely.The expense of operation system to the requirement of data integrity and each isolation level should be considered, select corresponding isolation level on this basis.Reducing isolation level to exchange larger handling capacity for, is the conventional thinking of a lot of operation system.Owing to often isolation to be set to read to submit in the application process of reality, therefore in the present embodiment, a kind of preferred embodiment (referring to the description of this step subsequent) realizing reading the distributed transaction submitting isolation level to is provided.
It should be noted that, (access control described here is in specific implementation process to select Transaction service not affect for write operation and the access control that performs, lock mechanism is normally adopted to realize), always each affairs obtain lock and held this lock before affairs complete in its any data revised, be provided with which type of isolation level regardless of for these affairs.Can understand like this, isolation level mainly defines different protection levels for read operation, is subject to other offices does the impact changed to prevent the read operation of affairs.
The isolation level of affairs can be specified by operation system, such as: operation system can when each transmission affairs start request, and carry the parameter of specifying isolation level, tracking layer processes accordingly according to the requirement of operation system after receiving; Also fixing isolation level (such as: read to submit rank to) can be adopted to process by tracking layer.Choosing and adjusting of isolation level, all belongs to the concrete change of embodiment, does not affect the core of the application, all in the protection domain of the application.
Specific to the present embodiment, after the database manipulation request receiving distributed transaction, perform following 9 sub-steps, realize the integration across database distributed transaction that the application provides.
1) the target data library information of described database manipulation is obtained.
According to the schema information of described database manipulation, search the database description set in tracking layer global data, obtain the reference address of the database schema performing described database manipulation.In general, schema refers to tissue and the definition of database table, also can be understood as a level in a container or database object NameSpace, is mainly used to solve naming conflict problem.Conceptually, Database Systems can comprise multiple schema, and each schema comprises multiple database object (table, view, field etc.).The requesting party of described distributed transaction does not need the concrete reference address knowing target database, but is responsible for the target database address corresponding according to the schema acquisition of information of described database manipulation by tracking layer.
2) type of described database manipulation is obtained.
Read the data base manipulation statement received, therefrom obtain the type of described database manipulation.The type of described database manipulation comprises: renewal rewards theory, deletion action, newly-increased operation, query manipulation, wherein renewal rewards theory, deletion action and newly-increased operation belong to write operation, and query manipulation is usually said read operation.
3) resolve described database manipulation, obtain the line identifier of described database manipulation impact.
Line identifier is used to unique identification data row, in order to realize the method that the application provides, require the uniqueness ensureing line identifier in whole target database system, this point is also implement the key point of the method that the application provides, by using this line identifier, tracking layer can determine the unique a line in target database like clockwork, accordingly, also newly-increased special line identifier row are needed, such as rowEid when the table design carrying out target database.In order to realize the uniqueness of line identifier, this line identifier unification is by tracking layer-management.
If the type of described database manipulation is newly-increased operation, explanation will insert a newline in target database, tracking layer is that it creates a new line identifier, and this line identifier information is added in newly-increased operation, such as: described newly-increased operation is Insert statement as follows:
INSERT INTO TABLE_NAME(column1,column2)VALUES(values1,values2);
Tracking layer creates a line identifier 200 for this new line increment, and this line identifier information is added in this Insert statement, obtains the SQL statement of following newly-increased operation:
INSERT INTO TABLE_NAME(column1,column2,rowEid)
VALUES(values1,values2,‘200’);
If the type of described database manipulation is renewal rewards theory, deletion action or query manipulation, then need to perform the line identifier that following step obtains the impact of described database manipulation.
A) described database manipulation is resolved to the query manipulation of the acquisition line identifier adopting the same terms.
Data base manipulation statement does not normally carry the line identifier information of impact, therefore only has the query statement described data base manipulation statement being converted to the same terms, and goes to perform in target database, can return the line identifier of its impact.In an object lesson of the present embodiment, mode as follows is adopted to change:
For select*from table where queryCondition; Resolve to select rowEid fromtable where queryCondition;
For update table set xxxx where queryCondition; Resolve to select rowEid fromtable where queryCondition;
For delete from table where queryCondition; Resolve to select rowEid from tablewhere queryCondition.
B) described target database is sent to perform described query manipulation.
Target database is sent to perform the query manipulation after conversion.Sub-step 1 due to above) in obtained the target database address of described database manipulation, therefore directly to connect according to target database address, and send the query manipulation after described conversion.As for how to connect, can pass through ODBC Interface realization, other modes also can be adopted to realize, and concrete mode is not the core of the application, and the application is not construed as limiting.
C) line identifier that described target data returns is received, using the line identifier that the line identifier returned affects as described database manipulation.
The response of receiving target database, the line identifier that target database returns is exactly the line identifier of described database manipulation impact.In this step, also may occur the unresponsive abnormal conditions of destination server, can according to sub-step 8) in timeout treatment mode process, repeat no more herein.
In sum, if described database manipulation is newly-increased operation, new line identifier is obtained, if described database manipulation is renewal, deletion, query manipulation, then by performing the line identifier that one query operation obtains these operating influences to target database by the mode of unified distribution.After tracking layer obtains above-mentioned line identifier, can by the line identifier set of business-impacting of above-mentioned line identifier information write tracking layer and the line identifier set of database manipulation impact.
4) the current accessed state of row corresponding to described line identifier is obtained.
Why to obtain the line identifier of described database manipulation impact in above-mentioned steps, exactly in order to obtain the current accessed state of row corresponding to described line identifier further.The Access status of the row that described line identifier is corresponding, refers to currently whether there is the access control that other affairs obtain row corresponding to described line identifier, and the type etc. of access control.
In implementation process, affairs adopt lock mechanism to realize for the access control of row in database usually.Lock is a very important concept in database, and it ensures data base integrity and consistance under being mainly used in multi-user environment.So-called lock mechanism, exactly data resource (such as: certain a line in database or a few row) is associated with single affairs, and control other affairs and how to carry out mutual mechanism with this resource, we claim to hold or have this lock with the affairs of locked resource associations usually.Once obtain lock, just hold this lock before service termination, release lock during this service termination, other affairs just can use the data resource be unlocked, otherwise other affairs must be in waiting status always.
Lock is the main method realizing con current control, and particularly realizing the main method writing control, is that multiple affairs can be handled the data in same database simultaneously and the important leverage of the inconsistent phenomenon of data does not occur.When data identical during multiple affairs are simultaneously to database perform write operation (comprising: upgrade, delete, newly-built) time, the affairs of holder lock are only allowed to perform described write operation, other affairs must be waited for, until previous affairs release lock, other affairs just have an opportunity to continue to perform.Lock is also the main method of the isolation realizing affairs.Most of database, such as SQL Server and other relational data are by using locking to realize isolation mech isolation test.
The type of so-called access control, refers to the type of lock.In the implementation method of the integration across database distributed transaction provided in the application, relate generally to two kinds of locks: process lock and exclusive lock.So-called process lock refers to, if certain affairs adds process lock to its database manipulation, then do not allow the row that this database manipulation of other transactions modify affects, but allow other affairs to read the row of this database manipulation impact, that is, process lock ensures that only having a write operation at synchronization affects certain a line in database or a few row.So-called exclusive lock (also known as exclusive lock) refers to, not only do not allow the row that this database manipulation of other transactions modify affects, do not allow other affairs to read the row of this database manipulation impact simultaneously yet, that is, discharge the lock of described database manipulation at Current transaction before, the row that other affairs affect described database manipulation, can not revise and can not read.In concrete enforcement, to the process that database manipulation locks, exactly on described database manipulation affect row add lock mark process, see sub-step 6) in related description.
In an object lesson of the present embodiment, obtain the current accessed state of row corresponding to described line identifier, that the data safeguarded by searching tracking layer realize, concrete employing following steps: a) first search the data that the affairs of tracking layer maintenance are relevant, check described line identifier whether in the line identifier set of certain business-impacting, and record corresponding Transaction Identifier TransId; B) data that database manipulation corresponding to described Transaction Identifier is relevant are then searched, obtain the current accessed status information of row corresponding to described line identifier, comprise: whether type, the described row of accessing the database manipulation of row corresponding to described line identifier lock, and the type etc. of lock.
5) according to the current accessed state of row corresponding to described line identifier and the type of described database manipulation, judge whether to need the access waiting for the row that described line identifier is corresponding to terminate; If so, then perform wait, the access of the row that described line identifier is corresponding by the time terminates, then performs following step; If not, continue to perform following step.
This sub-step mainly judges whether described database manipulation exists read/write conflict with the operation of other concurrent transactions, if existed, then perform wait, after waiting other concurrent transactions to terminate, perform described database manipulation again, thus ensure consistance and the integrality of data.
In a kind of preferred implementation that the application provides, employing process lock realizes con current control, if that is certain affairs adds process lock to its database manipulation, then do not allow the row that this database manipulation of other transactions modify affects, but allow other affairs to read the row of this database manipulation impact.Therefore, if the type of described database manipulation is newly-increased operation or query manipulation, then do not need to wait for that the access of the row that described line identifier is corresponding terminates (because, newly-increased or query manipulation all can not revise the row of other business-impactings), that is: do not need to wait for that other affairs are released in the process lock that row corresponding to described line identifier adds; If the type of described database manipulation is renewal rewards theory or deletion action, then judge whether further to meet following condition:
A) do not accessed by other distributed transactions before the trade that described line identifier is corresponding, that is sub-step 4) in check described line identifier whether when the line identifier set of certain business-impacting, do not find the Trans_Id affecting described line identifier, although or find, but the affairs that this Trans_Id identifies are not other affairs, but are currently just preparing the affairs itself performing described database manipulation;
B) accessed by other distributed transactions before the trade that described line identifier is corresponding but do not have adding procedure to lock, that is sub-step 4) in check described line identifier whether when the line identifier set of certain business-impacting, have found other Transaction Identifiers Trans_Id being different from Current transaction mark, that is there are other affairs and accessing row corresponding to described line identifier, but adding procedure is not locked.
If meet above-mentioned a) or b) in any one condition, then do not need to wait for that the access of the row that described line identifier is corresponding terminates, that is: do not need to wait for that other affairs are released in the process lock that row corresponding to described line identifier adds; Otherwise, need to wait for that other affairs are released in the process lock that row corresponding to described mark adds.
Described waiting process, the blocking mechanism that system can be adopted to provide realizes, that is: the database manipulation of same for all requests resource (such as: require the same a line in the same target database of access) is sorted, be put in a queue, after the release of this resource, can notify that the request waited in request queue starts to perform.Different lock machines is shaped with different algorithms, the inside of the blocking mechanism that different system provides realizes also can be different, but these details are not within the consideration of technical scheme, a kind of embodiment that can provide above-mentioned blocking mechanism of main employing, the application does not do concrete restriction.
In the above-mentioned preferred implementation that the application provides, if described database manipulation is query manipulation, then do not need to wait for that other affairs are released in the process lock that row corresponding to described line identifier adds, the concurrent degree of affairs can be increased like this, but dirty reading may be there is, that is: current query manipulation may read the process data (or intermediate data) that other affairs are not yet submitted to, therefore the preferred implementation that provides of the application, for query manipulation, have employed reconstruct query manipulation, the processing mode of Fusion query result, thus achieve the isolation level of " reading to submit to ", avoid and occur the dirty phenomenon read, about this part explanation, refer to the explanation in sub-step 7.
In the preferred implementation that above-mentioned the application provides, employing process lock controls concurrent write operation.In other embodiments, also other access control schemes can be adopted.Such as, if will realize serializable isolation level, then need to use exclusive lock, that is, discharge the lock of described database manipulation in certain affairs before, the row that other affairs affect described database manipulation, can not revise and can not read.Therefore under the requirement of this isolation level, no matter described database manipulation is write operation or read operation, all more strict judgement will be carried out, if the line identifier of described database manipulation impact is current adopted the locking of exclusive lock by other affairs, so described database manipulation must perform wait, so just may realize serializable isolation level.
In order to realize serializable isolation level, except exclusive lock will be used, also need to consider there is the unreal problem read, that is:, in same affairs, read twice with same operation, and between twi-read, other affairs may be had to perform update, and the record number causing twice inquiry of first affairs to obtain is not identical, that is, other affairs may new mirage phantom is capable be inserted in certain data acquisition or table, and mirage phantom is capable is included in the follow-up reading of Current transaction.In order to avoid there is unreal situation about reading, can not simply use procedure lock or exclusive lock such row level lock, and need the lock mechanism that uses similar scope to lock, the data acquisition that may affect by the read operation in first affairs or table entirety lock, to prevent other affairs before these affairs complete by newline data inserting collection or table.Accordingly, in the judgement of this step, if described database manipulation is newly-increased operation, just needs the row judging this newly-increased operating influence whether to be within the scope of described scope lock locking, if so, then must perform wait.Serializability limits maximum rank in four isolation levels, and concurrent rank is lower, usually only under special application demand, just adopts this isolation level.
In the preferred implementation that the application provides, adopt the concurrent control mechanism of Kernel-based methods lock, in other embodiments, also can adopt other lock mechanism, such as above-described exclusive lock or scope are locked, and this is the change all belonging to embodiment, as long as the demand of operation system can be met, realize the con current control between distributed transaction, concrete which kind of lock mechanism of employing, the application does not do clear and definite restriction.
6) according to the type of described database manipulation, judging whether to need to obtain the access control to row corresponding to described line identifier, is if so, then that the row that described line identifier is corresponding adds access control.
If through deterministic process above, described database manipulation does not need to perform wait, that is: the line identifier of described data manipulation impact is not locked by other affairs; Or described database manipulation is in obstruction waiting status, and by the time other affairs are finished and release the locking of row corresponding to described line identifier, and under both of these case, all can forward this sub-step to and perform, be that the row that described line identifier is corresponding adds access control.
Mentioned above, in order to solve the problems such as the renewal loss of concurrent transaction existence, require that concurrent transaction must conduct interviews control to the write operation of data (that is: renewal rewards theory, newly-increased operation or deletion action), that is: affairs are whenever only allowed to perform write operation to identical data, this point is the basic demand to concurrent transaction access control, so just may ensure consistance and the integrality of data.In concrete implementation process, the row corresponding for described line identifier adds access control, is normally realized by lock mechanism, that is: for the row that described line identifier is corresponding adds locking mark.
In an object lesson of the present embodiment, by writing concrete locking information in " lock " data item in the database manipulation related data safeguarded at tracking layer, the locking of the row that the line identifier that realization affects described database manipulation is corresponding, that is: for the row that described line identifier is corresponding with the addition of locking mark.
In a kind of preferred implementation that the application provides, employing process lock realizes access control to write operation, if that is: the type of described database manipulation is newly-increased operation, renewal rewards theory or deletion action, is then the row adding procedure lock that described line identifier is corresponding; If the type of described database manipulation is query manipulation, then it need not be the row adding procedure lock that described line identifier is corresponding.
In other embodiments, also other lock mechanisms can be adopted to realize access control, such as, exclusive lock can be added for the newly-increased operation in Current transaction, renewal rewards theory or deletion action, thus other affairs can not access the row (no matter other affairs are write or read) of these operating influences in these affairs simultaneously, the process data (intermediate data) other affairs can being avoided to read these affairs not yet submit to, thus realize the isolation level of " reading to submit to ", the rank of isolation is that is improve by reducing concurrency; Again such as: can be the query manipulation also adding procedure lock in Current transaction, thus avoid the row that the query manipulation in other transactions modify Current transaction affects, ensure in Current transaction twice inquiry in the front and back of going together mutually, its Query Result is consistent, namely achieves the isolation level of " repeatable read ".The change of above-mentioned embodiment; can determine no matter take which kind of mode based on the different demands of operation system, as long as meet the demand of operation system to isolation level; do not depart from the core of technical scheme described in the application, all within the protection domain of the application.
7) query manipulation is re-constructed.
If described database manipulation is query manipulation, and tracking layer adopts process to be locked into row con current control, if so directly perform query manipulation, just likely read the process data that other affairs are not yet submitted to, that is: only can realize the isolation level of minimum " reading not submit to "; If adopt exclusive lock to carry out con current control, although the isolation level of " reading to submit to " can be realized, but the concurrent effect of eventful business can be affected, therefore this application provides a kind of preferred implementation, take the mode constructing query manipulation, Fusion query result, while employing process is locked into row con current control, achieve the isolation level of " reading to submit to ".
Therefore the preferred implementation that provides of the application, before being sent to by described database manipulation described target database to perform, if described database manipulation is query manipulation, and in sub-step 4) in the Access status of described line identifier that obtains be, other affairs with the addition of process lock to the row in described line identifier, so need to perform following steps reconstruct query manipulation:
The type of the database manipulation performed before a) obtaining the described locked trade.
In sub-step 4) in, by searching affairs related data and the database manipulation related data of the maintenance of tracking layer, obtain the current accessed status information of row corresponding in described line identifier, the type of the database manipulation performed before therefrom obtaining the trade being added process lock.In an object lesson of the present embodiment, the line identifier of described query manipulation impact is 100,101,102, by searching the affairs related data of tracking layer, find that there is other affairs T1 are just being designated 100 row in access line, search the SQL statement set that affairs T1 is corresponding further, therefrom have found the SQL statement that current accessed line identifier is the row of 100, affairs T1 can be seen for this row with the addition of process lock, and the type of described SQL statement can be obtained further, and carry out process below.
If the type of the database manipulation b) performed before the described locked trade is newly-increased operation, described locked rower is designated as discontented sufficient querying condition; If the type of the database manipulation performed before the described locked trade is renewal rewards theory or deletion action, then judge whether described locked row met the condition of described query manipulation before performing current renewal rewards theory or deletion action further, if so, then record meets the row of the condition of described query manipulation; Otherwise, described locked rower is designated as discontented sufficient querying condition.
Operation is herein mainly in order to realize the isolation level of " reading to submit to ".If other affairs do not complete the operation to described lock line, that is: not yet submit to, although so current query manipulation can access this part row locked by other affairs, should not obtain its intermediate data, but should obtain other affairs described not yet perform before data.
If the type of the database manipulation performed before the described locked trade is newly-increased operation, so no matter newly-increased whether row meet the condition of described query manipulation, all should be designated and do not met querying condition, because new line increment is the intermediate data of other affairs described.
If the type of the database manipulation performed before the described locked trade is renewal rewards theory or deletion action, then read the content of the former database row of described locked row before the current renewal rewards theory of execution or deletion action that tracking layer stores further, and judge whether this content meets the condition of described query manipulation, if, then record former database row, otherwise, by locked line identifier for not meet querying condition.Even if meet the condition of described query manipulation after performing current renewal rewards theory to the row be locked, can not it can be used as the result meeting querying condition, because described renewal rewards theory is not submitted to, the row after its renewal is the intermediate data of other affairs.
In the above-mentioned object lesson of the present embodiment, the line identifier of described query manipulation impact is 100,101,102, wherein other affairs T1 are accessing and are locking the row that line identifier is 100, and T1 affairs to described line identifier be 100 row perform be renewal rewards theory, and described line identifier is the row of 100, its content performed before renewal rewards theory does not meet the condition of described query manipulation, be then that the rower of 100 is designated as discontented sufficient querying condition by line identifier.
C) generate eliminate described in do not meet the query manipulation of the line identifier of querying condition.
According to above-mentioned result, reject do not meet querying condition line identifier, regenerate query manipulation statement.In the above-mentioned example of the present embodiment, described query manipulation is: select*from table wherequeryCondition, because row 100 is identified as do not meet querying condition, the query manipulation after therefore re-constructing is: select*from table where queryCondition and rowEid no in (' 100 ').
Implement the above-mentioned step re-constructing query manipulation, be the isolation level in order to realize " reading to submit to " employing process is locked while, the step performing above-mentioned reconstruct query manipulation is not needed for renewal rewards theory, deletion action, newly-increased behaviour's lock.For other embodiments, owing to may adopting different lock mechanisms and realizing different isolation levels, therefore the above-mentioned reconstruct sub-step performed for query manipulation is not required.
8) described target database is sent to perform described database manipulation.
Through 7 sub-steps above, complete necessity process operation carried out required for before described database manipulation is sent to target database, comprise: alllocated lines identifies, perform wait, add access control, reconstruct the pre-service such as query manipulation, so just can target database be sent to go to perform the query manipulation of described database manipulation or reconstruct.
In order to safeguard the information of each distributed transaction in the unification of tracking layer, and the specifying information of database manipulation that each distributed transaction comprises, need before the described database manipulation of execution, the information relevant to described database manipulation is write in the data of tracking layer, comprise: the line identifier set of described database manipulation impact, if described database manipulation is write operation also to record this operation perform before the content of former database row, the executing state of described database manipulation, whether described database manipulation adds lock, and the type of lock, perform the start time etc. of described database manipulation.Usually, directly described database manipulation is added in the database manipulation set of described distributed transaction as the new member of in described distributed transaction, if the row of described database manipulation impact is identical with the row that certain database manipulation performed before described distributed transaction affects, such as: former and later two database manipulations in described distributed transaction are all the same a line in the same target database of amendment, so described database manipulation can not additionally take new storage space, but adopt the related data of the previous database manipulation of suitable policy update.
Not only needed to upgrade tracking layer related data before the described database manipulation of execution, also the operation of tracking layer data should be upgraded accordingly on other opportunitys, such as: after tracking layer receives certain database manipulation request, the statement of this database manipulation should be recorded, and record its executing state for " pending ", after obtaining the type of described database manipulation, corresponding record should be carried out, before described database manipulation being sent to target database execution, upgrade the executing state of described database manipulation for " in execution ", and record starts the time of execution, after target database returns successful respond, the executing state then upgrading described database manipulation is " running succeeded ".Record the distributed transaction of current execution and the related data of database manipulation, that tracking layer can the basis of the multiple distributed transaction of unified management, different embodiments may be taked different data structures, also can take the opportunity of different more new datas, as long as each affairs and the current state of database manipulation correctly can be recorded, the details of embodiment, be not the core of the application, the application does not do concrete restriction.
Then the query manipulation of described database manipulation or reconstruct is sent to target database execution, and wait for the response of target database, usual target database is finished described database manipulation, execution result will be returned to tracking layer, but consider under the scene of integration across database distributed transaction, tracking layer and target database is not usually in same physical location, connected by network to carry out alternately between the two, therefore unavoidably may occur because target database faults itself or network connect the response time-out phenomenon that the reasons such as brief interruption cause, that is: tracking layer does not receive the response of target database within one period of time interval preset.The time interval preset, can be the predefined unified value (such as: 100ms) of tracking layer, also different values can be set the feature different according to each database manipulation, in the present embodiment, have employed the implementation of the latter, that is: in the database manipulation related data of tracking layer maintenance, an item number is had according to " Proactive authentication mistiming ", after the request receiving described database manipulation, can according to the type of described database manipulation for it arranges this value, such as: for the query manipulation that will return mass data, a larger value can be set, relatively little value can be set to for the renewal rewards theory only revising a line.If tracking layer sends the order performing described database manipulation to target database after, tracking layer detects that the difference of the time that current time and " Starting Executing Time " record is greater than the value that " Proactive authentication mistiming " set, tracking layer can judge that described database manipulation may break down, and at this moment tracking layer can adopt the mode of active inquiry to obtain the implementation status of this database manipulation.
9) execution result of described database manipulation is returned to the requesting party of described distributed transaction.
The execution result of the described database manipulation that receiving target database returns, and described result is sent to the requesting party of described distributed transaction.
For a kind of preferred implementation that the application provides, in order to realize the isolation level of " reading to submit to ", for query manipulation in sub-step 7) in re-constructed query manipulation, accordingly, in this sub-step, also should returning results according to the query manipulation re-constructed, perform necessary merging treatment, that is: by the execution result of described reconstruct query manipulation, merge with the row meeting the condition of described query manipulation recorded, and the result after merging is returned to the requesting party of described distributed transaction.In an object lesson of the present embodiment, if in sub-step 7) in, tracking layer have recorded 10 data (that is: having 10 row to meet querying condition) in the set of the former database row satisfied condition, the query manipulation re-constructed being sent to when inquiring about in target database table and returning again 10, so just needing the requesting party by returning to described database manipulation after these 20 aggregation of data at tracking layer.
Under normal circumstances, target database can correctly perform described database manipulation, and return successful operation response, but also do not get rid of and may occur target database execute exception and the situation returning operation failure response to tracking layer, tracking layer adopts rollback mechanism to ensure the atomicity of distributed transaction, consistance and persistence in this case.
Because affairs are database manipulation sequences that one group of logic is relevant, be an indivisible operating unit, for database manipulation wherein, all perform, all do not perform, affairs only can not perform half and just stop, and this is also the basic demand of transaction atomicity.If certain point in affairs breaks down, then all more new capital that this office does should return to the state before affairs start.
Realize the atomicity of affairs, usual employing rollback (rolling back) mechanism, so-called rollback refers to, cancel the amendment that in unsuccessful affairs, executed database manipulation is done data, that is, if any one database manipulation performs failure in affairs, the database manipulation so run succeeded in these affairs also must be cancelled, and makes database positioning return back to the state before performing affairs.The realization of rollback, can adopt the mode of similar inverse operation usually, that is: cancel newly-increased operation, perform corresponding deletion action; Cancel deletion action, perform corresponding increasing newly and operate; Cancel renewal rewards theory, perform the renewal rewards theory recovering raw data.As can be seen here, in order to realize rollback mechanism, the content of the database data before write operation execution must be preserved.Tracking layer is in the data that its database manipulation safeguarded is relevant, there is an item number according to " the database data content before write operation execution ", why design this data item, being the reconstruct query manipulation for realizing " reading to submit to " isolation level on the one hand, is exactly the rollback mechanism in order to realize affairs on the other hand.
There is exception in the process of implementation in described distributed transaction, so tracking layer can after the requesting party this result being returned to described distributed transaction, initiatively perform rolling back action, also can wait for that the requesting party of described distributed transaction performs rollback after issuing the order starting rolling back action again, these two kinds of modes can ensure the atomicity of described distributed transaction.Tracking layer performs rolling back action by following step:
A) upgrade tracking layer data, the executing state of described distributed transaction be updated to " in rollback ", the executing state of the database manipulation of being cancelled by needs all in described distributed transaction is all updated to " treating rollback ";
B) for each database manipulation to be cancelled, according to the content of " the database data content before write operation execution " data item, construct the inverse operation of described database manipulation or recover the renewal rewards theory of data original contents, being then sent to target database and performing.Upgrade the state of described database manipulation before execution for " in rollback ", perform and terminate its state of rear renewal for " rollback success ";
C) message that the requesting party to described distributed transaction reports " rollback success ", inform the requesting party of described distributed transaction, described distributed transaction is cancelled.Certainly, as a kind of abnormal conditions, rolling back action also may be failed, in this case tracking layer also unautogenously can take action, but this situation is reported the requesting party of described distributed transaction, then by the requesting party of described distributed transaction according to the rollback or remove the order of described distributed transaction again of the policy distribution of application layer.
Step 104: treat that all database manipulations are finished, remove described distributed transaction.
On the one hand, if all database manipulations in the described distributed transaction received all are finished by tracking layer, comprise and running succeeded and rollback success two kinds of situations, so tracking layer just can remove described distributed transaction; On the other hand, after the display terminated about the described distributed transaction instruction that tracking layer also can issue the described distributed transaction requesting party of reception, described distributed transaction is removed.
Remove described distributed transaction, mainly comprise the operation of following two aspects:
1) the row execution locked described distributed transaction unlocks operation.
Because tracking layer is in the implementation of described distributed transaction, in order to realize the access control of concurrent transaction and realize certain isolation level, have employed lock mechanism, therefore the row that the database manipulation in described distributed transaction affects may also be in the lock state at present, that is described distributed transaction possibility or holder of one or more lock, in this case, tracking layer needs the row to described distributed transaction locks to perform the operation unlocked, namely discharge the lock that described distributed transaction is held, other are blocked in above-mentioned other distributed transactions locked and just can terminate waiting status like this, and performed, thus ensure the normal operation of integration across database distributed transaction.
2) internal storage data of described distributed transaction mark and correspondence is deleted.
Because described distributed transaction is finished, therefore tracking layer needs to delete the data relevant to described affairs the tracking layer data safeguarded from it, comprise: the database manipulation set that the mark of described distributed transaction, executing state, described distributed transaction comprise and other data relevant to described distributed transaction, and delete described distributed transaction from the global transaction list that tracking layer is safeguarded.By clearing up the related data of completed distributed transaction, tracking layer can reclaim and manage its memory headroom used effectively, avoids the situation occurring consuming excessively memory headroom.
The processing procedure being described above the startup of integration across database distributed transaction, execution and terminating, in actual implementation process, also to consider some abnormal conditions that may occur, and necessary processing mode is set, even if thus ensure that tracking layer also can run well in abnormal cases and ensure the ACID characteristic of integration across database distributed transaction for abnormal conditions.Tracking layer can provide the exception handling of two kinds of ranks:
1) exception handling of database manipulation rank.After described database manipulation is issued target database by aforementioned tracking layer, may occur the situation of target database response time-out, at this moment tracking layer can obtain the actual implementation status of described database manipulation by the mode of active inquiry.This exception handling belongs to the exception handling of database manipulation rank.
2) other exception handling of transaction-level.Due to the feature of integration across database distributed transaction, the various problem being difficult to predict may be there is in described distributed transaction in the process performed, described distributed transaction is caused to occur the phenomenon of time-out, for this problem, tracking layer adopts following mechanism to process: tracking layer judges the duration of described distributed transaction, if find the described duration be greater than preset time (that is: tracking layer safeguard data in for each distributed transaction affairs time-out arrange), time-out of then dishing out is abnormal, after corresponding exception handler captures this exception, necessary process can be carried out according to the strategy preset, such as: the rolling back action etc. of initiating described distributed transaction.Certainly, above-mentioned affairs time-out is abnormal, a kind of abnormal conditions that just may occur in distributed transaction implementation, in concrete implementation process, abnormal for other that may occur, also can adopt similar processing mode, transfer to exception handler process.
In the implementation procedure of integration across database distributed transaction, except the above-mentioned abnormal conditions that may occur will be considered, also must consider that system catastrophic event may occur, such as to delay the accidents such as machine, certain distributed transaction may be caused only to perform partial database operation, make the data of target database be in inconsistent state.As a perfect integration across database distributed transaction, the ability processing above-mentioned catastrophic event must be possessed, that is: must can recover the data of the distributed transaction be not yet finished.Realize this point, usually need to adopt log mechanism, that is: a transaction log file is safeguarded at tracking layer, for recording the amendment that all affairs and each affairs are made target database, once system malfunctions, then the renewal that affairs have been done to target database is cancelled in use transaction journal, target database is returned to the consistent state before performing affairs.Tracking layer adopts the rollback mechanism and journaling techniques introduced to ensure the atomicity of distributed transaction, consistance and persistence above.
Realize journal function at tracking layer, need the operation of execution two aspect:
1) also care of transaction journal file is generated.By the related data of the distributed transaction that tracking layer is safeguarded, and the related data of each database manipulation writes in transaction log file in distributed transaction, in order to ensure that transaction log file correctly can reflect the executing state of distributed transaction, preferably adopt the mode of write transaction log file in real time, that is:, when tracking layer upgrades the data of its maintenance at every turn, also the content upgraded is write in transaction log file simultaneously.When certain distributed transaction is finished, tracking layer is while the data that cleaning is relevant to these affairs, also should delete the data of this distributed transaction relevant recorded in transaction log file, and the space of the transaction log file of recovery is used for the daily record data storing other distributed transactions.
2), when tracking layer restarts, load the Transaction Information in described journal file and carry out necessary rolling back action.
The catastrophic event such as machine once delay, tracking layer is in the process restarted, first read and load the data in journal file, recover the executing state of tracking layer distributed transaction before restart, and perform rolling back action for the distributed transaction not yet executed, cancel the renewal that this distributed transaction has done to target database, target database is returned to the original state before performing this distributed transaction, thus ensure the atomicity of affairs.Rolling back action in rolling back action described here and affairs implementation is similar, and concrete steps see the related description in step 103, can repeat no more herein.
When occurring abnormal, adopting rollback mechanism and log mechanism on the one hand, the atomicity of distributed transaction, consistance and persistence can be ensured; On the other hand, tracking layer also needs the Rational Maintenance mechanism considering himself data.Tracking layer have recorded the data relevant to distributed transaction and the data relevant with the database manipulation in distributed transaction, when distributed transaction normal termination, above-mentioned data can be cleared up in time by tracking layer, when occurring abnormal, above-mentioned data may pass into silence, thus become the invalid data taking tracking layer memory headroom, in order to provide cleaning mechanism to above-mentioned invalid data, the method that the application provides writes " affairs clearance time " this data item in the global data of tracking layer, for the affairs terminated of exception being cleaned out on specific time point.Specifically, tracking layer can scan the executing state of all distributed transactions that it is safeguarded on the affairs clearance time point of setting, if find that the state of this distributed transaction is not updated always, that is: this distributed transaction is in an inactive state, then tracking layer can initiatively initiate the operation of clearing up this distributed transaction.
The implementation method of the integration across database distributed transaction adopting the application to provide, by using unique line identifier in target database system, and adopt access control mechanisms to carry out unified management to the accessing operation of distributed transaction, avoid the problem causing data inconsistent to the asynchronous operation of target database, achieve lightweight, be easy to safeguard and meet the integration across database distributed transaction of ACID principle.
A kind of preferred implementation that the application provides, by adding process lock to the write operation (comprising newly-increased operation, renewal rewards theory and deletion action) in distributed transaction, that is: other distributed transactions are allowed to read the row of described write operation impact but write operation can not be performed to described row, additionally use the mode of reconstruct query statement, Fusion query result simultaneously, avoid reading the process data that other affairs are not yet submitted to, thus while realizing " reading to submit to " isolation level of integration across database distributed transaction, also obtain good concurrency effect.
In the above-described embodiment, provide a kind of implementation method of integration across database distributed transaction, correspond, the application also provides a kind of implement device of integration across database distributed transaction.Please refer to Fig. 2, it is the embodiment schematic diagram of the implement device of a kind of integration across database distributed transaction of the application.Because device embodiment is substantially similar to embodiment of the method, so describe fairly simple, relevant part illustrates see the part of embodiment of the method.The device embodiment of following description is only schematic.
The implement device of a kind of integration across database distributed transaction of the present embodiment, comprising: affairs start unit 201, for receiving the startup request of distributed transaction, and is that described distributed transaction distributes Transaction Identifier; Operation receiving element 202, for receiving the operation requests for database manipulation or the operation requests set of the distributed transaction being assigned with Transaction Identifier; Operation execution unit 203, for for each operation requests, obtains the target data library information of described database manipulation, and follow ACID principle described database manipulation is sent to described target database perform; Affairs clearing cell 204, for after described distributed transaction is finished, removes described distributed transaction.
Optionally, described operation execution unit obtains the target data library information of described database manipulation in the following way: the target database of specifying according to described database manipulation and/or the title of table, search the database description information pre-set, therefrom obtain the target data library information corresponding with the title of described target database and/or table.
Optionally, described operation execution unit comprises:
Target data library inquiry subelement, for the title of the target database of specifying according to described database manipulation and/or table, search the database description information pre-set, therefrom obtain the target data library information corresponding with the title of described target database and/or table;
Action type obtains subelement, for obtaining the type of described database manipulation;
Line identifier obtains subelement, for resolving described database manipulation, obtains the line identifier of described database manipulation impact;
Access status obtains subelement, for obtaining the current accessed state of row corresponding to described line identifier;
Wait for subelement, for according to the current accessed state of row corresponding to described line identifier and the type of described database manipulation, judge whether to need the access waiting for the row that described line identifier is corresponding to terminate; If so, then perform wait, the access of the row that described line identifier is corresponding by the time terminates, then performs following step; If not, continue to perform following step;
Access control subelement, for the type according to described database manipulation, judges whether to need to obtain the access control to row corresponding to described line identifier, is if so, then that the row that described line identifier is corresponding adds access control;
Operation performs subelement, for sending to described target database to perform described database manipulation;
Result returns subelement, for returning the execution result of described database manipulation to the requesting party of described distributed transaction.
Optionally, described operation execution unit also comprises:
Operation overtime process subelement, for when not receiving the execution result that target database returns within the time preset, obtains the execution result of described database manipulation by the mode of active access destination database.
Optionally, the action type that described action type acquisition subelement obtains comprises: newly-increased operation, renewal rewards theory, deletion action or read operation.
Optionally, described line identifier acquisition subelement comprises:
Line identifier distributes subelement, for when the type of described database manipulation is for newly-increased operation, is the line identifier of described newly-increased operation distribution this row of unique identification, and is added to by described line identifier in newly-increased operation;
Line identifier inquiry subelement, for described database manipulation being resolved to the query manipulation of the acquisition line identifier adopting the same terms, and send to described target database to perform described query manipulation, the line identifier that the line identifier described target database returned affects as described database manipulation.
Optionally, described wait subelement specifically for, when the type of described database manipulation be newly-increased operation or query manipulation time, do not perform wait; When the type of described database manipulation be renewal rewards theory or deletion action time, if not by the transactions access outside current distributed transaction before the trade that described line identifier is corresponding, though or by the transactions access outside current distributed transaction but less than locked, then do not perform wait, otherwise perform wait.
Optionally, described access control subelement specifically for, when the type of described database manipulation be newly-increased operation, renewal rewards theory or deletion action time, allow to perform query manipulation for row that described line identifier is corresponding adds but do not allow to perform the process lock of newly-increased operation, renewal rewards theory and deletion action.
Optionally, described operation execution unit also comprises:
Query manipulation reconstruct subelement, during for being query manipulation when the type of described database manipulation and there is the row of the affairs locking outside by current distributed transaction in described line identifier, re-constructs query manipulation.
Described query manipulation reconstruct subelement comprises:
Lock line action type obtains subelement, for the type of database manipulation performed before obtaining the described locked trade;
Querying condition checking subelement, for when the type of the database manipulation performed before the described locked trade is for newly-increased operation, is designated as discontented sufficient querying condition by described locked rower; When the type of the database manipulation performed before the described locked trade is renewal rewards theory or deletion action and described locked row met the condition of described query manipulation before performing current renewal rewards theory or deletion action, record meets the row of the condition of described query manipulation, otherwise, described locked rower is designated as discontented sufficient querying condition;
Query manipulation generates subelement, for generate eliminate described in do not meet the query manipulation of the line identifier of querying condition;
Accordingly, described operation performs subelement specifically for sending to described target database to perform the query manipulation re-constructed.
Accordingly, described result return subelement specifically for, by the execution result of described query manipulation, merges with the row meeting the condition of described query manipulation recorded, and the result after merging is returned to the requesting party of described distributed transaction.
Optionally, described device also comprises:
Data write unit, the relevant information write for the database manipulation relevant information of described distributed transaction and described distributed transaction comprised identifies in corresponding internal storage data with described distributed transaction.
Optionally, described affairs clearing cell comprises:
Unlock subelement, and the row execution for locking described distributed transaction unlocks operation;
Data dump subelement, for deleting described distributed transaction mark and the internal storage data relevant to described distributed transaction.
Optionally, described device also comprises:
Rollback unit, for obtaining the execution result of database manipulation, when certain database manipulation in described distributed transaction fails to run succeeded, rolling back action is performed to other database manipulations of the successful execution in described distributed transaction, returns to the state before the execution of described distributed transaction.
Optionally, described device also comprises:
Exception processing unit, for judging the duration of described distributed transaction, if described distributed transaction fails to complete within the time preset, then triggers exception handler and performs rolling back action.
Optionally, described device also comprises:
Log management unit, for writing the implementation of described distributed transaction and described distributed transaction in journal file the amendment that target database is made.
Optionally, described device also comprises:
Transaction recovery unit, for reading described journal file, and according to the information of the distributed transaction recorded in described journal file, performs rolling back action to the distributed transaction not yet completed.
Although the application with preferred embodiment openly as above; but it is not for limiting the application; any those skilled in the art are not departing from the spirit and scope of the application; can make possible variation and amendment, the scope that therefore protection domain of the application should define with the application's claim is as the criterion.
In one typically configuration, computing equipment comprises one or more processor (CPU), input/output interface, network interface and internal memory.
Internal memory may comprise the volatile memory in computer-readable medium, and the forms such as random access memory (RAM) and/or Nonvolatile memory, as ROM (read-only memory) (ROM) or flash memory (flash RAM).Internal memory is the example of computer-readable medium.
1, computer-readable medium comprises permanent and impermanency, removable and non-removable media can be stored to realize information by any method or technology.Information can be computer-readable instruction, data structure, the module of program or other data.The example of the storage medium of computing machine comprises, but be not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic RAM (DRAM), the random access memory (RAM) of other types, ROM (read-only memory) (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc ROM (read-only memory) (CD-ROM), digital versatile disc (DVD) or other optical memory, magnetic magnetic tape cassette, tape magnetic rigid disk stores or other magnetic storage apparatus or any other non-transmitting medium, can be used for storing the information can accessed by computing equipment.According to defining herein, computer-readable medium does not comprise non-temporary computer readable media (transitory media), as data-signal and the carrier wave of modulation.
2, it will be understood by those skilled in the art that the embodiment of the application can be provided as method, system or computer program.Therefore, the application can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the application can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.

Claims (17)

1. an implementation method for integration across database distributed transaction, is characterized in that, comprising:
Receive the startup request of distributed transaction, and be that described distributed transaction distributes Transaction Identifier;
Receive the operation requests for database manipulation or the operation requests set that are assigned with the distributed transaction of Transaction Identifier;
For each operation requests, obtain the target data library information of described database manipulation, and follow ACID principle described database manipulation is sent to described target database perform;
Treat that all database manipulations are finished, remove described distributed transaction.
2. the implementation method of integration across database distributed transaction according to claim 1, it is characterized in that, the target data library information of the described database manipulation of described acquisition specifically refers to, the target database of specifying according to described database manipulation and/or the title of table, search the database description information pre-set, therefrom obtain the target data library information corresponding with the title of described target database and/or table.
3. the implementation method of integration across database distributed transaction according to claim 1, is characterized in that, described in follow ACID principle described database manipulation is sent to described target database perform, comprising:
Obtain the type of described database manipulation;
Resolve described database manipulation, obtain the line identifier of described database manipulation impact;
Obtain the current accessed state of row corresponding to described line identifier;
The current accessed state of row corresponding according to described line identifier and the type of described database manipulation, judge whether to need the access waiting for the row that described line identifier is corresponding to terminate; If so, then perform wait, the access of the row that described line identifier is corresponding by the time terminates, then performs following step; If not, continue to perform following step;
According to the type of described database manipulation, judging whether to need to obtain the access control to row corresponding to described line identifier, is if so, then perform following step after the row interpolation access control that described line identifier is corresponding; If not, following step is performed;
Described target database is sent to perform described database manipulation;
Requesting party to described distributed transaction returns the execution result of described database manipulation.
4. the implementation method of integration across database distributed transaction according to claim 3, it is characterized in that, after performing the described step sending to described target database to perform described database manipulation, if do not receive the execution result that target database returns within the time preset, then obtained the execution result of described database manipulation by the mode of active access destination database.
5. the implementation method of integration across database distributed transaction according to claim 3, is characterized in that, the type of described database manipulation comprises: newly-increased operation, renewal rewards theory, deletion action or query manipulation.
6. the implementation method of integration across database distributed transaction according to claim 5, is characterized in that, the described database manipulation of described parsing, obtains the line identifier of described database manipulation impact, comprising:
If the type of described database manipulation is newly-increased operation, be then the line identifier of described newly-increased operation distribution this row of unique identification, and described line identifier is added in newly-increased operation;
Otherwise, perform following step:
Described database manipulation is resolved to the query manipulation of the acquisition line identifier adopting the same terms;
Described target database is sent to perform described query manipulation;
Receive the line identifier that described target database returns, using the line identifier that the line identifier returned affects as described database manipulation.
7. the implementation method of integration across database distributed transaction according to claim 5, it is characterized in that, the current accessed state of the described row corresponding according to described line identifier and the type of described database manipulation, judge whether to need the access waiting for the row that described line identifier is corresponding to terminate, specifically refer to:
If the type of described database manipulation is newly-increased operation or query manipulation, be then judged to not need the access waiting for the row that described line identifier is corresponding to terminate;
If the type of described database manipulation is renewal rewards theory or deletion action, whether do not accessed by the office outside current distributed transaction before then judging the trade that described line identifier is corresponding further, though or by the transactions access outside current distributed transaction but less than locked, if so, be then judged to not need the access waiting for the row that described line identifier is corresponding to terminate; Otherwise, be judged to need the access waiting for the row that described line identifier is corresponding to terminate.
8. the implementation method of the integration across database distributed transaction according to claim 5-7 any one, is characterized in that, the described type according to described database manipulation, and judging whether needs to obtain the access control to row corresponding to described line identifier, specifically refers to:
If the type of described database manipulation is newly-increased operation, renewal rewards theory or deletion action, be then judged to need to obtain the access control to row corresponding to described line identifier.
Accordingly, the described row being described line identifier is corresponding adds access control, specifically refers to, allows to perform for row that described line identifier is corresponding adds the process lock that query manipulation but do not allow performs newly-increased operation, renewal rewards theory and deletion action.
9. the implementation method of integration across database distributed transaction according to claim 8, it is characterized in that, before the described step sending to described target database to perform described database manipulation, perform following operation: if the type of described database manipulation is query manipulation, and there is the row of the affairs locking outside by current distributed transaction in described line identifier, then adopt following step to re-construct query manipulation:
The type of the database manipulation performed before obtaining the described locked trade;
If the type of the database manipulation performed before the described locked trade is newly-increased operation, described locked rower is designated as discontented sufficient querying condition;
If the type of the database manipulation performed before the described locked trade is renewal rewards theory or deletion action, then judge whether described locked row met the condition of described query manipulation before performing current renewal rewards theory or deletion action further, if so, then record meets the row of the condition of described query manipulation; Otherwise, described locked rower is designated as discontented sufficient querying condition;
Generate the query manipulation not meeting the line identifier of querying condition described in eliminating;
Accordingly, described described database manipulation is sent to described target database perform refer to, send to described target database to perform the query manipulation re-constructed.
Accordingly, the execution result that the described requesting party to described distributed transaction returns described database manipulation refers to, by the execution result of described query manipulation, merge with the row meeting the condition of described query manipulation recorded, and the result after merging is returned to the requesting party of described distributed transaction.
10. the implementation method of integration across database distributed transaction according to claim 9, is characterized in that, described method also comprises:
The relevant information write of the database manipulation relevant information of described distributed transaction and described distributed transaction comprised identifies in corresponding internal storage data with described distributed transaction.
The implementation method of 11. integration across database distributed transactions according to claim 10, it is characterized in that, the relevant information of described distributed transaction comprises: the Transaction Identifier of described distributed transaction, executing state and time-out are arranged;
The relevant information of the database manipulation that described distributed transaction comprises comprises: the type of the content of the row before the line identifier of target data library information, impact, renewal rewards theory or deletion action perform, lock status, executing state, Proactive authentication mistiming, data base manipulation statement and database manipulation.
The implementation method of 12. integration across database distributed transactions according to claim 11, is characterized in that, the described distributed transaction of described removing comprises:
The row execution locked described distributed transaction unlocks operation;
Delete described distributed transaction mark and the internal storage data relevant to described distributed transaction.
13. according to the implementation method of the arbitrary described integration across database distributed transaction of claim 1-12, and it is characterized in that, described method also comprises:
Obtain the execution result of database manipulation, if the arbitrary database manipulation in described distributed transaction fails to run succeeded, then rollback operation is performed to other database manipulations of the successful execution in described distributed transaction, return to the state before the execution of described distributed transaction.
The implementation method of 14. integration across database distributed transactions according to claim 1-12, it is characterized in that, described method also comprises:
Judge the duration of described distributed transaction, if the described duration is greater than the time preset, then triggers exception handler and process.
The implementation method of 15. integration across database distributed transactions according to claim 13, it is characterized in that, described method also comprises:
The implementation of described distributed transaction and described distributed transaction are write in journal file the amendment that target database is made.
The implementation method of 16. integration across database distributed transactions according to claim 15, it is characterized in that, described method also comprises:
Read described journal file, and according to the information of the distributed transaction recorded in described journal file, rollback operation is performed to the database manipulation of the successful execution in the distributed transaction not yet completed.
The implement device of 17. 1 kinds of integration across database distributed transactions, is characterized in that, comprising:
Affairs start unit for receiving the startup request of distributed transaction, and is that described distributed transaction distributes Transaction Identifier;
Operation receiving element, for receiving the operation requests for database manipulation or the operation requests set of the distributed transaction being assigned with Transaction Identifier;
Operation execution unit, for for each operation requests, obtains the target data library information of described database manipulation, and follow ACID principle described database manipulation is sent to described target database perform;
Affairs clearing cell, for after described distributed transaction is finished, removes described distributed transaction;
Transaction recovery unit, for reading described journal file, and according to the information of the distributed transaction recorded in described journal file, performs rolling back action to the distributed transaction not yet completed.
CN201410025961.8A 2014-01-20 2014-01-20 The implementation method and device of integration across database distributed transaction Active CN104793988B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410025961.8A CN104793988B (en) 2014-01-20 2014-01-20 The implementation method and device of integration across database distributed transaction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410025961.8A CN104793988B (en) 2014-01-20 2014-01-20 The implementation method and device of integration across database distributed transaction

Publications (2)

Publication Number Publication Date
CN104793988A true CN104793988A (en) 2015-07-22
CN104793988B CN104793988B (en) 2019-01-22

Family

ID=53558803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410025961.8A Active CN104793988B (en) 2014-01-20 2014-01-20 The implementation method and device of integration across database distributed transaction

Country Status (1)

Country Link
CN (1) CN104793988B (en)

Cited By (53)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159991A (en) * 2015-09-01 2015-12-16 北京皮尔布莱尼软件有限公司 Method, device and system for maintaining data consistency and application server
CN105426234A (en) * 2015-10-30 2016-03-23 小米科技有限责任公司 Deadlock detection method and apparatus for database
CN105512244A (en) * 2015-11-30 2016-04-20 北京京东尚科信息技术有限公司 Database transaction processing method and device based on message queue
CN105718572A (en) * 2016-01-21 2016-06-29 成都索贝数码科技股份有限公司 Transaction consistency achieving method and system for isomerous data compound object
CN105786595A (en) * 2016-02-29 2016-07-20 浪潮通用软件有限公司 Transaction control method achieving two-stage submitting
CN105892957A (en) * 2016-06-14 2016-08-24 中山大学 Distributed transaction execution method based on dynamic fragmentation
CN105955804A (en) * 2016-04-22 2016-09-21 星环信息科技(上海)有限公司 Method and device for processing distributed transaction
CN106354747A (en) * 2016-08-15 2017-01-25 成都轻车快马网络科技有限公司 Service delivery method for big data
CN106528754A (en) * 2016-10-28 2017-03-22 努比亚技术有限公司 Processing device and method of recycled data in cloud services
CN106547781A (en) * 2015-09-21 2017-03-29 南京中兴新软件有限责任公司 A kind of method for realizing distributed transaction, device and database server
CN106570027A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Transactional task processing method and device
CN106682082A (en) * 2016-11-23 2017-05-17 青岛海信移动通信技术股份有限公司 Writing method and device of database
WO2017107811A1 (en) * 2015-12-21 2017-06-29 阿里巴巴集团控股有限公司 Database operating method and device
CN107203560A (en) * 2016-03-18 2017-09-26 中国移动通信集团宁夏有限公司 Database, multiple database operation transaction consistency ensuring method and system
WO2017161989A1 (en) * 2016-03-23 2017-09-28 中兴通讯股份有限公司 Preprocessing method and device for distributed database and computer storage medium
CN107272437A (en) * 2017-08-01 2017-10-20 中国联合网络通信集团有限公司 Smart machine and its control method, control platform, smart machine system
CN107465725A (en) * 2017-07-20 2017-12-12 中国银行股份有限公司 Isomery remote business disposal system and method based on CICS
CN107491975A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 Slot data data processing method and device for server and for consumer
CN107644025A (en) * 2016-07-20 2018-01-30 阿里巴巴集团控股有限公司 The distribution method and device of the WAL records of distributed data base
CN107710203A (en) * 2015-06-29 2018-02-16 微软技术许可有限责任公司 Transaction database layer on distributed key/value thesaurus
CN107784055A (en) * 2017-02-17 2018-03-09 平安科技(深圳)有限公司 Transaction methods and device based on non-relational database
CN107797850A (en) * 2016-08-30 2018-03-13 阿里巴巴集团控股有限公司 The method, apparatus and system of distributing real time system
CN107870954A (en) * 2016-09-28 2018-04-03 中国移动通信集团广东有限公司 The extended method and device of a kind of distributed data base
US20180137210A1 (en) * 2016-11-17 2018-05-17 Sap Se Management of Transactions Spanning Different Database Types
CN108228617A (en) * 2016-12-14 2018-06-29 北京国双科技有限公司 Ensure the method and device of database manipulation atomicity
CN108363806A (en) * 2018-03-01 2018-08-03 上海达梦数据库有限公司 Multi-version concurrency control method, device, server and the storage medium of database
CN108491252A (en) * 2018-03-13 2018-09-04 万惠投资管理有限公司 distributed transaction processing method and distributed system
CN108572991A (en) * 2017-03-14 2018-09-25 北京京东尚科信息技术有限公司 Data base processing method, device and storage medium
CN108701157A (en) * 2016-01-28 2018-10-23 甲骨文国际公司 Guaranteed submission result in distributing real time system system
CN108733457A (en) * 2018-04-12 2018-11-02 阿里巴巴集团控股有限公司 The implementation method and device of distributed transaction
CN108829876A (en) * 2018-06-26 2018-11-16 山东汇贸电子口岸有限公司 The solution and device that the pl/sql client request time-out of Oracle does not respond
CN109002462A (en) * 2018-06-04 2018-12-14 北京明朝万达科技股份有限公司 A kind of method and system for realizing distributed things
CN109408201A (en) * 2017-08-18 2019-03-01 中国银联股份有限公司 Office management method based on distributed data base
CN109783200A (en) * 2017-11-13 2019-05-21 阿里巴巴集团控股有限公司 Data processing method, device and equipment
CN109918178A (en) * 2019-03-06 2019-06-21 恒生电子股份有限公司 Affairs submit method and relevant apparatus
CN109997166A (en) * 2016-09-19 2019-07-09 金融与风险组织有限公司 System and method for intercepting intelligent contract
CN110019530A (en) * 2017-12-29 2019-07-16 百度在线网络技术(北京)有限公司 Transaction methods and device based on distributed data base
CN110019050A (en) * 2017-10-19 2019-07-16 中兴通讯股份有限公司 A kind of data rewind method, system, equipment and computer readable storage medium
CN110765143A (en) * 2019-10-10 2020-02-07 腾讯科技(深圳)有限公司 Data processing method, device, server and storage medium
CN110765178A (en) * 2019-10-18 2020-02-07 京东数字科技控股有限公司 Distributed transaction processing method and device and computer storage medium
CN110807046A (en) * 2019-10-31 2020-02-18 浪潮云信息技术有限公司 Novel distributed NEWSQL database intelligent transaction optimization method
CN111581241A (en) * 2020-04-21 2020-08-25 上海爱数信息技术股份有限公司 Lock-free processing read cache method
CN111858629A (en) * 2020-07-02 2020-10-30 北京奥星贝斯科技有限公司 Method and device for realizing two-stage submission of distributed transaction update database
CN112182082A (en) * 2020-09-24 2021-01-05 广州巨杉软件开发有限公司 System and method for realizing strong consistency of transactions across different database engines
CN112380184A (en) * 2020-11-20 2021-02-19 北京百度网讯科技有限公司 Transaction processing method and device, electronic equipment and readable storage medium
CN112598520A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Transaction management method, device, electronic equipment and storage medium
CN112860788A (en) * 2019-11-28 2021-05-28 阿里巴巴集团控股有限公司 Transaction processing method, device, computer system and readable storage medium
CN113467898A (en) * 2021-09-02 2021-10-01 北京开科唯识技术股份有限公司 Multi-party cooperative service processing method and system
CN114327815A (en) * 2021-12-10 2022-04-12 龙芯中科技术股份有限公司 Atomicity keeping method, processor and electronic equipment
CN114510495A (en) * 2022-04-21 2022-05-17 北京安华金和科技有限公司 Database service data consistency processing method and system
CN115495205A (en) * 2022-11-01 2022-12-20 武汉大数据产业发展有限公司 Method and device for realizing data consistency based on distributed transaction lock
CN115994191A (en) * 2023-03-24 2023-04-21 北京极数云舟科技有限公司 DDL execution data synchronization method and device based on physical replication
CN117763052A (en) * 2024-02-22 2024-03-26 浩鲸云计算科技股份有限公司 data synchronization method and system for charging multi-center memory database

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110888929B (en) * 2019-12-06 2022-03-29 秒针信息技术有限公司 Data processing method, data processing device, data node and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101196926A (en) * 2007-12-29 2008-06-11 中国建设银行股份有限公司 Database access platform and access method thereof
CN102193986A (en) * 2011-03-25 2011-09-21 北京世纪互联工程技术服务有限公司 Method of implementing online transaction in graphic database
CN102279873A (en) * 2010-06-11 2011-12-14 微软公司 Unified concurrent changes to data, schema, and application
US20120084274A1 (en) * 2010-10-05 2012-04-05 Frank Renkes Distributed Transaction Management With Tokens
CN102831156A (en) * 2012-06-29 2012-12-19 浙江大学 Distributed transaction processing method on cloud computing platform
US20130066948A1 (en) * 2011-09-09 2013-03-14 Oracle International Corporation Idempotence for database transactions
CN103473318A (en) * 2013-09-12 2013-12-25 中国科学院软件研究所 Distributed transaction security method for memory data grid

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101196926A (en) * 2007-12-29 2008-06-11 中国建设银行股份有限公司 Database access platform and access method thereof
CN102279873A (en) * 2010-06-11 2011-12-14 微软公司 Unified concurrent changes to data, schema, and application
US20120084274A1 (en) * 2010-10-05 2012-04-05 Frank Renkes Distributed Transaction Management With Tokens
CN102193986A (en) * 2011-03-25 2011-09-21 北京世纪互联工程技术服务有限公司 Method of implementing online transaction in graphic database
US20130066948A1 (en) * 2011-09-09 2013-03-14 Oracle International Corporation Idempotence for database transactions
CN102831156A (en) * 2012-06-29 2012-12-19 浙江大学 Distributed transaction processing method on cloud computing platform
CN103473318A (en) * 2013-09-12 2013-12-25 中国科学院软件研究所 Distributed transaction security method for memory data grid

Cited By (85)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107710203A (en) * 2015-06-29 2018-02-16 微软技术许可有限责任公司 Transaction database layer on distributed key/value thesaurus
US11301457B2 (en) 2015-06-29 2022-04-12 Microsoft Technology Licensing, Llc Transactional database layer above a distributed key/value store
CN105159991A (en) * 2015-09-01 2015-12-16 北京皮尔布莱尼软件有限公司 Method, device and system for maintaining data consistency and application server
CN105159991B (en) * 2015-09-01 2019-08-02 北京皮尔布莱尼软件有限公司 A kind of method, apparatus, system and application server keeping data consistency
CN106547781A (en) * 2015-09-21 2017-03-29 南京中兴新软件有限责任公司 A kind of method for realizing distributed transaction, device and database server
CN106570027B (en) * 2015-10-10 2020-08-25 阿里巴巴集团控股有限公司 Transactional task processing method and device
CN106570027A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Transactional task processing method and device
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
CN105512244A (en) * 2015-11-30 2016-04-20 北京京东尚科信息技术有限公司 Database transaction processing method and device based on message queue
CN105512244B (en) * 2015-11-30 2019-03-01 北京京东尚科信息技术有限公司 The method and device of db transaction processing is realized based on message queue
WO2017107811A1 (en) * 2015-12-21 2017-06-29 阿里巴巴集团控股有限公司 Database operating method and device
EP3396560A4 (en) * 2015-12-21 2019-06-19 Alibaba Group Holding Limited Database operating method and device
CN105718572B (en) * 2016-01-21 2017-03-15 成都索贝数码科技股份有限公司 A kind of transaction consistency of isomeric data composite object reaches method and system
CN105718572A (en) * 2016-01-21 2016-06-29 成都索贝数码科技股份有限公司 Transaction consistency achieving method and system for isomerous data compound object
CN108701157A (en) * 2016-01-28 2018-10-23 甲骨文国际公司 Guaranteed submission result in distributing real time system system
CN108701157B (en) * 2016-01-28 2022-03-01 甲骨文国际公司 Guaranteed commit results in a distributed transaction processing system
CN105786595B (en) * 2016-02-29 2019-04-23 浪潮通用软件有限公司 A kind of transaction control method that two-part is submitted
CN105786595A (en) * 2016-02-29 2016-07-20 浪潮通用软件有限公司 Transaction control method achieving two-stage submitting
CN107203560B (en) * 2016-03-18 2020-07-07 中国移动通信集团宁夏有限公司 Database, multi-database operation transaction consistency ensuring method and system
CN107203560A (en) * 2016-03-18 2017-09-26 中国移动通信集团宁夏有限公司 Database, multiple database operation transaction consistency ensuring method and system
WO2017161989A1 (en) * 2016-03-23 2017-09-28 中兴通讯股份有限公司 Preprocessing method and device for distributed database and computer storage medium
CN105955804B (en) * 2016-04-22 2018-06-05 星环信息科技(上海)有限公司 A kind of method and apparatus for handling distributed transaction
CN105955804A (en) * 2016-04-22 2016-09-21 星环信息科技(上海)有限公司 Method and device for processing distributed transaction
CN107491975A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 Slot data data processing method and device for server and for consumer
CN105892957A (en) * 2016-06-14 2016-08-24 中山大学 Distributed transaction execution method based on dynamic fragmentation
CN105892957B (en) * 2016-06-14 2019-04-23 中山大学 A kind of distributed transaction execution method based on Dynamic Program Slicing
CN107644025A (en) * 2016-07-20 2018-01-30 阿里巴巴集团控股有限公司 The distribution method and device of the WAL records of distributed data base
CN106354747A (en) * 2016-08-15 2017-01-25 成都轻车快马网络科技有限公司 Service delivery method for big data
CN106354747B (en) * 2016-08-15 2019-08-16 成都轻车快马网络科技有限公司 Service providing method for big data
CN107797850B (en) * 2016-08-30 2021-09-21 阿里巴巴集团控股有限公司 Method, device and system for distributed transaction processing
CN107797850A (en) * 2016-08-30 2018-03-13 阿里巴巴集团控股有限公司 The method, apparatus and system of distributing real time system
CN109997166B (en) * 2016-09-19 2024-02-06 金融与风险组织有限公司 System and method for intercepting intelligent contracts
CN109997166A (en) * 2016-09-19 2019-07-09 金融与风险组织有限公司 System and method for intercepting intelligent contract
CN107870954A (en) * 2016-09-28 2018-04-03 中国移动通信集团广东有限公司 The extended method and device of a kind of distributed data base
CN106528754A (en) * 2016-10-28 2017-03-22 努比亚技术有限公司 Processing device and method of recycled data in cloud services
US20180137210A1 (en) * 2016-11-17 2018-05-17 Sap Se Management of Transactions Spanning Different Database Types
US10565187B2 (en) * 2016-11-17 2020-02-18 Sap Se Management of transactions spanning different database types
CN106682082A (en) * 2016-11-23 2017-05-17 青岛海信移动通信技术股份有限公司 Writing method and device of database
CN108228617A (en) * 2016-12-14 2018-06-29 北京国双科技有限公司 Ensure the method and device of database manipulation atomicity
CN107784055A (en) * 2017-02-17 2018-03-09 平安科技(深圳)有限公司 Transaction methods and device based on non-relational database
CN108572991A (en) * 2017-03-14 2018-09-25 北京京东尚科信息技术有限公司 Data base processing method, device and storage medium
CN107465725A (en) * 2017-07-20 2017-12-12 中国银行股份有限公司 Isomery remote business disposal system and method based on CICS
CN107272437A (en) * 2017-08-01 2017-10-20 中国联合网络通信集团有限公司 Smart machine and its control method, control platform, smart machine system
CN109408201A (en) * 2017-08-18 2019-03-01 中国银联股份有限公司 Office management method based on distributed data base
CN110019050A (en) * 2017-10-19 2019-07-16 中兴通讯股份有限公司 A kind of data rewind method, system, equipment and computer readable storage medium
CN109783200A (en) * 2017-11-13 2019-05-21 阿里巴巴集团控股有限公司 Data processing method, device and equipment
CN109783200B (en) * 2017-11-13 2023-09-22 阿里云计算有限公司 Data processing method, device and equipment
CN110019530A (en) * 2017-12-29 2019-07-16 百度在线网络技术(北京)有限公司 Transaction methods and device based on distributed data base
CN108363806A (en) * 2018-03-01 2018-08-03 上海达梦数据库有限公司 Multi-version concurrency control method, device, server and the storage medium of database
CN108363806B (en) * 2018-03-01 2020-07-31 上海达梦数据库有限公司 Multi-version concurrency control method and device for database, server and storage medium
CN108491252B (en) * 2018-03-13 2022-03-22 万惠投资管理有限公司 Distributed transaction processing method and distributed system
CN108491252A (en) * 2018-03-13 2018-09-04 万惠投资管理有限公司 distributed transaction processing method and distributed system
CN108733457A (en) * 2018-04-12 2018-11-02 阿里巴巴集团控股有限公司 The implementation method and device of distributed transaction
CN108733457B (en) * 2018-04-12 2021-07-20 创新先进技术有限公司 Method and device for realizing distributed transaction
CN109002462A (en) * 2018-06-04 2018-12-14 北京明朝万达科技股份有限公司 A kind of method and system for realizing distributed things
CN108829876A (en) * 2018-06-26 2018-11-16 山东汇贸电子口岸有限公司 The solution and device that the pl/sql client request time-out of Oracle does not respond
CN109918178A (en) * 2019-03-06 2019-06-21 恒生电子股份有限公司 Affairs submit method and relevant apparatus
CN109918178B (en) * 2019-03-06 2021-04-30 恒生电子股份有限公司 Transaction submitting method and related device
CN110765143B (en) * 2019-10-10 2022-08-02 腾讯科技(深圳)有限公司 Data processing method, device, server and storage medium
CN110765143A (en) * 2019-10-10 2020-02-07 腾讯科技(深圳)有限公司 Data processing method, device, server and storage medium
CN110765178A (en) * 2019-10-18 2020-02-07 京东数字科技控股有限公司 Distributed transaction processing method and device and computer storage medium
CN110807046B (en) * 2019-10-31 2022-06-07 浪潮云信息技术股份公司 Novel distributed NEWSQL database intelligent transaction optimization method
CN110807046A (en) * 2019-10-31 2020-02-18 浪潮云信息技术有限公司 Novel distributed NEWSQL database intelligent transaction optimization method
CN112860788A (en) * 2019-11-28 2021-05-28 阿里巴巴集团控股有限公司 Transaction processing method, device, computer system and readable storage medium
CN111581241A (en) * 2020-04-21 2020-08-25 上海爱数信息技术股份有限公司 Lock-free processing read cache method
CN111581241B (en) * 2020-04-21 2023-08-18 上海爱数信息技术股份有限公司 Read caching method for lock-free processing
CN111858629A (en) * 2020-07-02 2020-10-30 北京奥星贝斯科技有限公司 Method and device for realizing two-stage submission of distributed transaction update database
CN111858629B (en) * 2020-07-02 2023-08-22 北京奥星贝斯科技有限公司 Implementation method and device for two-stage submitting distributed transaction update database
WO2022062555A1 (en) * 2020-09-24 2022-03-31 广州巨杉软件开发有限公司 System and method for achieving strong consistency of transactions across different database engines
CN112182082B (en) * 2020-09-24 2021-07-06 广州巨杉软件开发有限公司 System and method for realizing strong consistency of transactions across different database engines
CN112182082A (en) * 2020-09-24 2021-01-05 广州巨杉软件开发有限公司 System and method for realizing strong consistency of transactions across different database engines
CN112380184A (en) * 2020-11-20 2021-02-19 北京百度网讯科技有限公司 Transaction processing method and device, electronic equipment and readable storage medium
CN112598520A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Transaction management method, device, electronic equipment and storage medium
CN112598520B (en) * 2020-12-28 2024-06-11 中国农业银行股份有限公司 Transaction management method, device, electronic equipment and storage medium
CN113467898B (en) * 2021-09-02 2022-01-18 北京开科唯识技术股份有限公司 Multi-party cooperative service processing method and system
CN113467898A (en) * 2021-09-02 2021-10-01 北京开科唯识技术股份有限公司 Multi-party cooperative service processing method and system
CN114327815A (en) * 2021-12-10 2022-04-12 龙芯中科技术股份有限公司 Atomicity keeping method, processor and electronic equipment
CN114510495B (en) * 2022-04-21 2022-07-08 北京安华金和科技有限公司 Database service data consistency processing method and system
CN114510495A (en) * 2022-04-21 2022-05-17 北京安华金和科技有限公司 Database service data consistency processing method and system
CN115495205A (en) * 2022-11-01 2022-12-20 武汉大数据产业发展有限公司 Method and device for realizing data consistency based on distributed transaction lock
CN115495205B (en) * 2022-11-01 2023-03-14 武汉大数据产业发展有限公司 Method and device for realizing data consistency based on distributed transaction lock
CN115994191A (en) * 2023-03-24 2023-04-21 北京极数云舟科技有限公司 DDL execution data synchronization method and device based on physical replication
CN117763052A (en) * 2024-02-22 2024-03-26 浩鲸云计算科技股份有限公司 data synchronization method and system for charging multi-center memory database
CN117763052B (en) * 2024-02-22 2024-05-10 浩鲸云计算科技股份有限公司 Data synchronization method and system for charging multi-center memory database

Also Published As

Publication number Publication date
CN104793988B (en) 2019-01-22

Similar Documents

Publication Publication Date Title
CN104793988A (en) Cross-database distributed transaction implementation method and device
US11994959B2 (en) System and method for transaction recovery in a multitenant application server environment
CN111338766B (en) Transaction processing method and device, computer equipment and storage medium
US11132350B2 (en) Replicable differential store data structure
US11061884B2 (en) Method and system to accelerate transaction commit using non-volatile memory
US10942823B2 (en) Transaction processing system, recovery subsystem and method for operating a recovery subsystem
US6772155B1 (en) Looking data in a database system
US9424140B1 (en) Providing data volume recovery access in a distributed data store to multiple recovery agents
US7349970B2 (en) Workload management of stateful program entities
US6895529B2 (en) Rebuilding “in-doubt” states reliably after multiple system failures in a data processing system performing two-phase transaction processing
CN108509462B (en) Method and device for synchronizing activity transaction table
US20100169284A1 (en) Distributed transactional recovery system and method
CN109739935A (en) Method for reading data, device, electronic equipment and storage medium
US10180812B2 (en) Consensus protocol enhancements for supporting flexible durability options
US11449241B2 (en) Customizable lock management for distributed resources
US20210073198A1 (en) Using persistent memory and remote direct memory access to reduce write latency for database logging
CN112039970B (en) Distributed business lock service method, server, system and storage medium
CN107832159A (en) Manage the method and computer-readable recording medium of distributed lock
US11003550B2 (en) Methods and systems of operating a database management system DBMS in a strong consistency mode
EP4276651A1 (en) Log execution method and apparatus, and computer device and storage medium
US20200125667A1 (en) Real-time masking in a standby database
CN110377614B (en) Order processing lock system under distributed environment
CN110659303A (en) Read-write control method and device for database nodes
Pankowski Consistency and availability of Data in replicated NoSQL databases
CN112685142A (en) Distributed data processing system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20191209

Address after: P.O. Box 31119, grand exhibition hall, hibiscus street, 802 West Bay Road, Grand Cayman, Cayman Islands

Patentee after: Innovative advanced technology Co., Ltd

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Co., Ltd.

TR01 Transfer of patent right