2

As we know in jboss 6 if the code not handled with closing DB connection then the application server will close it and throws a warning message which will occur immediately after the transaction session closed, but this option is not available by default in Wildfly server which we come know after a code with connection left open.By search for solution in this context came to know about flush-strategy needs to be configured to take care of the idle connection, but its strikes the mind,

  1. why this option is removed is not available by default in wildfly server ?
  2. is this part of improvising the performance of server activity for scanning idle connection?

But because of the default auto release option missing, application code which was not touched for a long time need to be revisited again to manage the connection manually, so it will put a lot of work in front.

To overcome that, if i provide the flush strategy as "IdleConnections" and idle-timeout-minutes as 0 then will it be the equivalent to immediate connection release configuration and at the same time is this advisable to take this configuration setup to production.

Update:

we tried with below configuration, but the connection left open are not auto closed after the idle time out period 1 minute, so the below configuration also an inappropriate approach for handling idle connection then what would be the exact configuration to accomplish it ?

 <pool>
     <min-pool-size>10</min-pool-size>
     <max-pool-size>20</max-pool-size>
     <flush-strategy>IdleConnections</flush-strategy>    
 </pool>
 <timeout>
     <idle-timeout-minutes>1</idle-timeout-minutes>
 </timeout>

Update 2: Have tried in wildfly version 8.2.1 final too with above configuration but still no luck

Jeevanantham
  • 984
  • 3
  • 19
  • 48
  • If your pool has min & max equal to 20, you are saying to keep all 20 connections open. Suppose your min=10 and max=20 and there are exist 15 connections, then after idling the environment would close 5 connections. I'm purely applying logic here, I've never used that flush-strategy. GL. – TT. Jan 07 '16 at 08:49
  • @TT. ya we had tried with min=5 and max=20 earlier on above configuration, but that too not worked – Jeevanantham Jan 07 '16 at 10:12
  • Can you see if the accepted answer in the [following StackOverflow thread](http://stackoverflow.com/questions/28645435/database-connections-not-closed-after-idle-timeout-in-wildfly-datasource) sheds some light on the issue? PS: I still think you need to have min < max in your pool for connections to be released. – TT. Jan 08 '16 at 08:07
  • Also, what is the exact version of WildFly you are using? I'm seeing fixes in 8.2.0 & 9.0 that are related to connections not getting released (the issues exist in 8.1.0 Final). – TT. Jan 08 '16 at 08:13
  • @TT we are using 8.1.0 final, let me try with wildlfy 8.2.x and let u know – Jeevanantham Jan 08 '16 at 09:06
  • @TT. Have tried in wildfly version 8.2.1 final too with above configuration but still no luck – Jeevanantham Jan 08 '16 at 11:05
  • Have you checked the SO thread from the previous comment? Possible interaction with Hibernate? – TT. Jan 08 '16 at 11:08
  • @TT. we are not using Hibernate DAO so that's not possible – Jeevanantham Jan 11 '16 at 12:51
  • Perhaps you should try out `Gracefully` as a `flush-strategy` instead of `IdleConnections`? – TT. Jan 11 '16 at 13:29
  • @TT. have tried that already, that's not resolving the problem. i have raised this question in jboss forum also but not yet received any valid answer regarding the auto close option. – Jeevanantham Jan 12 '16 at 08:44
  • I suspect that your connections are not getting flushed by the environment because your code is not properly closing the connections. I see no other explanation. If there were any issues regarding Wildfly not closing connections, it would have been reported and solved already. – TT. Jan 12 '16 at 08:48
  • @TT. ya exactly that is what my question too, jboss 6 take care of the connection not closed by code, but that option is not available in wildfy and as i posted already raised this question in jboss forum https://developer.jboss.org/thread/267197 – Jeevanantham Jan 12 '16 at 08:53
  • @TT. i would say you are wrong because in Jboss 4 and Jboss 6 auto close option is available for un-handled connection, we have used those version in our application and we are sure about that. Please donot post some false informations – Jeevanantham Jan 13 '16 at 11:31
  • We are seeing the same issue in Wildfly 10.0. Idle pool connections are *sometimes* not being released, even though the database connection has long disappeared. It appears to be random and we are monitoring this at moment. Flush Gracefully is not helping, although we have both an idle timeout and flush set - I'm not sure which one takes precedence. – Rob Mascaro Mar 10 '16 at 02:48
  • @RobMascaro , yup i haven't found any optimal solution for this yet and no answer in jboss forum too. It would be better if wildfly again provide this feature or else they have to circulate the information before deactivating this feature. – Jeevanantham Mar 10 '16 at 07:43
  • @jerith2 it gets worse. From the wildfly console flushing gracefully or idle doesn't work, only flushing all flushes all the idle connections. – Rob Mascaro Mar 10 '16 at 08:30
  • @jerith2 - I've now done some extensive testing and I believe I have a working solution. Setting flush strategy to "AllConnections" drops all the idle connections using the idle timeout and does not drop processing transactions. If it works for you, let me know and I'll write up an answer with all the details. – Rob Mascaro Mar 10 '16 at 10:31
  • @RobMascaro appreciate it, will check and let you know – Jeevanantham Mar 11 '16 at 04:59
  • @RobMascaro flush-strategy "AllConnections" not available in wildfly version 8, so couldn't experiment your case. – Jeevanantham Mar 11 '16 at 09:14

0 Answers0