Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pokle/transactional-maps
Adds the notion isolated transactions to a map.
https://github.com/pokle/transactional-maps
Last synced: 10 days ago
JSON representation
Adds the notion isolated transactions to a map.
- Host: GitHub
- URL: https://github.com/pokle/transactional-maps
- Owner: pokle
- Created: 2010-03-08T14:25:19.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-03-09T00:15:34.000Z (over 14 years ago)
- Last Synced: 2023-03-11T00:19:15.666Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 273 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A transactional map
----Adds the notion of isolated transactions to a map.
All operations defined on the cut down map interface net.pokle.dbtb.Database can
be commited (or rolledback) in isolation to any changes made in other transactions.
You can also chain transactions ala patchsets in git or mercurial.Here's an example of what's possible: (From DatabaseSampleTest)
// A base database
HashMapDatabase base = new HashMapDatabase();
// And its un-commited transaction
Transaction child = new Transaction(base);// A modification to the base...
base.put("The meaning of life", "0");// ... is visible to both the base and child transactions
assertEquals("0", base.get("The meaning of life"));
assertEquals("0", child.get("The meaning of life"));// A modification of the child transaction...
child.put("The meaning of life", "42");// ... is only visible in the child transaction
assertEquals("42", child.get("The meaning of life"));
assertEquals("0", base.get("The meaning of life"));// You can commit a child transaction to its parent
child.commit();
assertEquals("42", child.get("The meaning of life"));
assertEquals("42", base.get("The meaning of life"));