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

2020-08-09 Thread Phil Steitz (Jira)


[ 
https://issues.apache.org/jira/browse/DBCP-559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173949#comment-17173949
 ] 

Phil Steitz commented on DBCP-559:
--

PR is [here|https://github.com/apache/commons-dbcp/pull/50].
 * One thing missing in the list above, but made clear in javadoc is that 
connections checked out when restart is invoked don't count in the "new" pool's 
metrics. So for example if there are 3 out when restart or close - start is 
called, they may be as many as maxTotal + 3 out until the old ones get 
returned. It would be a little complicated to try to keep those connections in 
the post-restart counts.
 * I included no-op defaults for start (called "open" above) and restart in the 
interface spec to preserve backward compatibility. Any better ideas on how to 
handle that welcome.
 * I did not include eviction timer leak tests or much else to verify no side 
effects. More tests would be good.
 * Checkstyle now says BDS is too big.

> 数据库连接可以通过BasicDataSource类的close()方法进行关闭,但该类没有提供open()方法使得新建的数据库连接生效
> ---
>
> Key: DBCP-559
> URL: https://issues.apache.org/jira/browse/DBCP-559
> Project: Commons DBCP
>  Issue Type: Improvement
>Affects Versions: 2.8.0
>Reporter: Wenzhi Ji
>Priority: Major
>  Labels: ready-to-commit
> Fix For: 2.8.0
>
> Attachments: BasicDataSource.java, BasicDataSourceMXBean.java
>
>   Original Estimate: 1h
>  Time Spent: 10m
>  Remaining Estimate: 50m
>
> 当前该开源软件具备的功能:若数据库连接被关闭(即closed置为true),则必须重启服务,才能使新的数据库连接生效(closed置为false)。
> 针对容灾场景,若数据库连接串发生变化,为了使新的数据库连接动态生效(热生效),不需要手工重启服务,建议该开源软件BasicDataSource类提供一个open()方法用于置closed
>  = false;以使建立的数据库连接生效。
> 变更的代码见附件。
> 注:附件是基于2.7.0版本代码进行优化的。



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


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

2020-08-07 Thread Phil Steitz (Jira)


[ 
https://issues.apache.org/jira/browse/DBCP-559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173447#comment-17173447
 ] 

Phil Steitz commented on DBCP-559:
--

I am working on a PR with tests for this, though I will happily review any PRs 
that come in before I finish.   A [similar 
request|[https://lists.apache.org/thread.html/rf9006a5e3285bc32f0742ad4833c39852601305d5e56fc03dde60043%40%3Cusers.tomcat.apache.org%3E]]
 was recently posted to tomcat-user.

I am hoping that close followed by the simple open proposed in the attachment 
file (possibly also exposed as combined, "restart") will lead to
 # Idle connections get immediately closed (close contract)
 # Checked out connections get closed as they return (but abandoned connection 
cleanup stops for the pool being closed)
 # Any config changes made since initialization of running pool are applied to 
the new pool
 # New connections get sourced from a new pool that is initialized in "open"
 # No timer thread leaks or other untoward side effects

I will try to add tests to confirm.

 

> 数据库连接可以通过BasicDataSource类的close()方法进行关闭,但该类没有提供open()方法使得新建的数据库连接生效
> ---
>
> Key: DBCP-559
> URL: https://issues.apache.org/jira/browse/DBCP-559
> Project: Commons DBCP
>  Issue Type: Improvement
>Affects Versions: 2.8.0
>Reporter: Wenzhi Ji
>Priority: Major
>  Labels: ready-to-commit
> Fix For: 2.8.0
>
> Attachments: BasicDataSource.java, BasicDataSourceMXBean.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 当前该开源软件具备的功能:若数据库连接被关闭(即closed置为true),则必须重启服务,才能使新的数据库连接生效(closed置为false)。
> 针对容灾场景,若数据库连接串发生变化,为了使新的数据库连接动态生效(热生效),不需要手工重启服务,建议该开源软件BasicDataSource类提供一个open()方法用于置closed
>  = false;以使建立的数据库连接生效。
> 变更的代码见附件。
> 注:附件是基于2.7.0版本代码进行优化的。



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


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

2020-07-28 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/DBCP-559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17166651#comment-17166651
 ] 

Gary D. Gregory commented on DBCP-559:
--

I'd like to see a PR to make it clear.

 

> 数据库连接可以通过BasicDataSource类的close()方法进行关闭,但该类没有提供open()方法使得新建的数据库连接生效
> ---
>
> Key: DBCP-559
> URL: https://issues.apache.org/jira/browse/DBCP-559
> Project: Commons DBCP
>  Issue Type: Improvement
>Affects Versions: 2.8.0
>Reporter: Wenzhi Ji
>Priority: Major
>  Labels: ready-to-commit
> Fix For: 2.8.0
>
> Attachments: BasicDataSource.java, BasicDataSourceMXBean.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 当前该开源软件具备的功能:若数据库连接被关闭(即closed置为true),则必须重启服务,才能使新的数据库连接生效(closed置为false)。
> 针对容灾场景,若数据库连接串发生变化,为了使新的数据库连接动态生效(热生效),不需要手工重启服务,建议该开源软件BasicDataSource类提供一个open()方法用于置closed
>  = false;以使建立的数据库连接生效。
> 变更的代码见附件。
> 注:附件是基于2.7.0版本代码进行优化的。



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


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

2020-07-28 Thread Phil Steitz (Jira)


[ 
https://issues.apache.org/jira/browse/DBCP-559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17166644#comment-17166644
 ] 

Phil Steitz commented on DBCP-559:
--

This looks reasonable to me.  The change is just to add an "open" method to BDS 
that sets closed to false, which will effectively cause the datasource to 
re-initialize itself when getConnection is called.  The change to the JMX class 
is just to expose the method.  Seems a safe and useful change to me, unless I 
am missing something.  It might be best to change the name to "start" and maybe 
also expose "stop" and "restart" via JMX.  Does anyone see any reason not to 
add these methods?

> 数据库连接可以通过BasicDataSource类的close()方法进行关闭,但该类没有提供open()方法使得新建的数据库连接生效
> ---
>
> Key: DBCP-559
> URL: https://issues.apache.org/jira/browse/DBCP-559
> Project: Commons DBCP
>  Issue Type: Improvement
>Affects Versions: 2.8.0
>Reporter: Wenzhi Ji
>Priority: Major
>  Labels: ready-to-commit
> Fix For: 2.8.0
>
> Attachments: BasicDataSource.java, BasicDataSourceMXBean.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 当前该开源软件具备的功能:若数据库连接被关闭(即closed置为true),则必须重启服务,才能使新的数据库连接生效(closed置为false)。
> 针对容灾场景,若数据库连接串发生变化,为了使新的数据库连接动态生效(热生效),不需要手工重启服务,建议该开源软件BasicDataSource类提供一个open()方法用于置closed
>  = false;以使建立的数据库连接生效。
> 变更的代码见附件。
> 注:附件是基于2.7.0版本代码进行优化的。



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


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

2019-12-11 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/DBCP-559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16993586#comment-16993586
 ] 

