MMBase

DatabaseTransaction linked to the current thread.

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.0
  • Fix Version/s: 1.9.1
  • Component/s: Core, Database Layer
  • Description:
    Hide
    StorageManagerFactory implementation nicely supports database transactions. But the rest of the code of mmbase doesn't, because the idea seems to be that you keep track of your StorageManager.

    Most code does howewer property get it's StorageManager from the Factory.

    So, with a simple change, we can use ThreadLocal and tie a StorageManager ot the current thread, and call beginTransaction, commit, rollback on that, before and after you do your thing with the rest of the code. The only limitation being, of course, that you limit yourself to one thread. Which is probably a wise thing to do anyway, if you're commiting a transaction.
    Show
    StorageManagerFactory implementation nicely supports database transactions. But the rest of the code of mmbase doesn't, because the idea seems to be that you keep track of your StorageManager. Most code does howewer property get it's StorageManager from the Factory. So, with a simple change, we can use ThreadLocal and tie a StorageManager ot the current thread, and call beginTransaction, commit, rollback on that, before and after you do your thing with the rest of the code. The only limitation being, of course, that you limit yourself to one thread. Which is probably a wise thing to do anyway, if you're commiting a transaction.

Activity

People

Dates

  • Created:
    2009-01-30 23:00
    Updated:
    2009-01-30 23:02
    Resolved:
    2009-01-30 23:02