The Apache Jakarta Commons Community has released Commons Transaction 1.0.
Commons Transaction is a spin-off from Jakarta Slide and provides utility classes commonly used in transactional Java programming. Among them are locks, transactional Maps and transactional file access.
Download page:
http://jakarta.apache.org/commons/transaction/downloads.html
Project website:
http://jakarta.apache.org/commons/transaction/
Release notes:
http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-commons/transaction/RELEASE-NOTES.txt?rev=1.3
-
Apache Jakarta Commons Transaction 1.0 released (16 messages)
- Posted by: Oliver Zeigermann
- Posted on: December 15 2004 12:52 EST
Threaded Messages (16)
- Apache Jakarta Commons Transaction 1.0 released by Talip Ozturk on December 15 2004 13:52 EST
- Apache Jakarta Commons Transaction 1.0 released by Oliver Zeigermann on December 15 2004 20:18 EST
- Apache Jakarta Commons Transaction 1.0 released by Oliver Zeigermann on December 15 2004 08:22 EST
- Technical discussions in Commons mailing list by Oliver Zeigermann on December 16 2004 06:34 EST
- Some Sample code by V v on December 16 2004 12:51 EST
- Some Sample code by Oliver Zeigermann on December 16 2004 01:09 EST
- Apache Jakarta Commons Transaction 1.0 released by Oliver Zeigermann on December 15 2004 20:18 EST
- Apache Jakarta Commons Transaction and Lucene by Alex Ruiz on December 15 2004 14:25 EST
- Apache Jakarta Commons Transaction and Lucene by Guglielmo Lichtner on December 15 2004 17:34 EST
- Apache Jakarta Commons Transaction and Lucene by Oliver Zeigermann on December 15 2004 20:35 EST
- Upgrade locks? by Jim LoVerde on December 15 2004 17:17 EST
- Upgrade locks? by Oliver Zeigermann on December 15 2004 20:26 EST
- Upgrade locks? by Cameron Purdy on December 16 2004 02:53 EST
-
Upgrade locks? by Matthias Ernst on December 17 2004 10:31 EST
- Upgrade locks? by Oliver Zeigermann on December 17 2004 11:39 EST
- Upgrade locks? by Oliver Zeigermann on December 16 2004 06:37 EST
- Upgrade locks? by Oliver Zeigermann on December 15 2004 20:26 EST
- about examples by Antonio Sanz on December 20 2004 09:47 EST
-
Apache Jakarta Commons Transaction 1.0 released[ Go to top ]
- Posted by: Talip Ozturk
- Posted on: December 15 2004 13:52 EST
- in response to Oliver Zeigermann
Congrats,
TransactionalMapWrapper assumes that passed wrapped map is not thread-safe so it uses Collections.synchronizedMap(wrapped) to synchronize it. Can you anyone please tell me why? If I want to make my ConcurrentHashMap instance transactional then TransactionalMapWrapper will add synchronization overhead which isn't necessary. I would suggest to assume that wrapped map is thread-safe and document this so that it is the user's responsibility to pass a thread-safe map to the constructor.
keep it up!
-talip -
Apache Jakarta Commons Transaction 1.0 released[ Go to top ]
- Posted by: Oliver Zeigermann
- Posted on: December 15 2004 20:18 EST
- in response to Talip Ozturk
TransactionalMapWrapper assumes that passed wrapped map is not thread-safe so it uses Collections.synchronizedMap(wrapped) to synchronize it. Can you anyone please tell me why? If I want to make my ConcurrentHashMap instance transactional then TransactionalMapWrapper will add synchronization overhead which isn't necessary. I would suggest to assume that wrapped map is thread-safe and document this so that it is the user's responsibility to pass a thread-safe map to the constructor.
Good idea. Maybe using a instanceof check would be even more appropriate?
Oliver -
Apache Jakarta Commons Transaction 1.0 released[ Go to top ]
- Posted by: Oliver Zeigermann
- Posted on: December 15 2004 20:22 EST
- in response to Oliver Zeigermann
TransactionalMapWrapper assumes that passed wrapped map is not thread-safe so it uses Collections.synchronizedMap(wrapped) to synchronize it. Can you anyone please tell me why? If I want to make my ConcurrentHashMap instance transactional then TransactionalMapWrapper will add synchronization overhead which isn't necessary. I would suggest to assume that wrapped map is thread-safe and document this so that it is the user's responsibility to pass a thread-safe map to the constructor.
Good idea. Maybe using a instanceof check would be even more appropriate?Oliver
No, class SynchronizedMap is private :( Still, the overhead should not be too much...
Oliver -
Technical discussions in Commons mailing list[ Go to top ]
- Posted by: Oliver Zeigermann
- Posted on: December 16 2004 06:34 EST
- in response to Talip Ozturk
Technical discussions should take place in the Commons mailing lists:
http://jakarta.apache.org/site/mail2.html#Commons
Oliver -
Some Sample code[ Go to top ]
- Posted by: V v
- Posted on: December 16 2004 12:51 EST
- in response to Talip Ozturk
Could we get some sample code of how to use this lib and in what scenarios it is going to be useful.
Is there an example code posted somewhere? Help would be appreciated.
Till now we have been using DB transaction control only, but this may be useful. -
Some Sample code[ Go to top ]
- Posted by: Oliver Zeigermann
- Posted on: December 16 2004 13:09 EST
- in response to V v
Could we get some sample code of how to use this lib and in what scenarios it is going to be useful.Is there an example code posted somewhere? Help would be appreciated.Till now we have been using DB transaction control only, but this may be useful.
There is a tutorial for locking including source fragments
http://jakarta.apache.org/commons/transaction/locks/tutorial.html
Transactional Map usage would be explained best in the API docs. The access to a transactional map is the same as to an ordinary map (same interface):
http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/memory/TransactionalMapWrapper.html
HTH
Oliver -
Apache Jakarta Commons Transaction and Lucene[ Go to top ]
- Posted by: Alex Ruiz
- Posted on: December 15 2004 14:25 EST
- in response to Oliver Zeigermann
Congratulations!
I apologize in advance if this question does not belong to this forum. Can Commons Transaction be used with Lucene so we could have transaction support when creating/deleting indexes in the file system?
Regards,
Alex. -
Apache Jakarta Commons Transaction and Lucene[ Go to top ]
- Posted by: Guglielmo Lichtner
- Posted on: December 15 2004 17:34 EST
- in response to Alex Ruiz
Congratulations!I apologize in advance if this question does not belong to this forum. Can Commons Transaction be used with Lucene so we could have transaction support when creating/deleting indexes in the file system?Regards,Alex.
To make lucene transactional aren't you going to need a recovery log? -
Apache Jakarta Commons Transaction and Lucene[ Go to top ]
- Posted by: Oliver Zeigermann
- Posted on: December 15 2004 20:35 EST
- in response to Alex Ruiz
Congratulations!I apologize in advance if this question does not belong to this forum. Can Commons Transaction be used with Lucene so we could have transaction support when creating/deleting indexes in the file system?
I have thought about exactly this as well. However, Commons Transaction can not be used to modify existing files. So, if you have on file for the indices, I suppose it will not work.
Oliver -
Upgrade locks?[ Go to top ]
- Posted by: Jim LoVerde
- Posted on: December 15 2004 17:17 EST
- in response to Oliver Zeigermann
Upgrade locks can help significantly increase concurrency (the idea is that only one thread can hold an upgrade lock, but while that is held, it is possible for read locks to exist and/or be obtained, and when the request is made to upgrade to a write lock in the same transaction, the lock manager prevents additional read locks until the write lock can be aquired).
Are there any plans to incorporate upgrade locks into a future release?
From glancing at the API it looks like the framework might support it, all that might need to be done is to implement a ReadWriteUpgradeLock implmentation similar to the existing ReadWriteLock -
Upgrade locks?[ Go to top ]
- Posted by: Oliver Zeigermann
- Posted on: December 15 2004 20:26 EST
- in response to Jim LoVerde
Upgrade locks can help significantly increase concurrency (the idea is that only one thread can hold an upgrade lock, but while that is held, it is possible for read locks to exist and/or be obtained, and when the request is made to upgrade to a write lock in the same transaction, the lock manager prevents additional read locks until the write lock can be aquired).Are there any plans to incorporate upgrade locks into a future release? From glancing at the API it looks like the framework might support it, all that might need to be done is to implement a ReadWriteUpgradeLock implmentation similar to the existing ReadWriteLock
I see. This sounds like a preference to a write lock, right? Anyway, this should be possbile. What are the scenarios in which concurrency is increased with such a lock?
Oliver -
Upgrade locks?[ Go to top ]
- Posted by: Cameron Purdy
- Posted on: December 16 2004 14:53 EST
- in response to Oliver Zeigermann
Upgrade locks can help significantly increase concurrency..
I see. This sounds like a preference to a write lock, right? Anyway, this should be possbile. What are the scenarios in which concurrency is increased with such a lock?Oliver
See the chapter on OCS in the CORBA manuals.
Peace,
Cameron Purdy
Tangosol, Inc.
Coherence: Shared Memories for J2EE Clusters -
Upgrade locks?[ Go to top ]
- Posted by: Matthias Ernst
- Posted on: December 17 2004 10:31 EST
- in response to Oliver Zeigermann
What are the scenarios in which concurrency is increased with such a lock?Oliver
Whenever your writer has a significant phase of "preparation" before it actually starts writing. During that phase it behaves like a reader but has the additional garantuee that noone else is preparing concurrently.
Gruesse
Matthias -
Upgrade locks?[ Go to top ]
- Posted by: Oliver Zeigermann
- Posted on: December 17 2004 11:39 EST
- in response to Matthias Ernst
What are the scenarios in which concurrency is increased with such a lock?Oliver
Whenever your writer has a significant phase of "preparation" before it actually starts writing. During that phase it behaves like a reader but has the additional garantuee that noone else is preparing concurrently.GruesseMatthias
Hey, thanks for explaining, I have implemented this now and it will be part of the 1.1 release. There will be general preference locks as well...
Bis dann,
Oliver -
Upgrade locks?[ Go to top ]
- Posted by: Oliver Zeigermann
- Posted on: December 16 2004 06:37 EST
- in response to Jim LoVerde
Upgrade locks can help significantly increase concurrency (the idea is that only one thread can hold an upgrade lock, but while that is held, it is possible for read locks to exist and/or be obtained, and when the request is made to upgrade to a write lock in the same transaction, the lock manager prevents additional read locks until the write lock can be aquired).Are there any plans to incorporate upgrade locks into a future release? From glancing at the API it looks like the framework might support it, all that might need to be done is to implement a ReadWriteUpgradeLock implmentation similar to the existing ReadWriteLock
I have thought about it for a while and think this should not be too hard to do. I guess the 1.1 release can contain it. By the way the 1.0 version does not have deadlock detection, which already has been implemented for 1.1
Oliver -
about examples[ Go to top ]
- Posted by: Antonio Sanz
- Posted on: December 20 2004 09:47 EST
- in response to Oliver Zeigermann
Hello,
Where are the examples?
I like to see an examples about file sequeence.
And,
How can i use transaction commons to wrap an tcp server
into a xa transaction?
How can i do it?
Thank you