Search code examples
javajdbcspring-batchjndiconnection-pooling

Need info on Spring Batch and common connection pool


We have a requirement with one of the source applications which allows very few connections per user to its database.

Since we have multiple spring batch interfaces connected to same source Db, we run out of connections, Spring batches run as individual java programs and we do not have a container.

Please suggest a way to have a datasource with multiple users or a data source confirguration that can help us maintain a common pool with multiple users connected to that database.

One ugly workaround, I think of is to have a common service to fetch connections from a databases and in that service we can use some container to maintain a pool for multiple users, by having a list/array of datasource connections per user.


Solution

  • To solve this we had to add a container. Tomcat to be precise. It managed all connections. All applications were deployed on tomcat and tomcat manager was used to start stop the applications, when needed.