[JBoss-dev] CVS update: jbosscx/src/main/org/jboss/resource/connectionmanager ManagedConnectionPoolFactory.java
User: thedug Date: 01/11/21 10:14:51 Modified:src/main/org/jboss/resource/connectionmanager ManagedConnectionPoolFactory.java Log: destroy() should actually close the connection so that the tcp connection isn't left open. Revision ChangesPath 1.3 +16 -0 jbosscx/src/main/org/jboss/resource/connectionmanager/ManagedConnectionPoolFactory.java Index: ManagedConnectionPoolFactory.java === RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/connectionmanager/ManagedConnectionPoolFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ManagedConnectionPoolFactory.java 2001/09/11 18:38:58 1.2 +++ ManagedConnectionPoolFactory.java 2001/11/21 18:14:51 1.3 @@ -63,6 +63,22 @@ pool = null; } +/** + * Permanently closes an object, after it is removed from the pool. The + * object will not be returned to the pool - after this, it is gone. This + * is called when the pool shrinks, and when the pool is shut down. + */ +public void deleteObject(Object pooledObject) { +try{ +((ManagedConnection)pooledObject).destroy(); +}catch(ResourceException e) { +log.println(Unable to destroy ManagedConnection: +e); +} + + } + + + /** * Creates a new ManagedConnection with the specified parameters. * ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosspool/src/main/org/jboss/pool/connector ManagedConnectionPoolFactory.java
User: thedug Date: 01/11/20 15:48:44 Modified:src/main/org/jboss/pool/connector Tag: Branch_2_4 ManagedConnectionPoolFactory.java Log: factory.destroy is now implemented to destroy the managed connection. Revision ChangesPath No revision No revision 1.1.1.1.2.1 +14 -0 jbosspool/src/main/org/jboss/pool/connector/Attic/ManagedConnectionPoolFactory.java Index: ManagedConnectionPoolFactory.java === RCS file: /cvsroot/jboss/jbosspool/src/main/org/jboss/pool/connector/Attic/ManagedConnectionPoolFactory.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- ManagedConnectionPoolFactory.java 2001/05/15 07:58:24 1.1.1.1 +++ ManagedConnectionPoolFactory.java 2001/11/20 23:48:44 1.1.1.1.2.1 @@ -48,6 +48,20 @@ } /** + * Permanently closes an object, after it is removed from the pool. The + * object will not be returned to the pool - after this, it is gone. This + * is called when the pool shrinks, and when the pool is shut down. + */ +public void deleteObject(Object pooledObject) { +try{ +((ManagedConnection)pooledObject).destroy(); +}catch(Exception e) { +log.println(deleteObject(): Unable to destroy ManagedConnection: +e); +} + +} + +/** * Creates a new ManagedConnection with the specified * parameters. */ ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosspool/src/main/org/jboss/pool/jdbc ConnectionInPool.java
User: thedug Date: 01/11/09 09:51:16 Modified:src/main/org/jboss/pool/jdbc Tag: Branch_2_4 ConnectionInPool.java Log: Changed prepareStatment() to not throw away the resultSetType and resultSetConcurrenty. Now passes them through to conn.prepareStatement(sql, type, conncurrency) Moved cache logic to the prepareStatement(sql, type, conncurrency) method and called through from the prepareSatement(sql) method. Revision ChangesPath No revision No revision 1.1.1.1.2.1 +25 -18 jbosspool/src/main/org/jboss/pool/jdbc/Attic/ConnectionInPool.java Index: ConnectionInPool.java === RCS file: /cvsroot/jboss/jbosspool/src/main/org/jboss/pool/jdbc/Attic/ConnectionInPool.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- ConnectionInPool.java 2001/05/15 07:58:24 1.1.1.1 +++ ConnectionInPool.java 2001/11/09 17:51:15 1.1.1.1.2.1 @@ -240,23 +240,7 @@ } public PreparedStatement prepareStatement(String sql) throws SQLException { -if(con == null) throw new SQLException(CLOSED); -try { -PreparedStatementInPool wrapper = null; -if(preparedStatementCacheSize = 0) { -PreparedStatement ps = (PreparedStatement)preparedStatementCache.useObject(sql); -if(ps == null) -throw new SQLException(Unable to create PreparedStatement!); -wrapper = new PreparedStatementInPool(ps, this, sql); -} else { -wrapper = new PreparedStatementInPool(con.prepareStatement(sql), this, sql); -} -statements.add(wrapper); -return wrapper; -} catch(SQLException e) { -setError(e); -throw e; -} +return prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); } public CallableStatement prepareCall(String sql) throws SQLException { @@ -437,9 +421,32 @@ } } + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { -return prepareStatement(sql); +if(con == null) throw new SQLException(CLOSED); +try { +PreparedStatementInPool wrapper = null; +if(preparedStatementCacheSize = 0) { +PreparedStatement ps = (PreparedStatement)preparedStatementCache.useObject(sql); +if(ps == null) +throw new SQLException(Unable to create PreparedStatement!); +wrapper = new PreparedStatementInPool(ps, this, sql); +} else { +wrapper = new PreparedStatementInPool(con.prepareStatement(sql, resultSetType, resultSetConcurrency), this, sql); +} +statements.add(wrapper); +return wrapper; +} catch(SQLException e) { +setError(e); +throw e; +} } + +/* + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { + return prepareStatement(sql); + } +*/ public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { if(con == null) throw new SQLException(CLOSED); ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosspool/src/main/org/jboss/pool/connector/jboss MinervaSharedLocalCMFactory.java
User: thedug Date: 01/11/04 22:06:19 Modified:src/main/org/jboss/pool/connector/jboss Tag: Branch_2_4 MinervaSharedLocalCMFactory.java Log: Exposed BlockingTimeout for MinervaShareLocalCMFactory. setBlockingTimeout was already available on ObjectPool. I just add a new key data member to PoolParameters. I use them in MinervaShareLocalCMFactory when loading properties. PoolManager then passes it on when building the ObjectPool.. Revision ChangesPath No revision No revision 1.1.1.1.2.1 +4 -2 jbosspool/src/main/org/jboss/pool/connector/jboss/Attic/MinervaSharedLocalCMFactory.java Index: MinervaSharedLocalCMFactory.java === RCS file: /cvsroot/jboss/jbosspool/src/main/org/jboss/pool/connector/jboss/Attic/MinervaSharedLocalCMFactory.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- MinervaSharedLocalCMFactory.java 2001/05/15 07:58:24 1.1.1.1 +++ MinervaSharedLocalCMFactory.java 2001/11/05 06:06:19 1.1.1.1.2.1 @@ -18,7 +18,7 @@ /** * Implementation of JBoss connector initialization. * @author Aaron Mulder [EMAIL PROTECTED] - * @version $Revision: 1.1.1.1 $ + * @version $Revision: 1.1.1.1.2.1 $ */ public class MinervaSharedLocalCMFactory implements ConnectionManagerFactory { private TransactionManager tm; @@ -73,6 +73,8 @@ PoolParameters params = new PoolParameters(); String s = props.getProperty(PoolParameters.BLOCKING_KEY); if(s != null) try {params.blocking = new Boolean(s).booleanValue();} catch(Exception e) {} +s = props.getProperty(PoolParameters.BLOCKING_TIMEOUT_KEY); +if(s != null) try {params.blockingTimeoutSecs = Integer.parseInt(s);} catch(Exception e) {} s = props.getProperty(PoolParameters.GC_ENABLED_KEY); if(s != null) try {params.gcEnabled = new Boolean(s).booleanValue();} catch(Exception e) {} s = props.getProperty(PoolParameters.GC_INTERVAL_MS_KEY); @@ -114,4 +116,4 @@ return cm; } -} \ No newline at end of file +} ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosspool/src/main/org/jboss/pool/connector PoolManager.java
User: thedug Date: 01/11/04 22:06:19 Modified:src/main/org/jboss/pool/connector Tag: Branch_2_4 PoolManager.java Log: Exposed BlockingTimeout for MinervaShareLocalCMFactory. setBlockingTimeout was already available on ObjectPool. I just add a new key data member to PoolParameters. I use them in MinervaShareLocalCMFactory when loading properties. PoolManager then passes it on when building the ObjectPool.. Revision ChangesPath No revision No revision 1.1.1.1.2.1 +2 -1 jbosspool/src/main/org/jboss/pool/connector/Attic/PoolManager.java Index: PoolManager.java === RCS file: /cvsroot/jboss/jbosspool/src/main/org/jboss/pool/connector/Attic/PoolManager.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- PoolManager.java 2001/05/15 07:58:24 1.1.1.1 +++ PoolManager.java 2001/11/05 06:06:19 1.1.1.1.2.1 @@ -52,6 +52,7 @@ private static ObjectPool createPool(PoolObjectFactory factory, PoolParameters params, String name) { ObjectPool pool = new ObjectPool(factory, name); pool.setBlocking(params.blocking); +pool.setBlockingTimeout(params.blockingTimeoutSecs); pool.setGCEnabled(params.gcEnabled); pool.setGCInterval(params.gcIntervalMillis); pool.setGCMinIdleTime(params.gcMinIdleMillis); @@ -147,4 +148,4 @@ params = null; } } -} \ No newline at end of file +} ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosspool/src/main/org/jboss/pool PoolParameters.java
User: thedug Date: 01/11/04 22:06:19 Modified:src/main/org/jboss/pool Tag: Branch_2_4 PoolParameters.java Log: Exposed BlockingTimeout for MinervaShareLocalCMFactory. setBlockingTimeout was already available on ObjectPool. I just add a new key data member to PoolParameters. I use them in MinervaShareLocalCMFactory when loading properties. PoolManager then passes it on when building the ObjectPool.. Revision ChangesPath No revision No revision 1.1.1.1.2.1 +3 -0 jbosspool/src/main/org/jboss/pool/PoolParameters.java Index: PoolParameters.java === RCS file: /cvsroot/jboss/jbosspool/src/main/org/jboss/pool/PoolParameters.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- PoolParameters.java 2001/05/15 07:58:24 1.1.1.1 +++ PoolParameters.java 2001/11/05 06:06:19 1.1.1.1.2.1 @@ -17,6 +17,7 @@ public final static String MIN_SIZE_KEY = MinSize; public final static String MAX_SIZE_KEY = MaxSize; public final static String BLOCKING_KEY = Blocking; +public final static String BLOCKING_TIMEOUT_KEY = BlockingTimeout; public final static String GC_ENABLED_KEY = GCEnabled; public final static String IDLE_TIMEOUT_ENABLED_KEY = IdleTimeoutEnabled; public final static String INVALIDATE_ON_ERROR_KEY = InvalidateOnError; @@ -28,9 +29,11 @@ public final static String LOGGER_KEY = Logger; public final static String LOGGER_ENABLED = LoggingEnabled; + public int minSize = 0; public int maxSize = 0; public boolean blocking= true; +public int blockingTimeoutSecs = -1;//Forever... public boolean gcEnabled = false; public boolean idleTimeoutEnabled = false; public boolean invalidateOnError = false; ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development