Unlock instant, AI-driven research and patent intelligence for your innovation.

A method and apparatus for interacting data with a database

An interactive data and database technology, applied in the computer field, can solve the problems of reducing the ability of the system to process transactions and the low ability of the system to process transactions, and achieve the effect of reducing the locking time and guaranteeing the ability

Active Publication Date: 2021-03-05
中国移动通信集团江西有限公司 +1
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Since each transaction submission requires multiple interactions with XA resources, the transaction processing capacity of the system using the XA protocol to submit transactions is low
Strictly follow the XA two-phase protocol to submit transactions. Each time a transaction is submitted, it is necessary to conduct two-step operations of voting statistics and submitting transactions for each XA resource participating in the transaction. The voting phase and the transaction submission phase will Resources are locked to ensure data consistency. The longer the locking time, the more the ability of the system to process transactions will be reduced.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and apparatus for interacting data with a database
  • A method and apparatus for interacting data with a database
  • A method and apparatus for interacting data with a database

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0130] From attached figure 2 In the normal submission process, it can be seen that for a transaction involving two XA resources, a transaction needs to interact with each XA resource at least 4 times from start to completion, namely voting, agreeing to submit, submitting and submitting to complete.

[0131] If a non-XA resource is allowed to participate in the transaction, the transaction commit operation of the non-XA resource is placed between the phase 1 and phase 2 of the XA resource transaction commit, which can not only ensure the consistency of the data, but also ensure that the resources participating in the transaction are relatively When it is small, the performance of the transaction is greatly improved.

[0132] That is to say, the number of local XA resources participating in the transaction in the global transaction is greater than 1, and the number of remote branches participating in the transaction in the global transaction is 0. The calling phase includes th...

no. 2 example

[0161] For a transaction that only one XA resource participates in, you can directly use one-phase commit to commit the transaction, reducing the number of interactions between the transaction manager and the XA resource.

[0162] That is to say, the number of local XA resources participating in the transaction in the global transaction is 1, and the number of remote branches participating in the transaction in the global transaction is 0, and the calling phase includes phase 1.

[0163] (1) Divide atomic operations

[0164] Figure 8 It is a schematic diagram of atomic division in the second embodiment of the present invention. Use XAResource.start and XAResource.end to partition atomic work on the only XA resource participating in the transaction.

[0165] (2) Existing commit / rollback transactions

[0166] Figure 9 It is a schematic diagram of transaction submission in the prior art. When a transaction needs to be committed, first call XAResource.prepare to vote on the...

no. 3 example

[0174] For global transactions with remote branches participating in the transaction, when committing the transaction, it is necessary to call XAResource.papare of all XA resources participating in the transaction initiator to collect the results. If all XA resources participating in the transaction initiator return XAResource.XA_COMMIT, it is necessary to continue to let all XAResources participating in the branch count the statistical results of calling XAResource.prepare, if the XAResource participating in all branches of the transaction calls XAResource. prepare returns XAResource.XA_COMMIT, then the remote branch can commit the transaction. After the remote branch successfully submits the XA transaction, the local branch submits the XA transaction again.

[0175] Specifically, the number of local XA resources participating in the transaction in the global transaction is greater than or equal to 1, and the number of remote branches participating in the transaction in the g...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

A method and device for exchanging data with a database, including: determining the call phase according to the number of local XA resources participating in the transaction in the global transaction and the number of remote branches participating in the transaction in the global transaction; using the start identifier and the end identifier Divide the atomic operation; submit the transaction between the start mark and the end mark to the database according to the call phase; or roll back the transaction between the start mark and the end mark from the database according to the call phase. It can reduce the locking time of XA resources, thereby ensuring the ability of the system to process transactions.

Description

technical field [0001] The invention relates to the field of computers, in particular to a method and a device for exchanging data with a database. Background technique [0002] Distributed transaction processing means that a transaction may involve multiple database operations. The key to distributed transaction processing is that there must be a way to know all the actions that the transaction takes anywhere, and the decision to commit or roll back the transaction must produce a unified result, that is: all commits or all rollbacks. [0003] The XA two-phase transaction commit protocol is a two-phase commit protocol defined by the X / OPEN organization and used in a distributed transaction environment to ensure data consistency and integrity among multiple resources participating in the transaction. At present, mainstream databases and message middleware servers all support the XA protocol. [0004] When it is necessary to commit a transaction, call XAResource.papare of ea...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/27G06F16/2458
Inventor 章兴旺杨运良
Owner 中国移动通信集团江西有限公司