[jira] [Commented] (DBCP-309) First example for FSContext is invalid

2011-05-01 Thread Phil Steitz (JIRA)

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

Phil Steitz commented on DBCP-309:
--

Unfortunately, I think the right fix here is to drop the BasicDataSource 
example and resolve this issue, but open another one to make BasicDataSource 
implement Referenceable in 2.0.

> 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.3.1, 1.4.1
>
>
> 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 is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (LANG-695) SystemUtils.IS_OS_UNIX doesn't recognize FreeBSD as a Unix system

2011-05-01 Thread Henri Yandell (JIRA)

[ 
https://issues.apache.org/jira/browse/LANG-695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027554#comment-13027554
 ] 

Henri Yandell commented on LANG-695:


Absolutely - any help you could offer there to identify the correct text would 
be good as it's been a long time since I installed a BSD.

It takes us more into the various OS arguments. Do we have an IS_BSD and make 
all three fit that (as with our IS_LINUX). Do we then treat OS X as a BSD as 
well. Given we have OS X, do we add the various BSDs. To start with it's 
probably best to identify the os.name property for each of the three BSDs.

> SystemUtils.IS_OS_UNIX doesn't recognize FreeBSD as a Unix system
> -
>
> Key: LANG-695
> URL: https://issues.apache.org/jira/browse/LANG-695
> Project: Commons Lang
>  Issue Type: Improvement
>  Components: lang.*
>Affects Versions: 2.6
> Environment: FreeBSD 7-STABLE
>Reporter: Oliver
>Priority: Minor
> Fix For: 3.x
>
>
> FreeBSD isn't recognized as Unix system in SystemUtils.IS_OS_UNIX; There 
> should be something like SystemUtils.IS_OS_FREEBSD, also.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Resolved] (DBCP-334) BasicDataSource does not consider the method "setSoftMinEvictableIdleTimeMillis" of CommonsPool.GenericObjectPool

2011-05-01 Thread Phil Steitz (JIRA)

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

Phil Steitz resolved DBCP-334.
--

Resolution: Fixed

Fixed in trunk (r1098458) and 1.4 branch (r1098459).

Thanks for the patch!

> BasicDataSource does not consider the method 
> "setSoftMinEvictableIdleTimeMillis" of CommonsPool.GenericObjectPool
> -
>
> Key: DBCP-334
> URL: https://issues.apache.org/jira/browse/DBCP-334
> Project: Commons Dbcp
>  Issue Type: Bug
>Affects Versions: 1.2.1, 1.2.2, 1.3, 1.4
>Reporter: Alberto Mozzone
>Priority: Critical
> Fix For: 1.3.1, 1.4.1
>
>
> The BasicDataSource should have the "softMinEvictableIdleTimeMillis" (get and 
> set) as the GenericObjectPool, to avoid destroying idle connections below the 
> "minIdle" value. In this case, connections are dropped and immediately 
> recreated with no reason. The "minEvictableIdleTimeMillis" should not be 
> considered because there are ways to validate idle connections before they 
> are used.
> The class should have these lines of code, besides those existing:
> // property
>   private long softMinEvictableIdleTimeMillis = 
> GenericObjectPool.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
> // getter
>   /**
>* Returns the {@link #softMinEvictableIdleTimeMillis} property.
>* @return the value of the {@link #softMinEvictableIdleTimeMillis} 
> property
>* @see #softMinEvictableIdleTimeMillis
>*/
>   public synchronized long getSoftMinEvictableIdleTimeMillis() {
>   return softMinEvictableIdleTimeMillis;
>   }
> // setter
>   /**
>* Sets the {@link #softMinEvictableIdleTimeMillis} property.
>* @param softMinEvictableIdleTimeMillis the minimum amount of time an 
> object
>* may sit idle in the pool 
>* @see #softMinEvictableIdleTimeMillis
>*/
>   public synchronized void setSoftMinEvictableIdleTimeMillis(final long 
> softMinEvictableIdleTimeMillis) {
>   this.softMinEvictableIdleTimeMillis = 
> softMinEvictableIdleTimeMillis;
>   if (connectionPool != null) {
>   
> connectionPool.setSoftMinEvictableIdleTimeMillis(softMinEvictableIdleTimeMillis);
>   }
>   }
> // creator of the pool
>   @Override protected void createConnectionPool() {
>   super.createConnectionPool();
>   
> connectionPool.setSoftMinEvictableIdleTimeMillis(softMinEvictableIdleTimeMillis);
>   }
> I implemented myself a "NotSoBasicDataSource" class, inheriting from 
> "BasicDataSource" and used it in a single test. It worked: idle connections 
> do not decrease under (and re-grow to) "minIdle".
> Please, consider this feature, because it can save resources.
> I don't know what is the behavior of the Tomcat DBCP, but it seems to me it 
> has the same problem.
> I'm waiting your opinions.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira