CN110022367A - A kind of transaction methods and transacter - Google Patents

A kind of transaction methods and transacter Download PDF

Info

Publication number
CN110022367A
CN110022367A CN201910288639.7A CN201910288639A CN110022367A CN 110022367 A CN110022367 A CN 110022367A CN 201910288639 A CN201910288639 A CN 201910288639A CN 110022367 A CN110022367 A CN 110022367A
Authority
CN
China
Prior art keywords
transaction
database
global
identifiers
affairs
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.)
Pending
Application number
CN201910288639.7A
Other languages
Chinese (zh)
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.)
Isoftstone Power Information Technology (group) Co Ltd
Original Assignee
Isoftstone Power Information Technology (group) Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Isoftstone Power Information Technology (group) Co Ltd filed Critical Isoftstone Power Information Technology (group) Co Ltd
Priority to CN201910288639.7A priority Critical patent/CN110022367A/en
Publication of CN110022367A publication Critical patent/CN110022367A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a kind of transaction methods and transacters, the first request of the creation database connection for the global transaction that transaction initiator is initiated is received by database broker using database middleware, wherein, global transaction includes at least one application service, database middleware generates transaction identifiers corresponding with global transaction according to the first request, establish the connection with database, and the mapping relations that store transaction identifier is connected with database, transaction identifiers are fed back to transaction initiator by database broker by database middleware, so that transaction initiator is handled or is transmitted global transaction by transaction identifiers, realize that different application service participates in the affairs of the same database, it solves in prior art since different business systems hold distributed transaction problem of inconsistency caused by disparate databases connect, Without coordinating the consistency of affairs by affairs coordinator, the efficiency of issued transaction is improved.

Description

