Commons Dbcp
  1. Commons Dbcp
  2. DBCP-289

Allow client to set a XADatasource instance instead of only its classname in BasicManagedDataSource

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.3
    • Labels:
      None

      Description

      BasicManagedDataSource currently allows to set the classname of an XADatasource to create XA-enabled connections.
      If done so the datasource is created using the Reflection-API.

      I think in most cases this is not enough, since DataSources usually need some kind of configuration. In my case this would be the connection-url to the database (I use MysqlXADatasource which wants its setUrl(url) method called).

      For this reason i think it would be useful to let the client set the XADataSource instance instead of its classname (optional). The same is done now with the TransactionManager-Implementation.

      For this reason i'd suggest a getter and setter as well as a new member xaDataSourceInstance as an alternative option to the classname.

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          188d 8h 24m 1 Phil Steitz 25/Oct/09 18:23
          Resolved Resolved Closed Closed
          112d 8h 1 Phil Steitz 15/Feb/10 02:24
          Aaron Hamid made changes -
          Link This issue relates to DBCP-360 [ DBCP-360 ]
          Phil Steitz made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Phil Steitz made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Phil Steitz added a comment -

          Modified version of the patch applied in 829623. Changes to the patch:

          1) Made getter/setter synchronized and field private.
          2) Setter sets xads classname field
          3) class loading and creation of instance with xads classname are only done if the xa datasource instance has not been set

          Thanks for the patch!

          Show
          Phil Steitz added a comment - Modified version of the patch applied in 829623. Changes to the patch: 1) Made getter/setter synchronized and field private. 2) Setter sets xads classname field 3) class loading and creation of instance with xads classname are only done if the xa datasource instance has not been set Thanks for the patch!
          Mark Thomas made changes -
          Fix Version/s 1.3 [ 12311977 ]
          Affects Version/s 1.2.2 [ 12311976 ]
          Affects Version/s 1.3 [ 12311977 ]
          Marc Kannegießer made changes -
          Field Original Value New Value
          Attachment set_xadatasource_instance.patch [ 12405907 ]
          Hide
          Marc Kannegießer added a comment -

          The given patch realizes the described suggestions

          Show
          Marc Kannegießer added a comment - The given patch realizes the described suggestions
          Marc Kannegießer created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Marc Kannegießer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development