0

In my project setup - Jboss v4.3, each datasource is configured in a different xyz-ds.xml file. We need to place around 6 thousand such DS files. But with this number of DS files, JBoss fails to start with below exception. Is there any configuration or default value that defines the maximum number of datasources allowed ? How can we change it to accommodate around 6 to 8 thousands of datasources? Sample DS file : xyz-ds.xml

<no-tx-datasource> 
   <jndi-name>ABC</jndi-name> 
   <connection-url>jdbc:sqlserver://DBconnectionDetails;</connection-url> 
   <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> 
   <user-name>username</user-name> 
   <password>password</password> 
   <min-pool-size>1</min-pool-size> 
   <max-pool-size>4</max-pool-size> 
   <idle-timeout-minutes>20</idle-timeout-minutes> 

Exception on start-up with 5000 DS files:

2017-08-07 03:39:51,189 INFO [org.springframework.web.context.ContextLoader] Root WebApplicationContext: initialization completed in 100704 ms 2017-08-07 03:40:15,829 ERROR [org.jboss.resource.adapter.jms.JmsSessionFactoryImpl] could not create session javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:306) at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500) at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:348) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:331) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:403) at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:850) at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.allocateConnection(JmsSessionFactoryImpl.java:395) at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createSession(JmsSessionFactoryImpl.java:374) at org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:196) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.access$200(AbstractPollingMessageListenerContainer.java:78) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer$MessageListenerContainerResourceFactory.createSession(AbstractPollingMessageListenerContainer.java:506) at org.springframework.jms.connection.ConnectionFactoryUtils.doGetTransactionalSession(ConnectionFactoryUtils.java:301) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:286) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:241) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:881) at org.springframework.jca.work.DelegatingWork.run(DelegatingWork.java:57) at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:213) at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756) at java.lang.Thread.run(Thread.java:745)

nshweta
  • 499
  • 2
  • 7
  • 19
  • 6000 datasources? – Kayaman Aug 07 '17 at 11:40
  • @Kayaman i believe, he mistook datasources for connections )) – Mike Adamenko Aug 07 '17 at 11:47
  • The sample datasource code (xyz-ds.xml) that I have shared, we need to place 6000 such datasources. – nshweta Aug 07 '17 at 11:49
  • @nshweta something wrong with your app architecture. Why do you need so many datasources? Are you connecting to 6000 databases ? – Mike Adamenko Aug 07 '17 at 11:52
  • If you want to increase the timeout, add `180000` to your config (to give 3 minutes instead of 30 seconds to get a connection). However for 6000 datasources it's unlikely that a simple increase in timeout can save you. – Kayaman Aug 07 '17 at 11:53
  • My application may connect to 6000 different databases. Currently its working fine with 4000 different databases. I will try with increasing the blocking timeout. – nshweta Aug 07 '17 at 12:10
  • Oh dear. I would have gone for a bit smarter solution than 6000 files. – Kayaman Aug 07 '17 at 12:14
  • Currently the issue is solved by increasing the heap size, but yet to find a correct solution for this. – nshweta Aug 07 '17 at 12:25
  • You should consider creating the connections dynamically when needed. Although 6000 different databases sounds like there are architectural issues with your software. – Kayaman Aug 07 '17 at 12:30

0 Answers0