Skip to content

Commit

Permalink
Merge pull request #6406 from jmstephensgit/fix_untranslated_exception
Browse files Browse the repository at this point in the history
fix for connection wait timeout translation
  • Loading branch information
jmstephensgit committed Feb 6, 2019
2 parents f91d1a3 + 1ad16d9 commit c189ff7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ NO_VALID_TRANSACTION_CONTEXT_J2CA0040.explanation=There was an internal error in
NO_VALID_TRANSACTION_CONTEXT_J2CA0040.useraction=CMSG0002

# --------------------------------
POOL_MANAGER_EXCP_CCF2_0001_J2CA0045=J2CA0045E: Connection not available while invoking method {0} for resource {1}.
POOL_MANAGER_EXCP_CCF2_0001_J2CA0045=J2CA0045E: Connection not available while invoking method {0} for resource {1}. Timed out waiting for {2} millisecond(s) with {3} remaining waiting requests and {4} current total connections used.
POOL_MANAGER_EXCP_CCF2_0001_J2CA0045.explanation=A connection wait timeout has occurred. A ConnectionWaitTimeoutException was created.
POOL_MANAGER_EXCP_CCF2_0001_J2CA0045.useraction=Reconfigure the connection pool. Increase the maximum number of connections or increase the connection wait time to avoid this error.

Expand Down
27 changes: 20 additions & 7 deletions dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/FreePool.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,26 @@ private void queueRequest(ManagedConnectionFactory managedConnectionFactory, lon
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(this, tc, "queueRequest", waitTimeout);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Current connection pool", pm.toString());
if (waitTimeout == 0) {
--pm.waiterCount;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(
tc,
"Timeout. Decremented waiterCount, which is now "
+ pm.waiterCount
+ " on datasource "
+ gConfigProps.cfName);
}
Object[] connWaitTimeoutparms = new Object[] { "queueRequest", gConfigProps.cfName, 0, pm.waiterCount,
pm.totalConnectionCount.get() };
Tr.error(
tc,
"POOL_MANAGER_EXCP_CCF2_0001_J2CA0045",
new Object[] { "queueRequest", gConfigProps.cfName });

ConnectionWaitTimeoutException cwte = new ConnectionWaitTimeoutException("Connection not available, Timed out waiting. Zero used for wait timeout");
connWaitTimeoutparms);
String connWaitTimeoutMessage = Tr.formatMessage(tc, "POOL_MANAGER_EXCP_CCF2_0001_J2CA0045", connWaitTimeoutparms);
ConnectionWaitTimeoutException cwte = new ConnectionWaitTimeoutException(connWaitTimeoutMessage);
com.ibm.ws.ffdc.FFDCFilter.processException(cwte, J2CConstants.DMSID_MAX_CONNECTIONS_REACHED, "192", this.pm);
pm.activeRequest.decrementAndGet();

Expand Down Expand Up @@ -1178,13 +1190,14 @@ protected MCWrapper createOrWaitForConnection(
+ " on datasource "
+ gConfigProps.cfName);
}
Object[] connWaitTimeoutparms = new Object[] { "createOrWaitForConnection", gConfigProps.cfName, totalTimeWaited, pm.waiterCount,
pm.totalConnectionCount.get() };
Tr.error(
tc,
"POOL_MANAGER_EXCP_CCF2_0001_J2CA0045",
new Object[] { "createOrWaitForConnection", gConfigProps.cfName });
ConnectionWaitTimeoutException cwte = new ConnectionWaitTimeoutException("Connection not available, Timed out waiting for " + totalTimeWaited +
" with current waiting requests " + pm.waiterCount +
" and current total connections used " + pm.totalConnectionCount.get());
connWaitTimeoutparms);
String connWaitTimeoutMessage = Tr.formatMessage(tc, "POOL_MANAGER_EXCP_CCF2_0001_J2CA0045", connWaitTimeoutparms);
ConnectionWaitTimeoutException cwte = new ConnectionWaitTimeoutException(connWaitTimeoutMessage);
/*
* The new ffdc prossException has a dependency on the DiagnosticModuleForJ2C and should not
* be changed without making the same changes in the Dia...J2C.
Expand Down

0 comments on commit c189ff7

Please sign in to comment.