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
8
votes
2 answers

What is Apache Commons Pool close() behaviour

I've been looking to implement pooling in part of my application. I want to use the Commons Pool library but am slightly concerned about how the close() behaviour works. From looking at the javadocs and source code, it doesn't seem clear whether…
DrewEaster
  • 3,316
  • 3
  • 35
  • 39
6
votes
1 answer

Putting Jsch into connection pool in details

I put Jsch into commons-pool (with spring pool support) with initial success http://docs.spring.io/spring/docs/3.2.4.RELEASE/spring-framework-reference/htmlsingle/#aop-ts-pool However: Should we pool the channels within the Session instead of…
simonso
  • 595
  • 1
  • 8
  • 19
5
votes
1 answer

Thread in 'parking to wait' state on Redis dequeue

I have a tomcat - spring4.2 application that runs multiple threads. Each thread dequeues from only one queue, however there are more than one threads assigned to a queue. Things start fine, but after few hours / ~500k dequeue operations, I find…
5
votes
1 answer

Efficient Way to Prepare an Apache Commons Pool of Nashorn Engines

I am using Apache Commons Pool to create a pool of Nashorn engines. On application start I call preparePool() to warm up the minIdle number of instances to eval() all scripts into the engine so that it is ready to answer calls to invokeFunction()…
sthzg
  • 5,514
  • 2
  • 29
  • 50
5
votes
1 answer

How to return objects to the Pool by timeout using apache commons pool

I'm using Apache Commons Pool library to maintaing a pool of couchbase connections (can be seen as any kind of connection, doesn't really matter). The problem I'm facing is that the only way I've found to return objects to the pool is to do it…
4
votes
2 answers

Is there any generics version of apache common object pool?

When using apache common pool, it can provide me a good implementation of Java object pooling. However their KeyedPoolableObjectFactory interface is not type safe. Is there any object pool library in Java that can provide a generics interface for us…
raymond.mh.ng
  • 343
  • 2
  • 3
  • 21
4
votes
1 answer

Add object in pool with Apache Commons Pool 2

I want to create a pool of Object P with Apache Commons Pool 2. I create a P object with variable and method. I create a PPool like this: public class PPool extends GenericObjectPool

{ /** * Constructor. * * It uses the…

DevOps85
  • 6,473
  • 6
  • 23
  • 42
3
votes
2 answers

Is Jakarta's Commons-Pool object-safe?

I'm using Jakarta commons-pool-1.5.6.jar. I have 2 different pool of the same type of object (ex : Car). Is the a way to prevent returning object to the pool? Here's a sample: //CarPool extends BaseObjectPool CarPool carPoolA = new CarPool();…
3
votes
1 answer

Handle starvation in apache commons-pool

I am using 1.6 version of apache commons-pool library. As per the javadoc, whenExhaustedAction specifies the behavior of the borrowObject() method when the pool is exhausted: It can be either WHEN_EXHAUSTED_FAIL, WHEN_EXHAUSTED_GROW, or …
Albie Morken
  • 215
  • 1
  • 4
  • 14
3
votes
1 answer

cannot access org.apache.commons.pool2.impl.GenericObjectPoolConfig class file for org.apache.commons.pool2.impl.GenericObjectPoolConfig not found

I'm writing a daemon for getting servers stats for some game. In compilation I've get a message: cannot access org.apache.commons.pool2.impl.GenericObjectPoolConfig class file for org.apache.commons.pool2.impl.GenericObjectPoolConfig not found At…
IlyaVorozhbit
  • 78
  • 1
  • 10
2
votes
1 answer

What's interval to validate the idle object in Apache Commons Pool 2

I am using Apache Commons Pool 2, I have set the configuration testWhileIdle to true, which means that the Pool framework will check whether the idle objects they are valid. I would ask whether this check occurs periodically, if so, what's the…
Tom
  • 5,848
  • 12
  • 44
  • 104
2
votes
1 answer

If commons-pool2 can new object with parameter?

The create method of PooledObjectFactory has no parameter https://commons.apache.org/proper/commons-pool/api-2.4.2/org/apache/commons/pool2/BasePooledObjectFactory.html#create-- If my Foo class definition is: public class Foo { private String…
liuhua
  • 63
  • 4
2
votes
2 answers

Spring data Redis. How to know number of Active, Idle Connection?

In Spring, I have a jedisConnFactory and a jedisPoolConfig bean like this
Rocherlee
  • 2,536
  • 1
  • 20
  • 27
2
votes
1 answer

Effectively Pooling Instances of ByteBuffer

I am writing a messaging facade that takes in arbitrary POJOs and sends them across the wire in JSON format, with the following workflow: User invokes MessagingFacade.sendMessage(Object) Borrow a ByteBuffer from a pool, we will serailize the…
jwa
  • 3,239
  • 2
  • 23
  • 54
2
votes
0 answers

Error while using ActiveMQ PooledConnectionFactory

I am using ActiveMQ PooledConnectionFactory PooledConnectionFactory connectionFactory = new PooledConnectionFactory(Constants.AAMQ_MESSAGE_BROKER_URI); Connection tempConnection = connectionFactory.createConnection(queueUName, queuePwd); its…
Rajneesh
  • 2,185
  • 4
  • 20
  • 30
1
2 3 4