[ 
http://mifosforge.jira.com/browse/MIFOS-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=64021#action_64021
 ] 

Udai Gupta commented on MIFOS-4370:
-----------------------------------

To reproduce this problem.

1. Set this in mysql configuration
[mysqld]
# 200 sec to timeout connection
wait_timeout = 200 

2. Start Mifos with default fresh database.

3. Move system time to just before 4-5 mins before mid night (by default the 
batch jobs are triggered at mid night)
   4-5 mins gives enough time to connection pooling to stabalize

4. Wait for 6-7 mins and after that check failures from Batch Job UI.

5. Repeat 3 step for next 2-3 dates in order.

The workaround fix is ready for commit after the test will complete.

To understand this issue, monitor mysql connections in MySQL admin GUI or MySQL 
Workbench, there will be 9-10 connection opened by Mifos application connection 
pooling. There are 2 different connection pooling management taking place (5 
each). Though it's bad that Mifos managing two connection pooling, but this is 
not a cause of this issue.

Monitor closely the idle time of those connections, most of them will refresh 
at about 100 sec, but one connection will not refresh.

These connection get refreshed because we use of c3p0.idleTestPeriod=100
http://www.mchange.com/projects/c3p0/index.html#idleConnectionTestPeriod
"If this is a number greater than 0, c3p0 will test all idle, pooled but 
*unchecked-out* connections, every this number of seconds."

There is one connection which is hold by HibernateUtil.sessionTL (ThreadLocal) 
which is not getting refreshed.

Hopefully this problem will get resolved correctly when we move to Spring 
Managed Transaction manager. MIFOS-4370

> Batch Job thread holds connection (HibernateSession) even after completion, 
> resulting in timeout of connection
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: MIFOS-4370
>                 URL: http://mifosforge.jira.com/browse/MIFOS-4370
>             Project: mifos
>          Issue Type: Bug
>          Components: Batch jobs
>            Reporter: Udai Gupta
>            Assignee: Udai Gupta
>             Fix For: Elsie F - Iteration 9, Elsie F
>
>
> The batch jobs fails due to connection timeout as it holds the connection in 
> batch job thread,
> Solution: 
> Make sure the session is committed(closed or null) in HibernateUtil 
> (ThreadLocal) after the work
> OR
> There should be handing connection timeout in dataSourcce using autoReconnect 
> (and validation query).
> Validate query is used for validating the connection which always fail if the 
> connection has timeout.
> Read autoReconnect here 
> http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to