A kind of transaction methods and transacter
Technical field
The present embodiments relate to data processing technique more particularly to a kind of transaction methods and transacter.
Background technique
In micro services or distributed system architecture, usually by complicated monomer applications be split as several functions it is simple, The service of loose coupling, it is usual when using this processing mode entire operation flow of processing to reduce development difficulty, enhancing scalability The common participation of multiple services is required, difference service is often connected using different databases, that is, is on database physical Separated.Meanwhile under micro services or distributed system architecture, there is a large amount of distributed transaction solution, wherein point Cloth affairs refer to that affairs participant, resource manager and task manager are located at the different nodes of different distributed systems On, affairs are an indivisible work units, and a distributed transaction generally comprises multiple local matters, each local It affairs or is carried out or does not execute.
Currently, the solution of common processing distributed transaction generally uses 2PC (Two-phase-commit, two stages Committing protocol) or TCC (Try-Confirm-Cancel, affairs compensation method) processing distributed transaction.It is handled and is distributed using 2PC The specific steps of formula affairs an are as follows: affairs are divided into two stages, the first stage is the preparation stage, and person sends out by transaction coordination It rises, inquires whether all affairs participants can submit, affairs participant initiates ballot;Second stage is presentation stage, affairs Coordinator is submission or rollback according to the decision of the voting results of affairs participant, and only all affairs participants agree on submission Shi Caineng, which is executed, submits operation.Guarantee the transaction consistency of all affairs participants by this coordinate scheme;At TCC When managing distributed transaction, the business processing flow of entire application service needs explicit to be divided into three parts: (1) at the Try stage Manage preparation;(2) the Confirm stage completes normal transaction submission;(3) the Cancel stage is then the contrary operation of Confirm. Affairs coordinator can return to situation according to try interface, determine to call confirm interface or cancel interface, if interface tune With failure, it will do it and retry.
When handling distributed task scheduling using 2PC mode or TCC mode, due to transaction initiator and each affairs participant Different databases is respectively corresponded, if transaction coordination person's delay machine, a part of affairs participant is may result in and receives submission and ask It asks, and other participants do not receive request, lead to affairs inconsistence problems.
Summary of the invention
The embodiment of the invention provides a kind of transaction methods and transacters, are coordinated with realizing in no coordinator In the case where consistency, to the efficient process of global transaction.
In a first aspect, the embodiment of the invention provides a kind of transaction methods, wherein include:
Database middleware is connected by the creation database that database broker receives the global transaction that transaction initiator is initiated The first request connect, wherein the global transaction includes at least one application service;
The database middleware generates transaction identifiers corresponding with the global transaction according to first request, builds The vertical connection with the database, and store the mapping relations that the transaction identifiers are connected with the database;
The transaction identifiers are fed back to the affairs by the database broker and initiated by the database middleware Person, so that the transaction initiator handles the global transaction by database connection and the transaction identifiers.
Second aspect, the embodiment of the invention also provides a kind of transacters, wherein including transaction initiator, number According to library agency and database middleware, wherein the database middleware includes:
Request receiving module, for receiving the creation data for the global transaction that transaction initiator is initiated by database broker First request of library connection, wherein the global transaction includes at least one application service;
Connection establishment module, for generating transaction identifiers corresponding with the global transaction according to first request, The connection of the global transaction Yu the database is established, and stores the mapping that the transaction identifiers are connected with the database Relationship;
Feedback module, for the transaction identifiers to be fed back to the transaction initiator by the database broker, So that the transaction initiator handles the global transaction by database connection and the transaction identifiers.
The embodiment of the invention provides a kind of transaction methods and transacters, when transaction initiator initiates the overall situation When affairs, global transaction is sent to database middleware by database broker, database middleware connects database, makes complete The application service of each of office's affairs is all connected with the same database, generates the mapping that transaction identifiers are connected with database and closes System, and transaction identifiers are returned into transaction initiator, transaction initiator can operate database by transaction identifiers, It is different to solve distributed transaction caused by holding disparate databases connection due to different business systems in prior art Cause property problem improves the efficiency of issued transaction without coordinating the consistency of affairs by affairs coordinator.
Detailed description of the invention
Fig. 1 is a kind of flow chart for transaction methods that the embodiment of the present invention one provides;
Fig. 2 is a kind of interaction figure for transaction methods that the embodiment of the present invention one provides;
Fig. 3 is a kind of flow chart of transaction methods provided by Embodiment 2 of the present invention;
Fig. 4-5 is a kind of interaction figure of transaction methods provided by Embodiment 2 of the present invention;
Fig. 6 is the flow chart that a kind of global transaction provided by Embodiment 2 of the present invention is submitted;
Fig. 7 is a kind of flow chart of global transaction rollback provided by Embodiment 2 of the present invention;
Fig. 8 is a kind of module map for transacter that the embodiment of the present invention three provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is the flow chart for the transaction methods that the embodiment of the present invention one provides, and the present embodiment is suitable for any affairs Processing, such as: the processing of distributed transaction or other complex transactions, the present embodiment is in a distributed manner for affairs, including such as Lower step:
S102, database middleware receive the creation data for the global transaction that transaction initiator is initiated by database broker First request of library connection.
It is understood that distributed transaction can be regarded to a global transaction as, often when affairs are distributed transaction One global transaction includes at least an application service, each application service can give at the server of a node Reason, wherein the server for initiating global transaction is known as transaction initiator, and the server of other nodes is known as affairs participant, uses The processing of global transaction is completed in auxiliary transaction initiator.
Be illustrated in figure 2 the interaction figure of transaction methods, when executing global transaction, need to establish transaction initiator with The connection of database initiates creation connection request by transaction initiator, wherein and the creation connection request is above-mentioned first request, Database broker receives creation connection request, and creation connection request is transmitted to database middleware, wherein database broker Can be the software interface write by any database language with database middleware, creation connection request be also possible to by A kind of request instruction that database language is write.
S104, the database middleware generate Transaction Identifier corresponding with the global transaction according to first request Symbol establishes the connection with the database, and stores the mapping relations that the transaction identifiers are connected with the database.
In conjunction with Fig. 2, after database middleware receives creation connection request, i.e., the first request is asked according to creation connection Whether there are transmitting transaction identifiers to determine that the creation connection request is new connection request in asking, is asked if it is new connection It asks, calls database-driven, enable database-driven initiate creation connection request to corresponding database, and be successfully connected data Library, then database connection is returned to database middleware by database-driven, and database middleware is connected according to database and given birth to At transaction identifiers, and the mapping relations that store transaction identifier is connected with database, the owner for recording transaction identifiers are Transaction initiator.
The transaction identifiers are fed back to the affairs by the database broker by S106, the database middleware Promoter, so that the transaction initiator handles the global transaction by database connection and the transaction identifiers.
In conjunction with Fig. 2, after database middleware generates transaction identifiers, mapping that store transaction identifier is connect with database Relationship, record transaction identifiers owner are transaction initiator, and transaction identifiers are returned to database broker, database broker Transaction identifiers are got, the virtual database based on same database connecting interface standard and comprising transaction identifiers is created Then the virtual database connection is returned to transaction initiator, makes transaction initiator by that should include Transaction Identifier by connection The processing of global transaction is completed in the virtual database connection of symbol.
The technical solution of the present embodiment receives what transaction initiator was initiated by database broker by database middleware First request of the creation database connection of global transaction, wherein global transaction at least one of includes application service, in database Between part corresponding with global transaction transaction identifiers are generated according to the first request, establish and the connection of database, and store transaction Transaction identifiers are fed back to affairs by database broker by the mapping relations that identifier is connected with database, database middleware Promoter makes transaction initiator handle global transaction by database connection and transaction identifiers, realizes by among database The application service of each of global transaction is all connected with the same database by part, is solved in prior art due to difference Operation system holds distributed transaction problem of inconsistency caused by disparate databases connection, without being assisted by affairs coordinator The consistency for adjusting affairs, improves the efficiency of issued transaction.
Embodiment two
Fig. 3 is a kind of flow chart of transaction methods provided by Embodiment 2 of the present invention, the technical solution of the present embodiment Further optimized on the basis of the above embodiments.Optionally, the transaction methods further include: the data The affairs of the transaction identifiers and global transaction that library middleware receives the database broker transmitting open request;According to institute It states connection mapping relations and obtains database connection corresponding with the global transaction, open the global transaction.It increases several Step.The part of not detailed description please refers to embodiment one in this method embodiment.
As shown in figure 3, the method for the present embodiment is specific can include:
S302, database middleware receive the creation data for the global transaction that transaction initiator is initiated by database broker First request of library connection.
S304, the database middleware generate Transaction Identifier corresponding with the global transaction according to first request Symbol establishes the connection with the database, and stores the mapping relations that the transaction identifiers are connected with the database.
Wherein, S302 and S304 illustrates identical that details are not described herein with above-described embodiment one.
The transaction identifiers are fed back to the affairs by the database broker by S306, the database middleware Promoter, so that the transaction initiator handles the global transaction by database connection and the transaction identifiers.
Then above-described embodiment one, when transaction initiator receives database connection and when transaction identifiers, in conjunction with Fig. 4, Transaction initiator initiates the unlatching request of the global transaction comprising transaction identifiers, will open request and sends database broker to, Database broker is transmitted to database middleware for request is opened, and executes S308.
S308, the database middleware receive the transaction identifiers and global transaction of the database broker transmitting Affairs open request.
S310 obtains database corresponding with the global transaction according to the mapping relations and connects, opens the overall situation Affairs.
It is understood that when transaction initiator connects database, since each transaction identifiers is corresponding unique Mapping relations correspond to unique database connection, when transaction initiator initiates global transaction, database middleware can basis It connects mapping relations and obtains database connection.As shown in connection with fig. 4, database middleware is opened complete in the database connection of acquisition Office's affairs, after successfully opening, the result that success is opened is returned to transaction initiator by database broker by database middleware, The database that transaction initiator initiates global transaction executes sentence, and database is executed sentence and affairs mark by database broker Know symbol and be transmitted to database middleware, database middleware obtains database according to transaction identifiers and connects, and executes database and holds Implementing result is returned to transaction initiator by database broker by line statement.
Further, after global transaction is opened, during the database of global transaction executes sentence and executes, affairs Promoter may call upon at least one affairs participant corresponding with application service, and transaction identifiers are sent to affairs ginseng With person, the second request that affairs participant connects the creation database for carrying transaction identifiers is sent among database Part, if database middleware receives the second request that affairs participant carries the creation database connection of transaction identifiers When, the database that database corresponding with transaction identifiers is connected to affairs participant is connected, so that affairs participant is logical It crosses the database connection and participates in processing global transaction, without being established newly for the corresponding application service of each affairs participant Database connection, to make transaction initiator and affairs participant for the same database processing global transaction.
Affairs participant is explained in detail in conjunction with Fig. 5, acquisition database is connected by database, participate in processing global transaction Detailed process, after transaction initiator receives the transaction identifiers of database broker return, by transaction identifiers and global thing Business passes to affairs participant, and affairs participant obtains transaction identifiers, is initiated by database broker to database middleware Connection request, the connection request are alternatively referred to as above-mentioned second request, and database middleware is according to the Transaction Identifier in connection request Symbol obtains database connection, and after being successfully connected, connection result is returned at least one affairs participant by database broker, These affairs participant obtains above-mentioned database according to connection result and connects, and then affairs participant sends complete to database broker Global transaction is transmitted to database middleware by office's affairs, database broker, and database middleware handles number according to global transaction According to library, processing result is obtained, processing result is returned at least one affairs participant by database broker, participates in affairs The processing of person's completion global transaction.Preferably, during the entire process of handling global transaction, among database broker and database Part can drive standard using type3, to reduce code invasive, improve the efficiency and safety of global transaction processing.
Further, after global transaction has been handled, global transaction can be submitted, wherein the submission of global transaction may It is to be initiated by transaction initiator or affairs participant, is illustrated in figure 6 database middleware and global transaction is submitted specifically to walk It is rapid:
S602 receives global transaction and submits request.
S604, judge global transaction promoter whether be transaction identifiers founder;If so, executing S606;Such as Fruit is no, executes S608.
Wherein, the founder of transaction identifiers is above-mentioned transaction initiator, i.e., if database middleware receives affairs The affairs that promoter initiates submit request, then obtain the corresponding database connection of identifier.
S606 obtains the corresponding database connection of transaction identifiers, submits global transaction.
Specifically, after getting database connection, database middleware will global transaction corresponding with database connection Processing result be back to transaction initiator so that transaction initiator submit global transaction.
S608 ignores global transaction and submits request, waits transaction initiator to issue global transaction and submits instruction.
The submission of global transaction is completed by step shown in fig. 6 as a result,.
It is understood that transaction initiator or affairs participant may occur in global transaction treatment process Perhaps other failures are when transaction initiator or affairs participant generation delay machine or other failures for delay machine, transaction initiator Or affairs participant can initiate transaction rollback request, by database middleware processing rollback request, be illustrated in figure 7 database Middleware rollback global transaction specific steps:
S702 receives global transaction rollback request.
Since transaction initiator or affairs participant can initiate rollback request, if database middleware receives The transaction rollback request that affairs participant or transaction initiator are initiated then records database corresponding with transaction identifiers and connects Connect, by the status indication of global transaction be rollback, by the status indication of global transaction be rollback after, if among database Part receives other transaction requests in addition to rollback corresponding with transaction identifiers, then feedback error information.It needs It is noted that database middleware can execute not according to the rollback request that transaction initiator or affairs participant submit respectively Same rolling back action, and execute following S704.
S704, judge global transaction promoter whether be transaction identifiers founder;If so, executing S706;Such as Fruit is no, executes S708.
Wherein, the founder of transaction identifiers is above-mentioned transaction initiator, i.e., if database middleware receives affairs The transaction rollback request that promoter initiates then obtains the corresponding database connection of identifier.
S706 obtains the corresponding database connection of transaction identifiers, rollback global transaction.
Wherein, rollback global transaction is that whole or affairs needs restart to establish database connection.
S708, marking database corresponding with transaction identifiers to be connected as can only rollback state.
Wherein, can only rollback state be the global transaction be canceled, can not re-establish again database connection.
Preferably, the present embodiment can handle rollback request by heartbeat mechanism or timeout mechanism, if in database Between part by heartbeat mechanism determine that transaction identifiers corresponding database connection is broken down, alternatively, database middleware is logical It crosses timeout mechanism and determines that the free time length of the corresponding database connection of transaction identifiers is more than preset duration threshold value, then basis is reflected Global transaction described in relationship rollback and destruction database connection are penetrated, to prevent the processing of global transaction.
The technical solution of the present embodiment receives the transaction identifiers of database broker transmitting and complete by database middleware The affairs of office's affairs open request, obtain database corresponding with global transaction according to connection mapping relations and connect, and open global Affairs, then, when database middleware receives that affairs participant carries the creation database connection of transaction identifiers When two requests, the database that database corresponding with transaction identifiers is connected to affairs participant is connected, so that affairs are joined Participation processing global transaction is connect by database with person, realizes and is answered each of global transaction by database middleware Be all connected with the same database with service, meanwhile, transaction initiator can by transaction identifiers to database carry out operation or Transaction identifiers are propagated between different application service, make different application service that can participate in the same global transaction jointly, are solved Since different business systems hold distributed transaction inconsistency caused by disparate databases connection in prior art Problem improves the efficiency of issued transaction, the type3 driving of introducing without coordinating the consistency of affairs by affairs coordinator Standard reduces the invasive of code, meanwhile, the rollback request of global transaction can be completed without the coordination of affairs coordinator, Totally improve the efficiency and accuracy of issued transaction.
Embodiment three
Fig. 8 is a kind of structural schematic diagram for transacter that the embodiment of the present invention three provides, as shown in figure 8, this is System includes: transaction initiator 1, database broker 3 and database middleware 4, wherein the database middleware includes:
Request receiving module, for receiving the creation data for the global transaction that transaction initiator is initiated by database broker First request of library connection, wherein the global transaction includes at least one application service;
Connection establishment module, for generating transaction identifiers corresponding with the global transaction according to first request, The connection with the database is established, and stores the mapping relations that the transaction identifiers are connected with the database;
Feedback module, for the transaction identifiers to be fed back to the transaction initiator by the database broker, So that the transaction initiator handles the global transaction by database connection and the transaction identifiers.
In conjunction with Fig. 8, which can also include: affairs participant 2, and affairs participant 2 may include at least one affairs Participant 21, affairs participant 21 ... affairs participant 2n, wherein affairs participant 2 and transaction initiator 1 participate in the overall situation jointly The processing of affairs, meanwhile, which can also include database 5, and global transaction and other affairs are stored in database 5 Data and data relationship.
On the basis of above-mentioned each technical solution, the database middleware 4 can be used for:
After the transaction identifiers are fed back to the transaction initiator by the database broker, described in reception The transaction identifiers of database broker transmitting and the affairs of global transaction open request, wherein the affairs open request It is initiated by the transaction initiator;
Database connection corresponding with the global transaction is obtained according to the connection mapping relations, opens the global thing Business.
On the basis of above-mentioned each technical solution, after the unlatching global transaction, the database middleware 4 It can be also used for:
When the database middleware receives the creation data that the affairs participant carries the transaction identifiers When the second request of library connection, database corresponding with the transaction identifiers is connected to the data of the affairs participant Library connection, so that the affairs participant participates in handling the global transaction by database connection.
On the basis of above-mentioned each technical solution, the transaction initiator 1 can be used for: call corresponding with the application service At least one affairs participant, and the transaction identifiers are sent to the affairs participant;
The affairs participant 2 can be used for: the second of the creation database for carrying transaction identifiers connection is asked It asks and is sent to the database middleware.
On the basis of above-mentioned each technical solution, the database middleware 4 can also be used in:
If the database middleware receives the affairs submission that the transaction initiator is initiated and requests, described in acquisition The corresponding connecting path of identifier;
The processing result for connecting the corresponding global transaction with the database is back to the transaction initiator, with The transaction initiator is set to submit the global transaction.
On the basis of above-mentioned each technical solution, the database middleware 4 can also be used in:
If the affairs that the database middleware receives the affairs participant or the transaction initiator is initiated Rollback request then records database connection corresponding with the transaction identifiers, the status indication of the global transaction is back Rolling.
On the basis of above-mentioned each technical solution, the database middleware 4 can also be used in:
If the database middleware receives other things in addition to rollback corresponding with the transaction identifiers Business processing is requested, then feedback error information.
On the basis of above-mentioned each technical solution, the database middleware 4 can also be used in:
If the database middleware determines that the corresponding database of the transaction identifiers connects by heartbeat mechanism It breaks down, alternatively, the database middleware determines that the corresponding database of the transaction identifiers connects by timeout mechanism The free time length connect is more than preset duration threshold value, then the global transaction according to the mapping relations rollback and destroys the data Library connection.
On the basis of above-mentioned each technical solution, the database broker 3 and the database middleware 4 meet type3 Driving standard.
The technical solution of the present embodiment receives what transaction initiator was initiated by database broker by database middleware First request of the creation database connection of global transaction, wherein global transaction at least one of includes application service, in database Between part corresponding with global transaction transaction identifiers are generated according to the first request, establish the connection of global transaction and database, and The mapping relations that store transaction identifier is connected with database, database middleware are anti-by database broker by transaction identifiers It feeds transaction initiator, so that transaction initiator handles global transaction by database connection and transaction identifiers, realization passes through The application service of each of global transaction is all connected with the same database by database middleware, meanwhile, transaction initiator can Operation is carried out between database by transaction identifiers or propagates transaction identifiers different application service, takes different application Business can participate in the same global transaction jointly, solve in prior art since different business systems hold different data Distributed transaction problem of inconsistency caused by the connection of library is improved without coordinating the consistency of affairs by affairs coordinator The efficiency of issued transaction.
It is worth noting that, included each unit and module are only pressed in the embodiment of above-mentioned transacter It is divided, but is not limited to the above division according to function logic, as long as corresponding functions can be realized;In addition, The specific name of each functional unit is also only for convenience of distinguishing each other, the protection scope being not intended to restrict the invention.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.

