This post originated from an RSS feed registered with Java Buzz
by Talip Ozturk.
Original Post: Transactional Distributed Queue, Map, Set and List
Feed Title: Shared Memory
Feed URL: http://www.jroller.com/talipozturk/feed/entries/rss
Feed Description: about java, jcache, jini, javaspaces, distributed data structures and a little bit of me and life.
Hazelcast, with its 1.3 release, is now transactional and as always it is super simple to use. Start a transaction, work with queues, maps, sets and do other stuff then commit/rollback in one shot.
Isolation is always READ_COMMITTED. If you are in a transaction, you can read the data in your transaction and the data that is already commit and if you are not in a transaction, you can only read the committed data. Implementation is different for queue and map/set. For queue operations (offer,poll), offered and/or polled objects are copied to the next member in order to safely commit/rollback. For map/set, Hazelcast first acquires the locks for the write operations (put, remove) and holds the differences (what is added/removed/updated) locally for each transaction. When transaction is set to commit, Hazelcast will release the locks and apply the differences. When rolling back, Hazelcast will simply releases the locks and discard the differences. Transaction instance is attached to the current thread and each Hazelcast operation checks if the current thread holds a transaction, if so, operation will be transaction aware. When transaction is committed, rolled back or timed out, it will be detached from the thread holding it.
This is a huge step forward for Hazelcast. It will continue its journey with listeners and events.
Please visit Hazelcast Group page for complete list of planned features.