Detailed Description
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other. The invention will be described in detail below with reference to the drawings in connection with embodiments.
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the invention herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to the embodiment of the invention, a method for sending a message corresponding to a transaction is provided.
Fig. 1 is a flowchart of a method for sending a message corresponding to a transaction according to an embodiment of the present invention. As shown in fig. 1, the invention comprises the following steps:
step S101, determining a target transaction, and configuring a corresponding first commit message for the target transaction, wherein the first commit message is used for notifying at least one business system that the target transaction has been committed to completion.
In the application, the corresponding commit message, that is, the first commit message corresponding to the target transaction is configured for the target transaction to be processed in advance, and when the target transaction is committed, the first commit message is used for notifying the business system that the target transaction is committed. For example, in a banking scenario, when the target transaction is a withdrawal, after the withdrawal is completed, the first commit message corresponding to the target transaction is used to notify a service system such as a sms system, an account system, etc., and the balance of the account of the user is changed.
Step S102, the first commit message is subjected to persistence operation to store the first commit message in a local database.
In the above-mentioned manner, in the present application, it is necessary to perform persistence processing on the first commit message, where the persistence-processed commit message is stored in the corresponding local database, and the business operation corresponding to the target transaction and the persistence-processed message data keep a transaction, and the message state that has just been written is to be sent.
Step S103, the life cycle of the target transaction is monitored, and under the condition that the completion of the target transaction commit is determined, a first commit message is extracted and sent to a message middleware, wherein the message middleware is used for receiving the first commit message and forwarding the first commit message to at least one business system corresponding to the target transaction.
In the above-mentioned aspect, the present application provides a concept of a message middleware, by monitoring a life cycle of a target transaction, modifying a message state to be successful in sending according to a receipt received, forwarding a submitted message of a local database to the message middleware according to the receipt that is successful in sending, wherein if a period of event is configured, if the receipt is not received, forwarding the message to the middleware at regular time is started and repeated until the message is successful, and if a successful termination condition is that a failure time of the message has elapsed, restarting the message is not continued. .
Step S104, under the condition that the target transaction commit failure is determined, controlling data corresponding to the target transaction to carry out data rollback operation, and deleting a first commit message corresponding to the target transaction in the local database based on the data rollback operation.
When the target transaction is failed to commit, the corresponding data is subjected to data rollback operation, and the first commit message corresponding to the target transaction in the local database is deleted based on the rollback operation, so that the occurrence of errors that the message is successfully sent under the condition that the transaction is failed to commit is avoided. For example, in an optional scenario, the target transaction is a withdrawal, and if the withdrawal operation fails, the corresponding commit message is deleted based on the rollback data, and the persisted data corresponding to the target transaction is also deleted.
By the method, the problem of consistency of the service data and the corresponding message sending is solved, the problem of coupling between the service data and the corresponding message consistency is solved, the consistency of the message sending and the service operation is not perceived in the service using process, the method is suitable for the condition of complex transaction in the service scene, the transaction characteristic ensures that the message is consistent with the service data, and the complex transaction scene in the service operation is supported.
In an alternative example, after monitoring the life cycle of the target transaction and, if it is determined that the commit of the target transaction is complete, extracting the first commit message and sending the first commit message to the message middleware, the method further includes periodically scanning a local database, and, if the first commit information corresponding to the scanned target transaction is still stored in the local database, extracting the first commit message until the first commit message is successfully forwarded to the message middleware.
Specifically, after the target transaction is submitted successfully, the corresponding submitted message is forwarded to the message middleware, but the message sending failure is caused by downtime, current limitation or network fluctuation of the message middleware, at this time, the phenomenon that the service life is inconsistent with the message sending occurs, and meanwhile, the phenomenon that the service operation is failed and the message sending is successful due to the fact that service data persistence failure after the message sending is successful occurs due to the inconsistency.
In an optional embodiment provided by the application, the local database is scanned periodically to determine whether the first commit message corresponding to the target transaction is still stored in the local database, if so, the first commit message corresponding to the target transaction is forwarded to the message middleware again, and the steps are repeated until the first commit message corresponding to the target transaction is not in the local database, preferably, the specific scanning period can be set according to different service requirements. For example, in a banking scenario, the target transaction is a withdrawal, after the withdrawal is successful, the local database is scanned every 10 seconds, whether the submitted information corresponding to the withdrawal still exists in the local database is judged, if so, the corresponding message is extracted and forwarded to the message middleware until the withdrawal is successful, and the scanning is ended.
In an alternative example, the method further comprises the steps of determining whether to start a sub-transaction corresponding to the target transaction or not, configuring a second commit message corresponding to the sub-transaction and storing the second commit message in a message temporary area corresponding to the sub-transaction if the sub-transaction is determined to be started, wherein the sub-transaction is a data operation transaction based on the target transaction, the second commit message is used for representing the completion of the sub-transaction commit, monitoring the life cycle of the sub-transaction, and persisting the second commit message to a local database when an interception action corresponding to the sub-transaction before commit is acquired, and extracting the second commit message and forwarding the second commit message to the message middleware if the sub-transaction is determined to be completed.
In the above-mentioned aspect, the present application provides a method for sending a message of a nested transaction, where under the condition of determining whether a sub-transaction corresponding to a target transaction is opened, a corresponding second commit message is configured for the sub-transaction, where the second commit message and the first commit message exist independently and do not interfere with each other, and at the same time, the second commit message is stored in a message temporary storage area corresponding to the sub-transaction, where the message temporary storage area is a memory area where a program operates, and is relatively independent.
And monitoring the life cycle of the sub-transaction, persisting the second commit information to a local database when the corresponding action before the sub-transaction is committed is intercepted, and sending the second commit message which is stored in the local database and is subjected to persistence operation to a message middleware after the sub-transaction is committed.
For example, in a banking scenario, the target transaction may be a withdrawal, the sub-transaction corresponding to the withdrawal is a log operation of the withdrawal, and the log operation is not affected and is relatively independent of the withdrawal operation no matter whether the withdrawal operation is successful or failed, a commit message is configured for the log, and the commit message is forwarded to the message middleware after the log is completed.
In an alternative example, in the case that the sub-transaction is determined to be started, the method further comprises suspending the data corresponding to the target transaction and the first commit message before configuring the corresponding second commit message for the sub-transaction and storing the second commit message in the message buffer corresponding to the sub-transaction.
After determining to open the sub-transaction, the data corresponding to the target transaction and the first commit message are suspended to provide an operation space for the operation of the sub-transaction.
In an alternative example, after extracting the second commit message and forwarding to the message middleware in the event that the commit of the sub-transaction is determined to be complete, the method includes periodically scanning a local database, extracting the second commit message and forwarding the second commit message to the message middleware in the event that the second commit information corresponding to the sub-transaction is scanned to remain stored in the local database.
Periodically scanning the local database to determine whether the second commit message corresponding to the sub-transaction is still stored in the local database, forwarding the second commit message corresponding to the sub-transaction to the message middleware again if the second commit message still exists, the steps are repeated until the second commit information corresponding to the sub-transaction is not in the local database, and preferably, a specific scanning period can be set according to different service requirements.
In an alternative example, the lifecycle of the target transaction is monitored and the completion of the target transaction commit is determined, including determining whether the actions before and after the target transaction commit can be intercepted, and determining that the target transaction commit is complete if the actions before and after the commit are intercepted.
In the embodiment provided by the application, whether the target transaction is submitted successfully is determined by intercepting the actions before and after the target transaction is submitted, if both actions are intercepted successfully, the target transaction is determined to be submitted successfully, if only the actions before the target transaction is intercepted and the actions after the target transaction is not submitted, the target transaction is submitted to fail, and if both actions are not intercepted successfully, the target transaction is determined to be submitted to fail.
It should be noted that, during the operation of the nested transaction, whether the sub-transaction is submitted to be completed or not is consistent with the judging method of the main transaction (target transaction).
In an alternative example, in the case that the sub-transaction commit failure is determined, the method comprises the steps of controlling data corresponding to the sub-transaction to perform data rollback operation, and deleting a second commit message corresponding to the sub-transaction in the local database based on the data rollback operation.
And when the sub-transaction fails to commit, the corresponding data is subjected to data rollback operation, and the second commit message corresponding to the sub-transaction in the local database is deleted.
By the method, independent transactions are started in the process of nesting transactions. The message sending user has no perception, namely, the consistency of service operation data and the message is not required to be concerned for a user, the use mode of the message is not different from the use mode of the conventional sending message, only whether the use mode of the consistency is required to be configured, the internal interception mode is adopted for carrying out the persistence and the sending of the message, and the service operation does not need to be concerned when the persistence is carried out and when the message is sent. The consistency of the message is to follow the current transaction of the business operation and keep the data consistent with the current transaction of the business operation. The method and the system meet the scene of complex business operation, and can accurately follow the business to meet the message consistency under the scene of opening independent business and the like. The application gives out how to keep the consistency of the sending of the message and the data of the business operation in detail, which is particularly important for some sensitive data, and supports complex business scenes such as how to ensure the consistency of the data under the condition of transaction nesting, meets the requirement of the transaction nesting, and supports the semantics of the transaction nesting.
In an alternative embodiment of the present application, as shown in fig. 2, fig. 2 is a flowchart of a method for sending a message corresponding to a service according to an embodiment of the present application, and according to this method, success of sending a commit message corresponding to a transaction to a message middleware can be guaranteed to the greatest extent. .
In an optional embodiment provided by the application, the operations of caching, persistence, sending to a commit message middleware, timing restarting and the like of commit messages are performed by adopting a section interception mechanism in combination with spring transaction management, timing scheduling and transaction processing.
There are following types of processing according to the complex scenario of a transaction:
1) Transaction-free wrapping, namely that the submitted message can not follow the business process at the moment and the business process does not have transaction per se, and the following two behaviors are configured according to the following steps:
a. and throwing out the abnormality, and not supporting the transmission mode.
B. and enabling the sub-transaction, persisting the commit message to the local database, and sending the commit message to the commit message middleware after the persistence is finished.
2) The situations where both the target transaction and the sub-transaction exist are discussed in terms of the success and failure of the target transaction and sub-transaction commit.
Fig. 3 is a timing diagram of a successful commit of a target transaction and a successful commit of a sub-transaction according to a method for sending commit messages corresponding to a transaction according to an embodiment of the present invention.
A. Both the target transaction and the sub-transaction are configured with commit messages.
B. after the target transaction sends the commit message, the commit message may enter the commit message store.
C. The target transaction is suspended after the sub-transaction is started, and the commit message buffer of the target transaction is also suspended.
D. the sub-transaction sends the commit message and then the commit message enters a commit message temporary area of the sub-transaction, and when the sub-transaction is committed, interception processing before and after the commit is processed, and persistence processing is carried out on the commit message of the commit message temporary area before the sub-transaction is committed.
E. The sub-transaction, after commit, sends a commit message of the commit message store to the commit message middleware.
F. The target transaction will recover after the sub-transaction completes and the target transaction commit message buffer is restored.
G. the interception processing before and after the target transaction is submitted is processed, and the commit message of the commit message temporary storage area is subjected to persistence processing before the target transaction is submitted.
H. the commit message of the commit message store is sent to the commit message middleware after the target transaction commits.
As shown in FIG. 3, the buffers of the target transaction and the sub-transaction are independent of each other, and commit messages are sent in a consistent manner along with the respective transaction lifecycles.
FIG. 4 is a timing diagram of a successful commit of a target transaction and a failed commit of a sub-transaction according to a method for sending commit messages corresponding to a transaction according to an embodiment of the present invention.
A. the sub-transaction is abnormal after sending the commit message, and the data corresponding to the sub-transaction is rolled back.
B. the commit message buffer of the sub-transaction is cleared when rolling back, at which time the commit message of the sub-transaction is not sent or persisted.
C. The target transaction is submitted normally, and the submitted message sent by the target transaction can be subjected to normal persistence and sent to the submitted message middleware, so that the consistency with the service data can be maintained.
FIG. 5 is a timing diagram of a case where a target transaction commit fails and a sub-transaction commit is successful according to a method for sending commit messages corresponding to transactions according to an embodiment of the present invention.
A. The sub-transaction successfully submits the transaction, and when the transaction is submitted, actions of intercepting the actions before and after the transaction is submitted and performing the persistence of a submitted message temporary area and sending the submitted message to the submitted message middleware are executed.
B. The target transaction recovers after the sub-transaction is successful and recovers the target transaction commit message buffer data.
C. And after the subsequent processing of the target transaction is abnormal, the data corresponding to the target transaction rolls back, the data of the temporary storage area of the submitted message is cleared after the rolling back, the submitted message of the target transaction is not sent, and the data are consistent.
The method for sending the information corresponding to the transaction comprises the steps of determining a target transaction, configuring a corresponding first commit message for the target transaction, wherein the first commit message is used for notifying at least one service system that the target transaction is completed, performing persistence operation on the first commit message to store the first commit message into a local database, monitoring the life cycle of the target transaction, extracting the first commit message and sending the first commit message to a message middleware under the condition that the target transaction is determined to be completed, wherein the message middleware is used for receiving the first commit message and forwarding the first commit message to at least one service system corresponding to the target transaction, controlling data corresponding to the target transaction to perform data rollback operation under the condition that the target transaction is determined to be submitted to fail, deleting the first commit message corresponding to the target transaction in the local database based on the data rollback operation, and further achieving the effect that service operation and corresponding message keep consistent due to some reasons, namely that service operation and corresponding message fail and service operation are also fail to be sent successfully.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the invention also provides a message sending device corresponding to the control transaction, and it is to be noted that the message sending device corresponding to the control transaction of the embodiment of the invention can be used for executing the message sending method corresponding to the transaction provided by the embodiment of the invention. The following describes a message sending device corresponding to a control transaction provided by an embodiment of the present invention.
Fig. 6 is a schematic diagram of a transmission apparatus for controlling a message corresponding to a transaction according to an embodiment of the present invention. As shown in fig. 6, the device comprises a configuration unit 601, a determination unit 603 and a message middleware, wherein the configuration unit determines a target transaction and configures a corresponding first commit message for the target transaction, the first commit message is used for notifying at least one service system that the target transaction is committed to be completed, the persistence unit 602 performs persistence operation on the first commit message to store the first commit message in a local database, the determination unit 603 monitors the life cycle of the target transaction and extracts the first commit message and sends the first commit message to the message middleware when the completion of the commit of the target transaction is determined, the message middleware is used for receiving the first commit message and forwarding the first commit message to at least one service system corresponding to the target transaction, and the deletion unit 604 controls data corresponding to the target transaction to perform data rollback operation when the commit failure of the target transaction is determined.
In an alternative example, the device further comprises a first scanning unit for periodically scanning the local database after the first commit message is extracted and sent to the message middleware under the condition that the life cycle of the target transaction is monitored and the completion of the commit of the target transaction is determined, and a first extracting unit for extracting the first commit message until the first commit message is successfully forwarded to the message middleware under the condition that the first commit information corresponding to the scanned target transaction is still stored in the local database.
In an alternative example, the device further comprises a second extraction unit for monitoring the life cycle of the target transaction and determining whether to start a sub-transaction corresponding to the target transaction before extracting the first commit message and sending the first commit message to the message middleware if the target transaction is determined to be submitted, a storage unit for configuring a second commit message corresponding to the sub-transaction and storing the second commit message to a message temporary storage area corresponding to the sub-transaction if the sub-transaction is determined to be started, wherein the sub-transaction is a data operation transaction based on the target transaction, the second commit message is used for representing the completion of the sub-transaction, a monitoring unit for monitoring the life cycle of the sub-transaction and persisting the second commit message to the local database when the interception action corresponding to the sub-transaction before the completion of the sub-transaction is acquired, and a third extraction unit for extracting the second commit message and forwarding the second commit message to the message middleware if the sub-transaction is determined to be submitted to be completed.
In an alternative example, the device further comprises a suspending unit, and in the case of determining to open the sub-transaction, the suspending unit configures a second commit message corresponding to the sub-transaction, and suspends the data corresponding to the target transaction and the first commit message before storing the second commit message in the message buffer corresponding to the sub-transaction.
In an alternative example, the device comprises a second scanning unit and a forwarding unit, wherein the second scanning unit is used for periodically scanning the local database after extracting a second commit message and forwarding the second commit message to the message middleware under the condition that the completion of the commit of the sub-transaction is determined, and the forwarding unit is used for extracting the second commit message and forwarding the second commit message to the message middleware under the condition that the second commit information corresponding to the scanned sub-transaction is still stored in the local database.
In an alternative example, the monitoring unit comprises a first determining subunit for determining whether the action before the target transaction is submitted and the action after the target transaction is submitted can be intercepted, and a second determining subunit for determining that the target transaction is submitted to be completed under the condition that the action before the target transaction is submitted and the action after the target transaction is intercepted.
The sending device of the information corresponding to the control transaction provided by the embodiment of the invention is used for determining the target transaction and configuring the corresponding first commit message for the target transaction, wherein the first commit message is used for notifying at least one service system that the target transaction is committed to completion, performing persistence operation on the first commit message to store the first commit message into a local database, monitoring the life cycle of the target transaction, extracting the first commit message and sending the first commit message to a message middleware under the condition that the target transaction is committed to completion, wherein the message middleware is used for receiving the first commit message and forwarding the first commit message to at least one service system corresponding to the target transaction, controlling data corresponding to the target transaction to perform data rollback operation under the condition that the target transaction is committed to failure, deleting the first commit message corresponding to the target transaction in the local database based on the data rollback operation, and further solving the problem that service data and corresponding messages in the related technology are inconsistent due to some reasons, namely that the service operation and the corresponding message are successful in synchronization are achieved, and the service operation message is also successful in sending effect is achieved.
The message sending device corresponding to the control transaction comprises a processor and a memory, wherein the configuration unit 601 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the problem that business data and corresponding messages in the related technology are inconsistent due to some reasons is solved by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a computer readable storage medium, on which a program is stored, which when executed by a processor, implements a method for sending a message corresponding to a transaction.
The embodiment of the invention provides a processor which is used for running a program, wherein the program runs to execute a message sending method corresponding to a transaction.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor is used for determining a target transaction and configuring a corresponding first commit message for the target transaction, the first commit message is used for notifying at least one business system that the target transaction is committed, performing persistence operation on the first commit message to store the first commit message into a local database, monitoring the life cycle of the target transaction, extracting the first commit message and sending the first commit message to a message middleware under the condition that the commit of the target transaction is determined to be completed, the message middleware is used for receiving the first commit message and forwarding the first commit message to at least one business system corresponding to the target transaction, and controlling data corresponding to the target transaction to perform data rollback operation under the condition that the commit of the target transaction is determined to fail, and deleting the first commit message corresponding to the target transaction in the local database based on the data rollback operation.
In an alternative example, after monitoring the life cycle of the target transaction and, if it is determined that the commit of the target transaction is complete, extracting the first commit message and sending the first commit message to the message middleware, the method further includes periodically scanning a local database, and, if the first commit information corresponding to the scanned target transaction is still stored in the local database, extracting the first commit message until the first commit message is successfully forwarded to the message middleware.
In an alternative example, the method further comprises the steps of determining whether to start a sub-transaction corresponding to the target transaction or not, configuring a second commit message corresponding to the sub-transaction and storing the second commit message in a message temporary area corresponding to the sub-transaction if the sub-transaction is determined to be started, wherein the sub-transaction is a data operation transaction based on the target transaction, the second commit message is used for representing the completion of the sub-transaction commit, monitoring the life cycle of the sub-transaction, and persisting the second commit message to a local database when an interception action corresponding to the sub-transaction before commit is acquired, and extracting the second commit message and forwarding the second commit message to the message middleware if the sub-transaction is determined to be completed.
In an alternative example, in the case that the sub-transaction is determined to be started, the method further comprises suspending the data corresponding to the target transaction and the first commit message before configuring the corresponding second commit message for the sub-transaction and storing the second commit message in the message buffer corresponding to the sub-transaction.
In an alternative example, after extracting the second commit message and forwarding to the message middleware in the event that the commit of the sub-transaction is determined to be complete, the method includes periodically scanning a local database, extracting the second commit message and forwarding the second commit message to the message middleware in the event that the second commit information corresponding to the sub-transaction is scanned to remain stored in the local database.
In an alternative example, the lifecycle of the target transaction is monitored and the completion of the target transaction commit is determined, including determining whether the actions before and after the target transaction commit can be intercepted, and determining that the target transaction commit is complete if the actions before and after the commit are intercepted.
In an alternative example, in the case that the sub-transaction commit failure is determined, the method comprises the steps of controlling data corresponding to the sub-transaction to perform data rollback operation, and deleting a second commit message corresponding to the sub-transaction in the local database based on the data rollback operation.
The device herein may be a server, PC, PAD, cell phone, etc.
The invention also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with method steps of determining a target transaction and configuring a corresponding first commit message for the target transaction, wherein the first commit message is used for notifying at least one business system that the target transaction has been committed, performing a persistence operation on the first commit message to store the first commit message in a local database, monitoring a lifecycle of the target transaction, and if it is determined that the target transaction has been committed, extracting the first commit message and sending the first commit message to a message middleware, wherein the message middleware is used for receiving the first commit message and forwarding the first commit message to at least one business system corresponding to the target transaction, and if it is determined that the target transaction has failed to commit, controlling data corresponding to the target transaction to perform a data rollback operation, deleting the first commit message corresponding to the target transaction in the local database based on the data rollback operation.
In an alternative example, after monitoring the life cycle of the target transaction and, if it is determined that the commit of the target transaction is complete, extracting the first commit message and sending the first commit message to the message middleware, the method further includes periodically scanning a local database, and, if the first commit information corresponding to the scanned target transaction is still stored in the local database, extracting the first commit message until the first commit message is successfully forwarded to the message middleware.
In an alternative example, the method further comprises the steps of determining whether to start a sub-transaction corresponding to the target transaction or not, configuring a second commit message corresponding to the sub-transaction and storing the second commit message in a message temporary area corresponding to the sub-transaction if the sub-transaction is determined to be started, wherein the sub-transaction is a data operation transaction based on the target transaction, the second commit message is used for representing the completion of the sub-transaction commit, monitoring the life cycle of the sub-transaction, and persisting the second commit message to a local database when an interception action corresponding to the sub-transaction before commit is acquired, and extracting the second commit message and forwarding the second commit message to the message middleware if the sub-transaction is determined to be completed.
In an alternative example, in the case that the sub-transaction is determined to be started, the method further comprises suspending the data corresponding to the target transaction and the first commit message before configuring the corresponding second commit message for the sub-transaction and storing the second commit message in the message buffer corresponding to the sub-transaction.
In an alternative example, after extracting the second commit message and forwarding to the message middleware in the event that the commit of the sub-transaction is determined to be complete, the method includes periodically scanning a local database, extracting the second commit message and forwarding the second commit message to the message middleware in the event that the second commit information corresponding to the sub-transaction is scanned to remain stored in the local database.
In an alternative example, the lifecycle of the target transaction is monitored and the completion of the target transaction commit is determined, including determining whether the actions before and after the target transaction commit can be intercepted, and determining that the target transaction commit is complete if the actions before and after the commit are intercepted.
In an alternative example, in the case that the sub-transaction commit failure is determined, the method comprises the steps of controlling data corresponding to the sub-transaction to perform data rollback operation, and deleting a second commit message corresponding to the sub-transaction in the local database based on the data rollback operation.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present invention and is not intended to limit the present invention. Various modifications and variations of the present invention will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the invention are to be included in the scope of the claims of the present invention.