Claims (10)

1. a kind of transaction methods characterized by comprising
Database middleware is connected by the creation database that database broker receives the global transaction that transaction initiator is initiated First request, wherein the global transaction includes at least one application service;
The database middleware generates corresponding with global transaction transaction identifiers according to first request, establish and The connection of the database, and store the mapping relations that the transaction identifiers are connected with the database;
The transaction identifiers are fed back to the transaction initiator by the database broker by the database middleware, with The transaction initiator is set to handle the global transaction by database connection and the transaction identifiers.
2. the method according to claim 1, wherein the transaction initiator is connected by the database and institute It states transaction identifiers and handles the global transaction, comprising:
The affairs of the transaction identifiers and global transaction that the database middleware receives the database broker transmitting are opened Open request, wherein the affairs are opened request and initiated by the transaction initiator;
The database middleware obtains database corresponding with the global transaction according to the mapping relations and connects, and opens institute State global transaction.
3. according to the method described in claim 2, it is characterized in that, after the unlatching global transaction, further includes:
When the database middleware receives the creation database company that the affairs participant carries the transaction identifiers When the second request connect, the database that database corresponding with the transaction identifiers is connected to the affairs participant is connected It connects, so that the affairs participant participates in handling the global transaction by database connection.
4. according to the method described in claim 3, it is characterized by further comprising:
The transaction initiator calls at least one affairs participant corresponding with the application service, and by the Transaction Identifier Symbol is sent to the affairs participant;
The second request that the affairs participant connects the creation database for carrying the transaction identifiers is sent to described Database middleware.
5. according to the method described in claim 3, it is characterized by further comprising:
If the database middleware receives the affairs that the transaction initiator is initiated and submits request, the mark is obtained Accord with corresponding database connection;
The processing result for connecting the corresponding global transaction with the database is back to described by the database middleware Transaction initiator, so that the transaction initiator submits the global transaction.
6. according to the method described in claim 3, it is characterized by further comprising:
If the transaction rollback that the database middleware receives the affairs participant or the transaction initiator is initiated Request then records database connection corresponding with the transaction identifiers, is rollback by the status indication of the global transaction.
7. according to the method described in claim 6, it is characterized in that, being rollback in the status indication by the global transaction Later, further includes:
If the database middleware receives other offices in addition to rollback corresponding with the transaction identifiers Reason is requested, then feedback error information.
8. according to the method described in claim 3, it is characterized by further comprising:
If the database middleware determines that the corresponding database connection of the transaction identifiers occurs by heartbeat mechanism Failure, alternatively, the database middleware determines what the corresponding database of the transaction identifiers connected by timeout mechanism Free time length is more than preset duration threshold value, then the global transaction according to the mapping relations rollback and destroys the database and connect It connects.
9. the method according to claim 1, wherein the database broker and the database middleware meet Type3 drives standard.
10. a kind of transacter, which is characterized in that including transaction initiator, database broker and database middleware, In, the database middleware includes:
Request receiving module, the creation database for receiving the global transaction that transaction initiator is initiated by database broker connect The first request connect, wherein the global transaction includes at least one application service;
Connection establishment module is established for generating transaction identifiers corresponding with the global transaction according to first request The connection of the global transaction and the database, and store the mapping that the transaction identifiers are connected with the database and close System;
Feedback module, for the transaction identifiers to be fed back to the transaction initiator by the database broker, so that The transaction initiator handles the global transaction by database connection and the transaction identifiers.
CN201910288639.7A 2019-04-11 2019-04-11 A kind of transaction methods and transacter Pending CN110022367A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910288639.7A CN110022367A (en) 2019-04-11 2019-04-11 A kind of transaction methods and transacter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910288639.7A CN110022367A (en) 2019-04-11 2019-04-11 A kind of transaction methods and transacter

Publications (1)

Publication Number Publication Date
CN110022367A true CN110022367A (en) 2019-07-16

Family

ID=67191067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910288639.7A Pending CN110022367A (en) 2019-04-11 2019-04-11 A kind of transaction methods and transacter

Country Status (1)

Country Link
CN (1) CN110022367A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111580938A (en) * 2020-03-27 2020-08-25 山东浪潮通软信息科技有限公司 Transaction processing method, device, equipment and medium for work unit
CN111708616A (en) * 2020-06-11 2020-09-25 浙江网新恒天软件有限公司 Processing method of single data source distributed transaction under micro-service architecture
CN112148394A (en) * 2020-09-08 2020-12-29 上加下信息技术成都有限公司 Distributed transaction coordination method and device and electronic equipment
CN112182082A (en) * 2020-09-24 2021-01-05 广州巨杉软件开发有限公司 System and method for realizing strong consistency of transactions across different database engines
CN112541006A (en) * 2019-09-23 2021-03-23 拉扎斯网络科技(上海)有限公司 Database command request processing method and device, electronic equipment and storage medium
CN112597176A (en) * 2020-12-25 2021-04-02 中国农业银行股份有限公司 Processing method and system for transaction save points of distributed database
CN112650562A (en) * 2020-12-18 2021-04-13 平安科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium
CN112866316A (en) * 2019-11-27 2021-05-28 北京沃东天骏信息技术有限公司 Distributed transaction processing method and device
CN112995262A (en) * 2019-12-18 2021-06-18 中国移动通信集团浙江有限公司 Distributed transaction submission method, system and computing equipment
CN113268471A (en) * 2021-06-24 2021-08-17 京东科技控股股份有限公司 Method, proxy connection pool, system, device, and medium for processing distributed transactions
CN113872781A (en) * 2020-06-30 2021-12-31 阿里巴巴集团控股有限公司 Transaction processing method, device, equipment and storage medium
CN113992750A (en) * 2020-07-10 2022-01-28 华为技术有限公司 Global transaction coordination method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000077686A2 (en) * 1999-06-14 2000-12-21 Sun Microsystems, Inc. Method for distributed transaction support using jdbc 1.0 drivers
CN106033562A (en) * 2015-03-16 2016-10-19 阿里巴巴集团控股有限公司 Transaction processing method, transaction participation node and transaction coordination node
CN107436799A (en) * 2016-05-26 2017-12-05 阿里巴巴集团控股有限公司 Distributed transaction uniformity implementation method and device
CN109426552A (en) * 2017-09-05 2019-03-05 阿里巴巴集团控股有限公司 Transaction methods, device and system and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000077686A2 (en) * 1999-06-14 2000-12-21 Sun Microsystems, Inc. Method for distributed transaction support using jdbc 1.0 drivers
CN106033562A (en) * 2015-03-16 2016-10-19 阿里巴巴集团控股有限公司 Transaction processing method, transaction participation node and transaction coordination node
CN107436799A (en) * 2016-05-26 2017-12-05 阿里巴巴集团控股有限公司 Distributed transaction uniformity implementation method and device
CN109426552A (en) * 2017-09-05 2019-03-05 阿里巴巴集团控股有限公司 Transaction methods, device and system and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘军等: "《电子商务系统的规划与设计》", 30 April 2001, 人民邮电出版社 *

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112541006A (en) * 2019-09-23 2021-03-23 拉扎斯网络科技(上海)有限公司 Database command request processing method and device, electronic equipment and storage medium
CN112866316A (en) * 2019-11-27 2021-05-28 北京沃东天骏信息技术有限公司 Distributed transaction processing method and device
CN112995262A (en) * 2019-12-18 2021-06-18 中国移动通信集团浙江有限公司 Distributed transaction submission method, system and computing equipment
CN112995262B (en) * 2019-12-18 2022-06-10 中国移动通信集团浙江有限公司 Distributed transaction submission method, system and computing equipment
CN111580938A (en) * 2020-03-27 2020-08-25 山东浪潮通软信息科技有限公司 Transaction processing method, device, equipment and medium for work unit
CN111708616A (en) * 2020-06-11 2020-09-25 浙江网新恒天软件有限公司 Processing method of single data source distributed transaction under micro-service architecture
CN113872781A (en) * 2020-06-30 2021-12-31 阿里巴巴集团控股有限公司 Transaction processing method, device, equipment and storage medium
CN113992750A (en) * 2020-07-10 2022-01-28 华为技术有限公司 Global transaction coordination method, device, equipment and medium
CN112148394A (en) * 2020-09-08 2020-12-29 上加下信息技术成都有限公司 Distributed transaction coordination method and device and electronic equipment
CN112182082A (en) * 2020-09-24 2021-01-05 广州巨杉软件开发有限公司 System and method for realizing strong consistency of transactions across different database engines
CN112650562A (en) * 2020-12-18 2021-04-13 平安科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium
CN112650562B (en) * 2020-12-18 2024-03-08 平安科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium
CN112597176A (en) * 2020-12-25 2021-04-02 中国农业银行股份有限公司 Processing method and system for transaction save points of distributed database
CN112597176B (en) * 2020-12-25 2024-06-11 中国农业银行股份有限公司 Processing method and system for transaction preservation points of distributed database
CN113268471A (en) * 2021-06-24 2021-08-17 京东科技控股股份有限公司 Method, proxy connection pool, system, device, and medium for processing distributed transactions
CN113268471B (en) * 2021-06-24 2023-09-22 京东科技控股股份有限公司 Method, proxy connection pool, system, device and medium for processing distributed transaction

