CN103761140B - A kind of method that issued transaction is realized in isomeric relationship type database - Google Patents
A kind of method that issued transaction is realized in isomeric relationship type database Download PDFInfo
- Publication number
- CN103761140B CN103761140B CN201310631816.XA CN201310631816A CN103761140B CN 103761140 B CN103761140 B CN 103761140B CN 201310631816 A CN201310631816 A CN 201310631816A CN 103761140 B CN103761140 B CN 103761140B
- Authority
- CN
- China
- Prior art keywords
- database
- type
- sql
- sql statement
- heterogeneous
- 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.)
- Active
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of method that issued transaction is realized in isomeric relationship type database.In the method, application process is established with database processing unified interface and connected, and the data analysis unit that request of data is sent to database processing unified interface is analyzed and processed, the type of database that data manipulation is related to is extracted, and searched in database factory;Make it establish with database processing unified interface to connect, database processing unified interface receives the SQL statement that application process sends over, and performs the SQL statement in SQL arrays, and implementing result is preserved in the memory unit;When SQL statement all runs succeeded, the whole results preserved in the memory unit are submitted together, close the multiple databases for being related to affairs, single logical unit of work is set to perform sequence of operations in multiple heterogeneous databases, it is complete to perform, do not perform completely, so as to ensure the accuracy of heterogeneous database operation.
Description
Technical field
The present invention relates to a kind of method that issued transaction is realized in isomeric relationship type database, belong to data base administration skill
Art field.
Background technology
Relevant database(Abbreviation database), the database that is built upon on the basis of relational model, by means of gathering generation
Mathematical concepts and the methods such as number handle the data in database.At present, popular relevant database product has
ORACLE, SYBASE, MySQL, ACCESS etc..Various database products are accounted for oneself distinctive function on database market
There is one seat.
Affairs in database refer to the sequence of operations performed as single logical unit of work, otherwise intactly hold
OK, or not performing completely.Except all operations in non-transactional unit all successfully complete, otherwise not issued transaction may insure
The resource of data-oriented can forever be updated.By the way that one group of relevant operation is combined as either all a success or all failure
Unit, Fault recovery can be simplified and make application program relatively reliable.One logical unit of work will become affairs, it is necessary to full
The so-called ACID of foot(Atomicity, uniformity, isolation and persistence)Attribute specification.
In a process of exchange for carrying out issued transaction, especially shopping on the web in the database, meet affairs
ACID attributes are particularly important.Under normal circumstances, payment operation is smoothed out, final to merchandise successfully, relevant with merchandising
All database informations also successfully update.But if any one link has gone out mistake in this serial procedures, such as
Be abnormal when updating commodity stocks information, customer's bank account is insufficient in fund etc., will all cause Fail Transaction.Once hand over
Easily failure, all information must all keep that the state before transaction is constant, and otherwise, the information of database a piece of will be mixed in database
It is random and unpredictable.
Now with the expansion of global enterprise system, the total capacity of data is doubled and redoubled, in this case, data storage
Distribution is more and more wider, or even the data in same system have been placed in different databases, and different databases has respectively
From data access method and mode, cannot directly interact between heterogeneous database, this just gives operation and access of data
It is greatly inconvenient to bring.In addition, in order to ensure the accuracy of data manipulation in heterogeneous database, under heterogeneous database
Issued transaction problem, is also increasingly valued by people.
To solve the above problems, in the Chinese invention patent application of Publication No. CN102314375A, one kind is disclosed
Isomeric data library storage unified interface and data bank access method.The interface mainly include heterogeneous database driven management unit,
Heterogeneous database connection pool, heterogeneous database operating unit, heterogeneous database connection dispensing unit and unified external API unit.
By the isomeric data library storage unified interface, multiple application processes at the same time can access the database of different structure,
Without modifying to database and program, application process need not understand which kind of database database is so that application program
Design can cast aside completely disparate databases processing design, achieve the purpose that programming is unrelated with database, all data
The operation API in storehouse is identical, simplifies application code, maintains easily, realizes and the transplanting and variation of data.
But for the issued transaction problem under heterogeneous database, effective solution party is not provided in the prior art
Case.
The content of the invention
The technical problems to be solved by the invention are realizing issued transaction in offer one kind in isomeric relationship type database
Method.
To realize above-mentioned goal of the invention, the present invention uses following technical solutions:
A kind of method that issued transaction is realized in isomeric relationship type database, includes the following steps:One is set first
Database factory, extracts the type of database of heterogeneous database and database connects string information, application process and database processing
Unified interface, which is established, connects and is sent to request of data the data analysis unit of database processing unified interface, the data point
Analysis unit analyzes and processes data, extracts the type of database that data manipulation is related to;To these in database factory
The database of type is searched, and it is established with database processing unified interface and connected;Database processing unified interface connects
The SQL statement that application process sends over is received, and processing is grouped to it, the SQL statement in SQL arrays is performed, will perform
As a result preserve in the memory unit, when the SQL statement in SQL arrays all runs succeeded, preserving in the memory unit complete
Portion's result is submitted together, and closes the multiple databases for being related to affairs.
Wherein more preferably, occur performing mistake when performing SQL statement, mistake is marked, notice storage unit SQL
Sentence performs error, and storage unit empties implementing result, all rollback databases for having performed stsndard SQL sentence to original
Beginning state, and close the multiple databases for being related to affairs.
Wherein more preferably, the database processing unified interface further includes program processing unit;
Described program processing unit is analyzed and processed the SQL statement that application program transmission comes, and is stored in SQL arrays,
The SQL arrays are two-dimensional array, for storing the action type of type of database numbering and SQL statement.
Wherein more preferably, in storing process, be related to same database type SQL statement operation be stored in it is adjacent
SQL array locations;
In the process of implementation, the SQL statement for being stored in adjacent SQL array locations is connected to similar using same database
The database of type accesses.
Wherein more preferably, the database factory is provided with heterogeneous database processing unit;
The type of database and database of heterogeneous database in the heterogeneous database processing unit extraction database factory
Connection string information, by configuring key-value pair, will connect the Information hiding of string in key-value pair;
The type of database extracted and key-value pair are stored in class database by the heterogeneous database processing unit respectively
Type array is connected with database in string array.
Wherein more preferably, in the key-value pair, key is the alias of database, is worth the corresponding connection for multiple heterogeneous databases
String.
Wherein more preferably, when there is new database to add, data that the heterogeneous database processing unit will be added newly
The type of database in storehouse connects string information with database and extracts carry out respective handling, and is stored in type of database array sum number
Connected according to storehouse in string array.
The present invention is a kind of method that issued transaction is realized in isomeric relationship type database, by setting a storage single
Member, makes single logical unit of work perform sequence of operations in multiple heterogeneous databases, otherwise complete perform, otherwise do not hold completely
OK, it ensure that the accuracy of data manipulation in heterogeneous database.
Brief description of the drawings
Fig. 1 is the logical construction schematic diagram of database factory in transaction methods provided by the present invention;
Fig. 2 is the flow chart of isomeric relationship type db transaction processing method provided by the present invention.
Embodiment
The present invention is described in further detail with specific embodiment below in conjunction with the accompanying drawings.
The technical problems to be solved by the invention are realizing issued transaction in offer one kind in isomeric relationship type database
Method.This method sets a database factory first, extracts the type of database of heterogeneous database and database connects string
Information, to realize the differentiation of different type, different name databases.Application process is established with database processing unified interface to be connected
Connect and request of data is sent to the data analysis unit of database processing unified interface, data are analyzed and processed, extract
Go out the type of database that data manipulation is related to, the database of these types searched in database factory, and make its with
Database processing unified interface establishes connection.Database processing unified interface receives the SQL statement that application process sends over, and
Storage of array is carried out to it, performs the SQL statement in SQL arrays, implementing result is preserved in the memory unit, when SQL arrays
In SQL statement all run succeeded, submitted together whole implementing results in the memory unit are preserved, and close and be related to thing
Multiple databases of business.Occur performing mistake when performing SQL statement, mistake is marked, notifies storage unit SQL statement
Error is performed, storage unit empties implementing result, all rollback databases for having performed SQL statement to reset condition,
And close the multiple databases for being related to affairs.The above process is described in detail below.
As shown in Figure 1, in transaction methods provided by the present invention, database factory memory storage ORACLE data
Storehouse, MySQL database, the various types of databases of SYBASE databases, and heterogeneous database processing unit is provided with, it is used for
Heterogeneous database is handled.The type of database of heterogeneous database in heterogeneous database processing unit extraction database factory
String information is connected with database, to different type, the differentiation of the database of different names, by configuring key-value pair, will be connected
The Information hiding of string is in key-value pair, to strengthen the security of database access.Wherein key is the alias of database, is worth to be multiple
The corresponding connection string of heterogeneous database, different types of database can be automatically recognized as according to different connection strings.Heterogeneous database
The type of database extracted is stored in type of database array and string number is connected with database by processing unit respectively with key-value pair
In group, easy to the lookup of type of database and database and the attended operation of database processing unified interface.Meanwhile data work
The setting of factory is easy to the infinite expanding of database, and when there is new database to need to add, heterogeneous database processing unit need to
The wide area information server type to be added connects string information with database and extracts carry out respective handling, is stored in class database
Type array is connected with database in string array, improves scalability.
Database processing unified interface includes external interface unit, data analysis unit, program processing unit, connection processing
Unit and storage unit.Wherein external interface unit is used to provide unified calling interface to application process, and application program can be with
Data and SQL statement are transmitted to database processing unified interface by external interface unit to be handled accordingly.
Data analysis unit is used to analyze and process the data that application program transmission comes, and extracts data manipulation and is related to
Type of database and relevant database connection configuration information, easy in database factory to the data of these types
Storehouse is searched, and follow-up attended operation.
Program processing unit is analyzed and processed application program is transmitted the SQL statement come, is stored in two-dimensional array(Claim
For SQL arrays)In, two-dimensional array is used for storing type of database numbering and the action type of SQL statement.Wherein, database
Type number is associated with type of database array, each type of database corresponds to unique number.Performing SQL statement operation
When, SQL statement is handled according to type of database numbering, the SQL statement for acting on the database of same type is stored in
In adjacent SQL array locations, the database of same type is operated using the connection of same database, can be reduced and data
The access times of storehouse connection, improve issued transaction efficiency.
The type of database that the configuration information and data manipulation that connection processing unit is connected according to database are related to is from number
According to finding Relational database in the heterogeneous database processing unit of storehouse factory and establish a connection.What application program was sent
For SQL statement after processing, type of database numbering and relevant configuration information in SQL arrays are automatically found phase
The database connection answered, carry out SQL statement performs operation.
Storage unit is used for preserving the implementing result of SQL statement, when the SQL statement in SQL arrays all runs succeeded,
The whole implementing results preserved in the memory unit are submitted together, and close the multiple databases for being related to affairs.Performing SQL languages
During sentence, if there is mistake is performed, then mistake is marked, while notifies storage unit SQL statement to perform error, storage is single
Member empties implementing result, and the SQL statement of all database executeds all rolls back to reset condition.The setting of storage unit,
Multiple heterogeneous databases is performed sequence of operations, or complete perform, or not performing completely, ensure that heterogeneous database is held
Act the accuracy of business.
As shown in Fig. 2, when data are transmitted to database processing unified interface by application program by external interface unit, number
Analyzed and processed according to the data analysis unit of storehouse processing unified interface to transmitting the data come, extract what data manipulation was related to
Type of database and relevant database connection configuration information, easy in database factory to the database of these types
Searched and follow-up attended operation.Confidence is matched somebody with somebody in database connection of the connection processing unit in data analysis unit
The type of database that breath and data manipulation are related to finds related data from the heterogeneous database processing unit of database factory
Storehouse simultaneously establishes a connection, and waits the automatic lookup connected according to the order of SQL statement to associated databases.Application program will
SQL statement is transmitted to program processing unit, the type of database and SQL statement that program processing unit is operated according to SQL statement
Action type analyze it processing, be stored in SQL arrays, wherein, be two-dimensional array in SQL arrays, for storing number
According to storehouse type number and the action type of SQL statement.In storing process, it is related to the SQL statement behaviour of same database type
Adjacent S QL array units are stored in, batch runs are carried out according to the type of database easy to the later stage.Connection processing unit
Type of database numbering and relevant configuration information in SQL arrays are automatically found corresponding database connection, perform
The operation of SQL statement in SQL arrays, and operating result is stored in storage unit, when the SQL statement in SQL arrays is all held
Go successfully, the whole implementing results preserved in the memory unit are submitted together, and close the multiple databases for being related to affairs;When
Occur performing mistake when performing stsndard SQL sentence, mistake is marked, notice storage unit SQL statement performs error, stores
Unit empties implementing result, all rollback databases for having performed stsndard SQL sentence to reset condition, and closes and be related to
Multiple databases of affairs.
Isomeric relationship type db transaction processing method provided by the present invention, by setting a database factory and one
A database processing unified interface, realizes the operation to heterogeneous database;By the foundation of SQL arrays, reduce and database
Number is connected, improves issued transaction efficiency.When the SQL statement in SQL arrays all runs succeeded, preserving in the memory unit
Whole implementing results submit together, occur performing mistake when performing SQL statement, mistake be marked, notice storage is single
First SQL statement performs error, and storage unit empties implementing result, and all rollback databases for having performed SQL statement arrive
Reset condition, by setting storage unit, the effective guarantee correctness of data manipulation.
The method provided by the present invention that issued transaction is realized in isomeric relationship type database has been carried out in detail above
Explanation.To those skilled in the art, it is done on the premise of without departing substantially from true spirit any aobvious
And the change being clear to, it will all form to infringement of patent right of the present invention, corresponding legal liabilities will be undertaken.
Claims (8)
1. a kind of method that issued transaction is realized in isomeric relationship type database, sets a database factory, extraction first
The type of database of heterogeneous database connects string information with database;Application process is established with database processing unified interface to be connected
Connect, and request of data is sent to the data analysis unit of database processing unified interface;The data analysis unit is to data
Analyzed and processed, extract the type of database that data manipulation is related to, correspondence database is searched in the database factory
Multiple databases of type, and the database is established with the database processing unified interface and connect, it is characterised in that
After aforesaid operations are completed,
Database processing unified interface receives the SQL statement that application process sends over, the SQL statement that application program transmission is come
Analyzed and processed, by type of database numbering and the action type deposit SQL arrays of SQL statement, act on same type
The SQL statement of database be stored in adjacent SQL array locations, numbered and performed in SQL arrays according to type of database
SQL statement, operates the database of same type using the connection of same database, implementing result is stored in storage unit
In;When the SQL statement in SQL arrays all runs succeeded, the whole results preserved in the memory unit are submitted together, and closes
Close the multiple databases for being related to affairs.
2. the method for issued transaction is realized in isomeric relationship type database as claimed in claim 1, it is characterised in that:
Occur performing mistake when performing SQL statement, mistake is marked, notice storage unit SQL statement performs error, deposits
Storage unit empties implementing result, all rollback databases for having performed stsndard SQL sentence to reset condition, and closes and relate to
And multiple databases of affairs.
3. the method for issued transaction is realized in isomeric relationship type database as claimed in claim 1, it is characterised in that:
The database processing unified interface further includes program processing unit;
Described program processing unit is analyzed and processed the SQL statement that application program transmission comes, and is stored in SQL arrays, described
SQL arrays are two-dimensional array, for storing the action type of type of database numbering and SQL statement.
4. the method for issued transaction is realized in isomeric relationship type database as claimed in claim 3, it is characterised in that:
In storing process, the SQL statement operation for being related to same database type is stored in adjacent SQL array locations.
5. the method for issued transaction is realized in isomeric relationship type database as claimed in claim 3, it is characterised in that:
In the process of implementation, the SQL statement for being stored in adjacent SQL array locations is connected to same type using same database
Database accesses.
6. the method for issued transaction is realized in isomeric relationship type database as claimed in claim 1, it is characterised in that:
The database factory is provided with heterogeneous database processing unit;
The type of database of heterogeneous database is connected with database in the heterogeneous database processing unit extraction database factory
String information, by configuring key-value pair, will connect the Information hiding of string in key-value pair;
The type of database extracted and key-value pair are stored in type of database number by the heterogeneous database processing unit respectively
Group is connected with database in string array.
7. the method for issued transaction is realized in isomeric relationship type database as claimed in claim 6, it is characterised in that:
In the key-value pair, key is the alias of database, is worth the corresponding connection string for multiple heterogeneous databases.
8. the method for issued transaction is realized in isomeric relationship type database as claimed in claim 6, it is characterised in that:
When there is new database to add, the heterogeneous database processing unit by the wide area information server type newly added and
Database connection string information extracts carry out respective handling, and is stored in type of database array and string array is connected with database
In.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310631816.XA CN103761140B (en) | 2013-11-29 | 2013-11-29 | A kind of method that issued transaction is realized in isomeric relationship type database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310631816.XA CN103761140B (en) | 2013-11-29 | 2013-11-29 | A kind of method that issued transaction is realized in isomeric relationship type database |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103761140A CN103761140A (en) | 2014-04-30 |
CN103761140B true CN103761140B (en) | 2018-04-13 |
Family
ID=50528384
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310631816.XA Active CN103761140B (en) | 2013-11-29 | 2013-11-29 | A kind of method that issued transaction is realized in isomeric relationship type database |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103761140B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104933173B (en) * | 2015-06-30 | 2019-01-15 | 北京京东尚科信息技术有限公司 | It is a kind of for the data processing method of isomery multi-data source, device and server |
CN105389342A (en) * | 2015-10-23 | 2016-03-09 | 浪潮软件股份有限公司 | Database access tool, system and method |
CN106021071A (en) * | 2016-05-04 | 2016-10-12 | 北京思特奇信息技术股份有限公司 | Method and system for monitoring SQL operation process |
WO2018082079A1 (en) * | 2016-11-07 | 2018-05-11 | 深圳中兴力维技术有限公司 | Method and apparatus for dynamically managing data exchange |
CN107704584B (en) * | 2017-10-09 | 2020-06-16 | 易联众信息技术股份有限公司 | Payment method adopting database application plug-in |
CN107948309A (en) * | 2017-12-15 | 2018-04-20 | 神思电子技术股份有限公司 | A kind of integrated management method and system of the server resource based on Restful API |
CN108958955A (en) * | 2018-07-06 | 2018-12-07 | 美利车(北京)网络技术有限公司 | A kind of transaction methods and device based on message-driven |
CN114157501B (en) * | 2021-12-08 | 2024-01-23 | 北京天融信网络安全技术有限公司 | Parameter analysis method and device based on TianRui database |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101196926A (en) * | 2007-12-29 | 2008-06-11 | 中国建设银行股份有限公司 | Database access platform and access method thereof |
CN101493825A (en) * | 2008-12-17 | 2009-07-29 | 武汉中地数码科技有限公司 | GIS middleware collocation and management method |
CN102314375A (en) * | 2011-03-18 | 2012-01-11 | 北京神州数码思特奇信息技术股份有限公司 | Heterogeneous database storage unified interface and database access method |
CN102521254A (en) * | 2011-11-17 | 2012-06-27 | 广东电网公司电力科学研究院 | Uniform access method of isomeric database |
CN103136231A (en) * | 2011-11-25 | 2013-06-05 | 中国移动通信集团江苏有限公司 | Data synchronization method and system for heterogeneous databases |
CN103198159A (en) * | 2013-04-27 | 2013-07-10 | 国家计算机网络与信息安全管理中心 | Transaction-redo-based multi-copy consistency maintaining method for heterogeneous clusters |
-
2013
- 2013-11-29 CN CN201310631816.XA patent/CN103761140B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101196926A (en) * | 2007-12-29 | 2008-06-11 | 中国建设银行股份有限公司 | Database access platform and access method thereof |
CN101493825A (en) * | 2008-12-17 | 2009-07-29 | 武汉中地数码科技有限公司 | GIS middleware collocation and management method |
CN102314375A (en) * | 2011-03-18 | 2012-01-11 | 北京神州数码思特奇信息技术股份有限公司 | Heterogeneous database storage unified interface and database access method |
CN102521254A (en) * | 2011-11-17 | 2012-06-27 | 广东电网公司电力科学研究院 | Uniform access method of isomeric database |
CN103136231A (en) * | 2011-11-25 | 2013-06-05 | 中国移动通信集团江苏有限公司 | Data synchronization method and system for heterogeneous databases |
CN103198159A (en) * | 2013-04-27 | 2013-07-10 | 国家计算机网络与信息安全管理中心 | Transaction-redo-based multi-copy consistency maintaining method for heterogeneous clusters |
Also Published As
Publication number | Publication date |
---|---|
CN103761140A (en) | 2014-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103761140B (en) | A kind of method that issued transaction is realized in isomeric relationship type database | |
US10409782B2 (en) | Platform, system, process for distributed graph databases and computing | |
US10678808B2 (en) | Eager replication of uncommitted transactions | |
US8738568B2 (en) | User-defined parallelization in transactional replication of in-memory database | |
CN103365929B (en) | The management method of a kind of data base connection and system | |
Ashlagi et al. | New challenges in multihospital kidney exchange | |
JP4293794B2 (en) | Synchronous change data capture within a relational database | |
US20130246379A1 (en) | System and method for supporting application interoperation in a transactional middleware environment | |
CN107070919A (en) | Idempotence for db transaction | |
US9400719B2 (en) | Recovery of a transaction after XA end | |
CN102317913B (en) | A kind of transaction recovery method and transaction recovery device | |
CN102073540A (en) | Distributed affair submitting method and device thereof | |
CN102103642B (en) | Data-erasure method based on OLTP, system and graphic data base server | |
CN103782573A (en) | Masking server outages from clients and applications | |
KR20140147812A (en) | Systems and methods for supporting inline delegation of middle-tier transaction logs to database | |
WO2020000720A1 (en) | Server, packet processing method, program, and computer-readable storage medium | |
US10282457B1 (en) | Distributed transactions across multiple consensus groups | |
US10394805B2 (en) | Database management for mobile devices | |
CN101350022B (en) | Changing process method based on database logical lock | |
US20060136443A1 (en) | Method and apparatus for initializing data propagation execution for large database replication | |
JP6975153B2 (en) | Data storage service processing method and equipment | |
CN103019826A (en) | Method and device for processing events | |
CN104699790B (en) | A kind of bank data relation establishing method and device | |
US20140108367A1 (en) | Client apparatus and database server for resumable transaction and method thereof | |
CN112104504B (en) | Transaction management framework for large-scale resource access, design method and cloud platform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |