Questions tagged [apache-commons-pool]

Apache Commons Pool is a general purpose, object pooling framework for the Java programming language.

Apache Commons Pool is a component of the Apache Commons project. Apache Commons Pool is general purpose, object pooling framework, is open source software distributed under the Apache License, Version 2.0, and is the underlying object pooling framework for Apache Commons DBCP.

52 questions
1
vote
1 answer

Does multiple GenericKeyedObjectPools use the same eviction thread?

If I'm using more than one GenericKeyedObjectPool in an application with enabled asynchronous idle object eviction how many "idle object eviction" thread will run in the background? Do multiple GenericKeyedObjectPools create only one eviction…
palacsint
  • 28,416
  • 10
  • 82
  • 109
1
vote
2 answers

Commons Pooling: How to instantiate a concrete pool?

I've added commons-pooling-1.6.jar to my classpath and trying to instantiate a StackObjectPool and am failing at every turn: // Deprecated. ObjectPool oPool = new StackObjectPool(); // Error: Cannot instantiate the type…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
0
votes
1 answer

Is my jsch connection pool being used thread safely in Spring controller?

I'm trying to implement a connection pool using https://commons.apache.org/proper/commons-pool/ with JSch and use it in a Spring rest controller. I coded based on this stackoverflow answer: https://stackoverflow.com/a/53101465/5617549 I'm trying to…
MugenTwo
  • 314
  • 6
  • 14
0
votes
1 answer

Determining to use JedisPool with boolean variable

I'm working on a custom Boomi connector that uses Jedis in order to send data to a redis server. One thing I am trying to work on, is removing the parameter String parameters and still determining if I should use a pool, but I am unsure how I would…
Jacob
  • 371
  • 2
  • 18
0
votes
0 answers

How to set AbandonedConfig in JedisPool - JedisExhaustedPoolException error

I am facing an issue similar to the one jedis-1929. We are using JedisPool with maxTotal=400 and have ensured that after using jedis from pool.getResource() we are returning the connection back to the pool in finally block using jedis.close()…
Pankaj Yadav
  • 139
  • 1
  • 10
0
votes
1 answer

Apache Common Pools migration from version 1 to version 2 and the exhausted actions

In Apache Commons Pool 1, the class GenericObjectPool had the possibility to define three actions to react to an exhausted pool: Fail Block Grow Now, in version 2 I do not see these three options and the class GenericObjectPool seems to have only…
JeanValjean
  • 17,172
  • 23
  • 113
  • 157
0
votes
1 answer

Btrace: Filter class with same name by Application

I'm trying to instrument my app to monitor a connection pool. We use apache commons pool 1.6 for connection pooling, with all the applications deployed on the same AS (we use Jboss EAP 6). Trace script works, but it triggers when pool methods are…
0
votes
0 answers

Where should I initialize my Apache commons pool2 so that it's accessible from other classes

I am developing a REST service based on jax-rs. I need connection pooling for my application so I will be using commons pool2. I plan on initializing my pool in a class the implements ServletContextListener so that when the application starts, the…
0
votes
1 answer

Apache Pool 2 library - connections not closed automatically

I have the following code in Scala that uses the Apache pool2 library. The object to pool is OlapConnection (an olap4j class, similar to an SQL connection). Problem is that I can't make the pool close the connections automatically when the number…
ps0604
  • 1,227
  • 23
  • 133
  • 330
0
votes
2 answers

Apache Pool 2 - predefined object instances with fixed capacity

I would like to use Apache Pool 2 library, but looking for following functionality: The objects are not dummy new empty instances, but pre-loaded objects from external data source. You can imagine each object is unique working configuration which…
kensai
  • 943
  • 9
  • 16
0
votes
1 answer

Keyed object pool not keeping minimum number of idle objects in pool at all times

An application I'm working on, uses the Apache Commons library to implement the KeyedObjectPools. We have an Object factory, wherein we have implemented the methods specified in the KeyedPoolObjectFactory interface. The implementation looks like…
0
votes
0 answers

Spring using @Scheduled annotation on a prototype bean along with object pooling

I currently have a spring bean which has a method annotated with @Scheduled to support automatic refresh of its state from external source. I have also annotated the bean with scope as prototype. Now, I am trying to have a pool of these beans and…
user320587
  • 1,347
  • 7
  • 29
  • 57
0
votes
1 answer

How to validate IBM MQ connection for Pool

I am developing IBM MQ Connection pool using Apache commons pool (2.4.2 ). IBM MQ JAR version 8. As part of Pool concept , I need to validate the connection before return to program. Help me on how to validate IBM MQ connection ? Java 8 IBM MQ…
Gnana
  • 2,130
  • 5
  • 26
  • 57
0
votes
1 answer

Apache Commons Pool 1 -> 2: Recalling Hung or Inactive Connection Objects to the Pool

Currently I am using Apache Commons Pool 1.6 to manage a GenericKeyedObjectPool pool of connections. I have seen threads both throwing exceptions and hanging indefinitely both of which lead to the borrowed connections being leaked from the pool. I…
0
votes
2 answers

How to close the SSH Maverick Connection Object which uses Apache Commons Pool

I am using SSH Maverich Library for making SFTP Call and i encapsulated maverick objects and pooled connections objects using apache commons pool. I implemented commons pool Factory method to create object. How do I close the transport layer…
devv
  • 311
  • 5
  • 17