Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-559

数据库连接可以通过BasicDataSource类的close()方法进行关闭,但该类没有提供open()方法使得新建的数据库连接生效

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.8.0
    • Labels:
    • Flags:
      Patch, Important

      Description

      当前该开源软件具备的功能:若数据库连接被关闭(即closed置为true),则必须重启服务,才能使新的数据库连接生效(closed置为false)。

      针对容灾场景,若数据库连接串发生变化,为了使新的数据库连接动态生效(热生效),不需要手工重启服务,建议该开源软件BasicDataSource类提供一个open()方法用于置closed = false;以使建立的数据库连接生效。

      变更的代码见附件。

      注:附件是基于2.7.0版本代码进行优化的。

        Attachments

        1. BasicDataSource.java
          92 kB
          Wenzhi Ji
        2. BasicDataSourceMXBean.java
          9 kB
          Wenzhi Ji

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Jason_HW Wenzhi Ji
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Time Spent - 50m Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - 50m Remaining Estimate - 10m
                50m