BTM
  1. BTM
  2. BTM-97

Changes to make BTM friendlier for non-production environments

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.1.1
    • Labels:
      None
    • Number of attachments :
      1

      Description

      bitronix.tm.recovery.RecoveryHelper.recover()
      We at ATG are using BTM for our "development only" support of running our application on Tomcat. We made a two minor changes to make BTM more non-production/development friendly. These changes would not be appropriate for production use, but we are posting them here in the spirit of LGPL disclosure.

      Specifically, two changes were made. One is a change to bitronix.tm.recovery.RecoveryHelper.recover() to work around having insufficient Oracle DB user permissions for recovery.

      A second is a change to bitronix.tm.internal.XAResourceManager.enlist() to allow multiple non-XA connections to be enlisted in a single transaction. Again, this breaks the XA contract, and would not be appropriate for production use.

      See attached files for readme and source with changes. These changes are based on 2.0.0beta2 (as specified in the included readme.txt)
      We at ATG are using BTM for our "development only" support of running our application on Tomcat. We made a two minor changes to make BTM more non-production/development friendly. These changes would not be appropriate for production use, but we are posting them here in the spirit of LGPL disclosure.

      Specifically, two changes were made. One is a change to bitronix.tm.recovery.RecoveryHelper.recover() to work around having insufficient Oracle DB user permissions for recovery.

      A second is a change to bitronix.tm.internal.XAResourceManager.enlist() to allow multiple non-XA connections to be enlisted in a single transaction. Again, this breaks the XA contract, and would not be appropriate for production use.

      See attached files for readme and source with changes. These changes are based on 2.0.0beta2 (as specified in the included readme.txt)

        Activity

        Hide
        Ludovic Orban added a comment -

        That's very nice, thanks!

        I'll consider adding some config options to enable those settings for the next release.

        Show
        Ludovic Orban added a comment - That's very nice, thanks! I'll consider adding some config options to enable those settings for the next release.
        Hide
        Charles Morehead added a comment -

        Having some non-production environment options built-in would be great! Clearly we would prefer not to modify BTM... we settled on BTM after trying several other transaction managers, and have been very pleased with its breadth of database support and stability.

        I suspect you can do a better job with code modifications for continuing despite a failure in transaction recovery (at least with older versions of Oracle where one needs special permissions). I suspect the simplistic change we made may continue to retry recovery with the minimal "don't throw the exception" change we made. I certainly do not claim any kind of deep understanding of the BTM code. (Just trying to set your expectations of those two changes to a reasonably low level.)

        Show
        Charles Morehead added a comment - Having some non-production environment options built-in would be great! Clearly we would prefer not to modify BTM... we settled on BTM after trying several other transaction managers, and have been very pleased with its breadth of database support and stability. I suspect you can do a better job with code modifications for continuing despite a failure in transaction recovery (at least with older versions of Oracle where one needs special permissions). I suspect the simplistic change we made may continue to retry recovery with the minimal "don't throw the exception" change we made. I certainly do not claim any kind of deep understanding of the BTM code. (Just trying to set your expectations of those two changes to a reasonably low level.)
        Hide
        Ludovic Orban added a comment - - edited

        I've quickly hacked in the two features into the 2.1.1 code base and published a snapshot over there: https://nexus.codehaus.org/content/repositories/snapshots/org/codehaus/btm/btm/2.1.1-BTM-97-SNAPSHOT/

        There is a new Configuration property called 'allowMultipleLrc' which disables mutiple LRC resource enlistment check, and a new connection pool property called 'ignoreRecoveryFailures' which prevents a connection pools from being marked as failed when recovery fails on it.

        Could you please give a try at that build and tell me if it works as you expect it to? I'll then productize the changes and make sure they'll end up in 2.1.1.

        Thanks,
        Ludovic

        Show
        Ludovic Orban added a comment - - edited I've quickly hacked in the two features into the 2.1.1 code base and published a snapshot over there: https://nexus.codehaus.org/content/repositories/snapshots/org/codehaus/btm/btm/2.1.1-BTM-97-SNAPSHOT/ There is a new Configuration property called 'allowMultipleLrc' which disables mutiple LRC resource enlistment check, and a new connection pool property called 'ignoreRecoveryFailures' which prevents a connection pools from being marked as failed when recovery fails on it. Could you please give a try at that build and tell me if it works as you expect it to? I'll then productize the changes and make sure they'll end up in 2.1.1. Thanks, Ludovic
        Hide
        Charles Morehead added a comment -

        Just to give a status update, I've successfully tested the allowMultipleLrc changes in your snapshot and those work great in my environment.

        The Oracle database I had been using to reproduce the oracle start-up recovery failure was upgraded to a newer version of Oracle that doesn't require manually adding the recovery privileges. So, I'm having an account created on another, older Oracle DB instance and hope to have that tested later today or tomorrow. I will post a new comment once that's done.

        Show
        Charles Morehead added a comment - Just to give a status update, I've successfully tested the allowMultipleLrc changes in your snapshot and those work great in my environment. The Oracle database I had been using to reproduce the oracle start-up recovery failure was upgraded to a newer version of Oracle that doesn't require manually adding the recovery privileges. So, I'm having an account created on another, older Oracle DB instance and hope to have that tested later today or tomorrow. I will post a new comment once that's done.
        Hide
        Charles Morehead added a comment -

        I was able to reproduce the transaction recovery failure issue with my Oracle instance, and setting the ignoreRecoveryFailures on the individual resource works around that issue. I think we are good to go.

        Thanks, again.

        Show
        Charles Morehead added a comment - I was able to reproduce the transaction recovery failure issue with my Oracle instance, and setting the ignoreRecoveryFailures on the individual resource works around that issue. I think we are good to go. Thanks, again.
        Hide
        Ludovic Orban added a comment -

        The code has been cleaned up and merged back into the master branch. It will make it in release 2.1.1.

        Thanks for the report!

        Show
        Ludovic Orban added a comment - The code has been cleaned up and merged back into the master branch. It will make it in release 2.1.1. Thanks for the report!

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Charles Morehead
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: