Derby
  1. Derby
  2. DERBY-2485

Add OO callback scheme for transaction commit & rollback at LanguageConnectionContext layer

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: JDBC, SQL
    • Urgency:
      Normal

      Description

      Add a schemewhere objects can register to be notified before commit, rollback, savepoint/statement rollback. This would be at the LCC layer so that it can be used by language elements and JDBC elements. Benefits are code clarity, performance and consistent behaviour.

      Some discussion at:

      http://mail-archives.apache.org/mod_mbox/db-derby-dev/200703.mbox/%3c4600A695.5050506@apache.org%3e

        Activity

        Hide
        Daniel John Debrunner added a comment -

        In looking more at this it is probably best to make this callback scheme independent of the language layer. A standalone transaction facility.
        Then code from the store layers could also migrate to use its facilities. Currently many of the methods on TransactionController perform
        two actions, the first to get some object from a factory (e.g. a sort) and second to register it to ensure it is cleaned up at end transaction time.
        By having a single transaction facility the method to get an object could be directly from the factory, passing in a transaction object and then
        the object would register itself with the transaction as required.

        Show
        Daniel John Debrunner added a comment - In looking more at this it is probably best to make this callback scheme independent of the language layer. A standalone transaction facility. Then code from the store layers could also migrate to use its facilities. Currently many of the methods on TransactionController perform two actions, the first to get some object from a factory (e.g. a sort) and second to register it to ensure it is cleaned up at end transaction time. By having a single transaction facility the method to get an object could be directly from the factory, passing in a transaction object and then the object would register itself with the transaction as required.
        Hide
        Daniel John Debrunner added a comment -

        I added a couple of classes (TransactionControl & TransactionListener) into a new package

        org.apache.derby.iapi.transaction

        These are intended as a starting point for such a callback scheme, the final api's might be different in their approach as how to remove listeners.

        These classes are not yet compiled or used by any derby code.

        Show
        Daniel John Debrunner added a comment - I added a couple of classes (TransactionControl & TransactionListener) into a new package org.apache.derby.iapi.transaction These are intended as a starting point for such a callback scheme, the final api's might be different in their approach as how to remove listeners. These classes are not yet compiled or used by any derby code.

          People

          • Assignee:
            Unassigned
            Reporter:
            Daniel John Debrunner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development