Gary D. Gregory commented on DBCP-559:
--

[~Jason_HW]

May you provide your proposal as a PR on GitHub please?

This will allow us to see changes clearly as well as run a build. Don't forget 
to add some kind of test.

Thank you.

> 数据库连接可以通过BasicDataSource类的close()方法进行关闭,但该类没有提供open()方法使得新建的数据库连接生效
> ---
>
> Key: DBCP-559
> URL: https://issues.apache.org/jira/browse/DBCP-559
> Project: Commons DBCP
>  Issue Type: Improvement
>Affects Versions: 2.7.1
>Reporter: Wenzhi Ji
>Priority: Major
>  Labels: ready-to-commit
> Fix For: 2.7.1
>
> Attachments: BasicDataSource.java, BasicDataSourceMXBean.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 当前该开源软件具备的功能:若数据库连接被关闭(即closed置为true),则必须重启服务,才能使新的数据库连接生效(closed置为false)。
> 针对容灾场景,若数据库连接串发生变化,为了使新的数据库连接动态生效(热生效),不需要手工重启服务,建议该开源软件BasicDataSource类提供一个open()方法用于置closed
>  = false;以使建立的数据库连接生效。
> 变更的代码见附件。
> 注:附件是基于2.7.0版本代码进行优化的。



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


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

2019-12-11 Thread Mark Thomas (Jira)


[ 
https://issues.apache.org/jira/browse/DBCP-559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16993453#comment-16993453
 ] 

Mark Thomas commented on DBCP-559:
--

Google translate version of the description:

 The current open source software has the function: If the database connection 
is closed (that is, closed is set to true), the service must be restarted for 
the new database connection to take effect (closed set to false).

For disaster recovery scenarios, if the database connection string changes, in 
order for the new database connection to take effect dynamically (hot effect), 
you do not need to manually restart the service. It is recommended that the 
open source software BasicDataSource class provide an open () method for 
setting closed = false; For the established database connection to take effect.

See the attached code for the change.

Note: The attachment is optimized based on the version 2.7.0 code.

 

 

> 数据库连接可以通过BasicDataSource类的close()方法进行关闭,但该类没有提供open()方法使得新建的数据库连接生效
> ---
>
> Key: DBCP-559
> URL: https://issues.apache.org/jira/browse/DBCP-559
> Project: Commons DBCP
>  Issue Type: Improvement
>Affects Versions: 2.7.1
>Reporter: Wenzhi Ji
>Priority: Major
>  Labels: ready-to-commit
> Fix For: 2.7.1
>
> Attachments: BasicDataSource.java, BasicDataSourceMXBean.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 当前该开源软件具备的功能:若数据库连接被关闭(即closed置为true),则必须重启服务,才能使新的数据库连接生效(closed置为false)。
> 针对容灾场景,若数据库连接串发生变化,为了使新的数据库连接动态生效(热生效),不需要手工重启服务,建议该开源软件BasicDataSource类提供一个open()方法用于置closed
>  = false;以使建立的数据库连接生效。
> 变更的代码见附件。
> 注:附件是基于2.7.0版本代码进行优化的。



--
This message was sent by Atlassian Jira
(v8.3.4#803005)