Similar Documents

Publication Publication Date Title
CN110022367A (en) A kind of transaction methods and transacter
US5768587A (en) Operating a transaction manager with a non-compliant resource manager
CN111367628B (en) Distributed transaction processing method and device, message producer and consumer system
CN106502769B (en) Distributed transaction processing method, apparatus and system
US5428771A (en) Transparent transaction coordination between distributed networks having different communication protocols
US6266698B1 (en) Logging of transaction branch information for implementing presumed nothing and other protocols
JP2837288B2 (en) Management method of work unit identifier in a chain distributed data transaction system
US20020178177A1 (en) Parallel logging method for transaction processing system
US5924095A (en) Processing distributed transactions in heterogeneous computing environments using two-phase commit
JPS63181063A (en) Transaction processing
CN111045794B (en) Distributed transaction processing method, device, system, computer equipment and storage medium
EP0707265A2 (en) A system and method for creating an object oriented transaction service that interoperates with procedural transaction coordinators
JP2002512400A (en) Method and apparatus for activating components in a first transaction processing environment to access resources in another environment
US8006248B2 (en) Method, apparatus and computer program for facilitating communication between a client application and a server application
CN110888718A (en) Method and device for realizing distributed transaction
US20090193286A1 (en) Method and System for In-doubt Resolution in Transaction Processing
US20090193280A1 (en) Method and System for In-doubt Resolution in Transaction Processing
US6141679A (en) High performance distributed transaction processing methods and apparatus
CN112148436B (en) Decentralised TCC transaction management method, device, equipment and system
CN110427427B (en) Method for realizing global transaction distributed processing through pin bridging
JP2005538460A (en) Data processing system and method (data processing system adapted to integrate heterogeneous processes)
CN113297329A (en) Transaction processing method, device, equipment, storage medium and program product
US6237018B1 (en) Apparatus method and computer program product for client/server computing with improved transactional interface
EP1046107B1 (en) An apparatus, method and computer program product for client/server computing with intelligent location of transaction objects
CN108880873A (en) A kind of affairs compensation method and device applied to heterogeneous system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100193, No. 5, building 16, east 10, East Hospital, No. 502 Wang Dong Road, Beijing, Haidian District

Applicant after: Softcom power information technology (Group) Co.,Ltd.

Address before: 100193, No. 5, building 16, east 10, East Hospital, No. 502 Wang Dong Road, Beijing, Haidian District

Applicant before: ISOFTSTONE INFORMATION TECHNOLOGY (Group) Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20190716

RJ01 Rejection of invention patent application after publication