[JBoss jBPM] - Connections never close. Two many connections exception
by ffernandez
I have a problem because the connections to database (mysql) are never closed, so the configurated limit is reached.
When a processInstances is created, it's also created the connection to database, but this connection is never closed. The processInstance is ENDED, but the connection to database is still open (sleep in mysql). So, when I have 100 processInstances created, my database limit is reached.
This is the code for processInstance :
| JbpmContext jbpmContext = this.configuration.createJbpmContext();
| try {
| processInstance = jbpmContext.newProcessInstanceForUpdate( "xx" );
| processInstance.signal();
| } finally {
| jbpmContext.close();
| }
|
In the jbpmContext.close(); the connection it's not closed, so remains always open.
Here my Hibernate configuration:
| <!-- JDBC connection properties (begin) -->
| <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
| <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/xxx</property>
| <property name="hibernate.connection.username">foo</property>
| <property name="hibernate.connection.password">bar</property>
| <property name="hibernate.connection.isolation">2</property>
|
| <!--
| <property name="hibernate.c3p0.acquire_increment">1</property>
| <property name="hibernate.c3p0.idle_test_period">0</property>
| <property name="hibernate.c3p0.max_size">10</property>
| <property name="hibernate.c3p0.max_statements">0</property>
| <property name="hibernate.c3p0.min_size">5</property>
| <property name="hibernate.c3p0.timeout">60</property>
| -->
|
I also have tested the c3p0 but it's the same, the connections are never reused and so the pool limit is reached.
In the DbPersistenceService.closeConnection method I see that the only way to close connection is when mustConnectionBeClosed = true. And mustConnectionBeClosed is true only when DataSource is defined if (persistenceServiceFactory.getDataSource()!=null) { mustConnectionBeClosed = true } .
Any suggestion? Thanks in advanced
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137517#4137517
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137517
18 years, 1 month
[Installation, Configuration & DEPLOYMENT] - Apache-ModJK-JBoss Firewall rule sets
by Ponvinayagan
Hi,
We have our JBoss server behind firewall and from Apache server through the ModJK configuration and Port no 8009 accessing the web application deployed in JBoss.
I am trying to list the Port numbers need to be opened from Firewall for Apache to JBoss communication and I know well that we need to add the port 8009 on the list.
Are there any other ports need to be opened in Firewall for this communication and for reverse (Jboss to Apache) as well ?
When I used the TCPView to check the port number being connected from Apache machine to Jboss machine and vice. versa. I observed that httpd.exe estiblishes 2/3 TCP connections on radom port numbers and on the JBos side for the same 2/3 TCP connections on the same (radom) port are established.
example
On Apache machine TCP View
===================
httpd.exe:1172 TCP ApacheMachine:2709 JBossMachine:8009 ESTABLISHED
httpd.exe:1172 TCP ApacheMachine:2711 JBossMachine:8009 ESTABLISHED
httpd.exe:1172 TCP ApacheMachine:2713 JBossMachine:8009 ESTABLISHED
On JBoss Machine TCP View
==================
JBoss_4_3.exe:2208 TCP JBossMachine:8009 ApacheMachine:2709 ESTABLISHED
JBoss_4_3.exe:2208 TCP JBossMachine:8009 ApacheMachine:2711 ESTABLISHED
JBoss_4_3.exe:2208 TCP JBossMachine:8009 ApacheMachine:2713 ESTABLISHED
Could some one please explain me what are these port numbers?
Are there any list of these port number or any range?
Do I need to open these Port numbers in the Firewall?
Please advice and help me.
Regards
Vinay
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137508#4137508
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137508
18 years, 1 month
[Installation, Configuration & DEPLOYMENT] - Re: query regarding the thread pool size in JBoss
by puneetjain
Hi Peter,
Thanks for the reply.
I have set the max threads to 500. But dint do anything to minSpareThreads and maxSpare threads.
And in the JMX console I could see the value that I have set. But its not there in the server logs..????
Another problem is this...
I have tested the performance MULE over JBoss using JMeter. I have taken the number of users as 1, 2, 10, 25, 50, 100 with loop count 2.
And I have captured the results, once with 10 as thread pool size and another time with 500 pool size.
Expected was that with 500 pool size, the response time should improve. But the results were very inconsistent.
Following are the results:
#users 1 10 25 50 100
#Loops 2
ThreadPoolSize 500
ResponseTime(sec) 0.14 0.38 0.92 2.014 4.565
And another one:
#users 1 10 25 50 100
#Loops 2
ThreadPoolSize 10
ResponseTime(sec) 0.109 0.411 0.957 1.989 4.855
What is the expected behavior on increasing the thread pool size.?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137503#4137503
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137503
18 years, 1 month