Method for coordinating updates to database and in-memory cache
First Claim
1. A computer method of caching comprising:
- executing a multi-threaded application, different threads executing respective transactions accessing a data store from a single server;
representing respective status of each of said transactions;
for each transaction, recording in a cache transition from performing the transaction to committing the transaction by twice caching results of the transaction, once based on respective represented transaction status and once based on data store determination of transaction, such that caching is accomplished in a two stage commit where the transaction indicates in its respective represented status that the transaction has started to commit, then the transaction goes on to commit and subsequently sets its respective requested status to indicate that the transaction is done, and the cache is formed of two levels that effectively record the transition from performing the transaction to committing the transaction, wherein each transaction sees its own produced value on top of the cache as shared including known commit values,wherein the step of representing respective status of said transactions includes;
for each transaction, using a respective Future parameter having a Boolean value of true for succeeded/committed and false for failed/rolled back; and
the step of caching results of the transaction includes;
using a flag with the respective Future parameter, the flag recording transition from performing the transaction to committing the transaction and effectively stalling other transactions awaiting conclusion of the transaction.
1 Assignment
0 Petitions
Accused Products
Abstract
A computer method and system of caching. In a multi-threaded application, different threads execute respective transactions accessing a data store (e.g. database) from a single server. The method and system represent status of datastore transactions using respective certain (e.g. Future) parameters.
Results of the said transactions are cached based on transaction status as represented by the certain parameters and on data store determination of a subject transaction. The caching employs a two stage commit and effectively forms a two level cache. One levels maps from datastore keys to entries in the cache. Each entry stores a respective last known commit value. The second level provides an optional mapping from a respective transaction as represented by the corresponding certain parameter to an updated value.
-
Citations
14 Claims
-
1. A computer method of caching comprising:
-
executing a multi-threaded application, different threads executing respective transactions accessing a data store from a single server; representing respective status of each of said transactions; for each transaction, recording in a cache transition from performing the transaction to committing the transaction by twice caching results of the transaction, once based on respective represented transaction status and once based on data store determination of transaction, such that caching is accomplished in a two stage commit where the transaction indicates in its respective represented status that the transaction has started to commit, then the transaction goes on to commit and subsequently sets its respective requested status to indicate that the transaction is done, and the cache is formed of two levels that effectively record the transition from performing the transaction to committing the transaction, wherein each transaction sees its own produced value on top of the cache as shared including known commit values, wherein the step of representing respective status of said transactions includes; for each transaction, using a respective Future parameter having a Boolean value of true for succeeded/committed and false for failed/rolled back; and the step of caching results of the transaction includes; using a flag with the respective Future parameter, the flag recording transition from performing the transaction to committing the transaction and effectively stalling other transactions awaiting conclusion of the transaction. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer caching system comprising:
-
a data store supporting a multi-threaded application, different threads executing respective transactions accessing the data store from a single server; transaction status indicators representing respective status of said transactions; and a cache formed of two level storage, and for each transaction, the cache recording transition from performing the transaction to committing the transaction, by twice storing results of the transaction, once based on transaction status indicators and once based on data store determination of the transaction, such that said cache employs a two phase commit where the transaction indicates in its respective represented status that the transaction has started to commit, then the transaction goes on to commit and subsequently sets its respective requested status to indicate that the transaction is done, and the two level storage effectively records the transition from performing the transaction to committing the transaction, wherein each transaction sees its own produced value on top of the cache as shared including known commit values, wherein the transaction status indicators include; for each transaction, a respective Future parameter having a Boolean value of true for succeeded/committed and false for failed/rolled back; and
wherein the cache stores results of the transaction by;using a flag with the respective Future parameter, the flag recording transition from performing the transaction to committing the transaction and effectively stalling other transactions awaiting conclusion of the transaction. - View Dependent Claims (7, 8, 9, 10, 11, 13)
-
-
12. An in-memory computer cache comprising:
-
given a multi-threaded application, different threads executing respective transactions accessing a data store from a single server, a transaction cache storing results of the transactions and recording transition from performing the transaction to committing the transaction by having; a two level storage, one level mapping from data store keys to entries in the cache; and a second level optionally mapping from a respective transaction to an updated value; wherein each respective transaction is represented by a corresponding value indicative of computations being performed by the transaction and the cache employs a two phase commit where the transaction sets an indication that the transaction has started to commit, then the transaction goes on to commit and then the transaction sets the corresponding value to indicate that the transaction is done, such that each transaction sees its own produced value on top of the cache as shared including known commit values, the corresponding value being a Boolean value of true for succeeded/committed and false for failed/rolled back; and for a given transaction, a flag operably coupled to the second level, the flag recording transition from performing the given transaction to committing the given transaction and effectively stalling other transactions awaiting conclusion of the given transaction.
-
-
14. A computer program product for caching results of database transactions, the computer program product comprising:
-
a computer readable storage medium having computer usable program code embodied therewith, the computer usable program code comprising; computer useable code configured to implement a cache having a two stage commit and two levels such that each database transaction sees its produced updated value on top of an effectively shared store of known commit values, the two levels effectively recording transition from performing the transaction to committing the transaction, the two stage commit including the transaction setting an indication that the transaction has started to commit, then the transaction goes on to commit and then the transaction setting the updated produced values to indicate that the transaction is done; computer usable code configured to implement the database transactions accessing a database from a single server; and computer useable code configured to implement each respective transaction being represented by a corresponding value indicative of computations being performed by the transaction, the corresponding value being a Boolean value of true for succeeded/committed and false for failed/rolled back; wherein the cache stores results of the transaction by using a flag operably coupled to the second level, the flag recording transition from performing the transaction to committing the transaction and effectively stalling other transactions awaiting conclusion of the transaction.
-
Specification