function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
David Dev 2David Dev 2 

How to catch common.util.database.connectionpooltimeoutexception?

We are using apex:actionFunction to run a method every minute. We get a common.util.database.connectionpooltimeoutexception from time to time. How do we catch the exception so it doesn't break the window? 

The full error is:
common.util.database.connectionpooltimeoutexception. Request Timed out waiting for connection:[config 200ms, actual 201ms]
KevinPKevinP
I'm not entirely sure you *can* catch that error. However, you can adjust the timeout value on your action function with the timeout parameter:
 
<apex:actionFunction action="{!methodOne}" name="methodOneInJavascript" rerender="showstate" timeout="Some Number of Milliseconds higher than 200">
        <apex:param name="firstParam" assignTo="{!state}" value="" />
    </apex:actionFunction>