53 questions
0
votes
1
answer
80
views
Spring boot Framework LDAPTemplate PoolingContextSource not working during ldle scenario
Problem Description:
LDAP server suspended new connections due to Spring LDAP Template pool created so many connections in a short period of time. After a while, LDAP server resumed serving requests ...
0
votes
1
answer
802
views
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://...
1
vote
0
answers
1k
views
How to use borrowObject of GenericObjectPool class such that threads don't get stuck?
I am using the apache commons pool2 version 2.8.1. While borrowing object from pool, threads are getting stuck.
I initialised the pool size as 1. And had 3 threads created.
First thread enters ...
0
votes
1
answer
441
views
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 ...
1
vote
1
answer
2k
views
MinEvictableIdleTimeMillis setting not working as expected
I have this pool of objects (using org.apache.commons.pool2), from which I borrow (or create) one.
The maximum idle size I have set is 3 ( with a max size of 5). This was set with the understanding ...
1
vote
1
answer
2k
views
Configure Apache Commons Pool to create objects on start up
I'm configuring a pool of objects using apache commons pool2. It seems the objects in the pool are only created when an attempt is made to borrow an object. I'd like the objects to be created up front,...
0
votes
0
answers
1k
views
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 ...
1
vote
1
answer
3k
views
GenericObjectPool Returned object not currently part of this pool
I have created a pool of objects that I need to reuse. Every time I try to return the object I get an error of: "Returned object not currently part of this pool"
I have override the both the equals ...
0
votes
1
answer
769
views
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 ...
1
vote
1
answer
1k
views
Websphere MQ connection pooling
Is there any connection pool library for Websphere MQ in Java? I tried to implement connection pool for WebSphere MQ using Apache Commons Pool, but it didn't work.
0
votes
1
answer
72
views
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 ...
0
votes
0
answers
423
views
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 ...
1
vote
1
answer
2k
views
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 ...
0
votes
2
answers
1k
views
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 ...
0
votes
1
answer
2k
views
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 ...
0
votes
0
answers
2k
views
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, ...
1
vote
1
answer
663
views
How to figure out the number of idle objects and borrowed objects in Apache Common Pool 2
There are several getXXXCount method defined in the BaseGenericObjectPool class
BaseGenericObjectPool.getBorrowedCount
BaseGenericObjectPool.getCreatedCount
BaseGenericObjectPool.getDestroyedCount
...
2
votes
1
answer
2k
views
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 ...
0
votes
1
answer
510
views
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 ...
1
vote
1
answer
2k
views
Redis client : create new connections when pool size gets exhausted
We are using redis for caching purpose in our application.
Our goal is to create new Redis connections as the pool size exhaust or crosses a certain threshold so that we can keep the number of idle ...
0
votes
1
answer
1k
views
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 ...
1
vote
1
answer
972
views
What does CommonsPool2TargetSource do if you disable blockWhenExhausted?
The deprecated CommonPoolTargetSource had a set of behaviors you could define using setWhenExhaustedActionName(). The CommonsPool2TargetSource and the CommonsPool2 BaseGenericObjectPool it wraps ...
1
vote
1
answer
762
views
Is it a bad practise to pass jedis instance between methods?
I was referring to this SO question, and I did couple of additions in this benchmark test. The main problem is my apis are getting slow as load increases on server. I am using jedis pool configuration....
2
votes
1
answer
802
views
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 ...
5
votes
1
answer
2k
views
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 ...
3
votes
1
answer
642
views
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 ...
0
votes
2
answers
419
views
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 ...
5
votes
1
answer
1k
views
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 ...
2
votes
2
answers
4k
views
Spring data Redis. How to know number of Active, Idle Connection?
In Spring, I have a jedisConnFactory and a jedisPoolConfig bean like this
<bean id="jedisConnFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:host-name=...
2
votes
1
answer
1k
views
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 ...
1
vote
1
answer
1k
views
How to inject Spring beans into class generated by reflection in Apache Commons Pooling class flow
I'm using Spring MVC 3.2.4 and Apache Commons Pooling 2.3 for managing connections to a SOAP service. One of the things I am using is the "idle object eviction" thread feature in the ...
0
votes
1
answer
1k
views
Creating a Pool of Objects with Java
Awhile ago I created a program that created socket connections and funneled their input to a single telnet connection to our legacy server. The goal of the project is to create a front end for the ...
0
votes
1
answer
2k
views
JMS Connection Pooling in Message Listener
Currently i'm working on a standalone Java apps that connects to a Websphere MQ to send and receive messages.
The flow is in asynchronous mode, which we implemented using MessageListener class to ...
1
vote
1
answer
5k
views
Error trying to wire a Lettuce Connection Factory
I'm trying to setup a connection factory for my redis client (lettuce client version: 2.3.3) using Spring Data Redis (version.: 1.1.x) but I'm having some troubles while wiring everything together.
...
5
votes
1
answer
14k
views
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<P>{
/...
0
votes
1
answer
6k
views
Maximum number of threads (200) created for connector with address null and port 8080
I am getting this error on prod in approximately every 7-8 days. So to debug this issue I downloaded the thread dump file. This file has following thread state 100 times:
"http-8080-198" daemon prio=...
0
votes
1
answer
240
views
Object pool with the ability save objects on exit and reload on start?
Apache Commons seems to be the decent Object Pool implementation out there. Or any other framework that could support the cause
How Can I save its state of the pool during shutdown; may be serialize ...
3
votes
1
answer
10k
views
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....
2
votes
0
answers
1k
views
Error while using ActiveMQ PooledConnectionFactory
I am using ActiveMQ PooledConnectionFactory
PooledConnectionFactory connectionFactory = new PooledConnectionFactory(Constants.AAMQ_MESSAGE_BROKER_URI);
Connection tempConnection = connectionFactory....
0
votes
2
answers
5k
views
Apache Pool can't return object in spring controller/service
I am trying to use apache pool2 to pool some resources. I have it working fine in a unit test, but when I try using it in spring 3, I get an error.
Everything else is working with the Controller and ...
1
vote
1
answer
673
views
commons pool jar 2.2 : is there any replacement of GenericObjectPool.Config class?
I just studying redis. In my text-book, they use GenericObjectPool.Config class which supported in apache commons pool jar version 1.6.
However, for now that class has disappeared. So I want to know ...
0
votes
1
answer
362
views
Add objects to object pool
I am trying to add objects to object pool. I am using apache commons pool for this.
My code as is as follows:
public ObjectPool<OAuthConsumer> consumerPool;
public ObjectPool<OAuthConsumer&...
6
votes
1
answer
4k
views
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 ...
0
votes
2
answers
2k
views
why Threads get blocked when i use Apache-Commons-Pool?
Here is my demo:
PoolableObjectFactoryImpl.java
public class PoolableObjectFactoryImpl implements PoolableObjectFactory<Result> {
private static Logger logger = Logger.getLogger("...
1
vote
1
answer
548
views
Why does the following simple piece of Java code using pooled connections from commons.dbcp block?
I have written a simple Java code, which attempts to store files in an hsqldb database. All it does is reads the files from a certain directory and puts them in the DB. It is single threaded, but I am ...
1
vote
1
answer
2k
views
apache commons pool - how to use a factory that takes arguments
I am trying to use apache commons pool to create a pool of 'objects'. Since I already have an object factory which takes a string type argument and create a right type of object I want to use this ...
1
vote
2
answers
2k
views
How to shutdown a GenericKeyedObjectPool safely?
I have a GenericKeyedObjectPool in my application.
I can close it with the close method but how should I wait for the clients to return (and the pool destroys) every borrowed object to the pool?
I ...
1
vote
1
answer
492
views
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 ...
5
votes
1
answer
3k
views
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 ...
1
vote
2
answers
6k
views
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<T> oPool = new StackObjectPool<T>();
...