Apache common transactions has an implementation of transactional maps. Check if that puts you in any direction. It is also possible to configure that with spring transaction management so that commits and rollbacks are respected. In general what you need is to have thread local variables contain modifications done in scope of a transaction and then you need to hook into transaction call backs so that you get notified when is appropriate to put changes back in the main stack or just discard them.