[ 
https://issues.apache.org/jira/browse/DBCP-309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Thomas resolved DBCP-309.
------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.4.1)
                       (was: 1.3.1)
                   2.0
                   1.5.1

I've fixed trunk for the 2.x series the 1.5.x branch. It will be included in 
the next release of each.

If there are further 1.3.x and 1.4.x releases (currently being discussed on the 
dev mailing list) my expectation is that they will be generated from the 1.5.x 
branch so will pick up this fix too.

> First example for FSContext is invalid
> --------------------------------------
>
>                 Key: DBCP-309
>                 URL: https://issues.apache.org/jira/browse/DBCP-309
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Ondrej Tisler
>            Priority: Trivial
>             Fix For: 1.5.1, 2.0
>
>
> First example on page http://commons.apache.org/dbcp/guide/jndi-howto.html is 
> invalid, with this code every call of  
>   InitialContext ic2 = new InitialContext();
>   DataSource ds = (DataSource) ic2.lookup("jdbc/basic");
>   Connection conn = ds.getConnection();
>   conn.close();
> ends with new datasource with unclosed connection in it becase new 
> Reference("javax.sql.DataSource",  
> "org.apache.commons.dbcp.BasicDataSourceFactory", null); reference creates 
> new DataSource instead using created one while calling  
> ic2.lookup("jdbc/basic").
> At the end it ends with many opened connections to DB until JVM is ended.
> Second example I didn't test, i use direct aproach with manualy creating 
> SharedPoolDataSource and registring it in FSContext JNDI itself.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to