Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Connect JMS code is doing uncached read to get JMS producer



During a load test, user enabled DBTrace for an end-user interaction and DBTrace showed that for each invocation of Connect-JMS PRPC is doing an un-cached read to get JMS producer.

Root Cause

These queries are run to fetch the latest from database but can be avoided if required. But, these queries don’t affect the performance of the individual connect calls
RULE-CONNECT-SOAP INVOKEAXIS2 #20120607T122548.881 GMT Step: 7 Circum: 0
Database query took more than threshold of 250 ms: 329 ms SQL: select pzPVStream from pr_data_admin where pzInsKey = ? inserts: <DATA-ADMIN-SECURITY-AUTHENTICATIONPROFILE PEGAAGENT>
RULE-OBJ-ACTIVITY FTB-OPS-TXP-WORK INITIALIZEASSOCENTTABVIEW calls connect-soap and this soap connector has an authentication profile set under the connector tab. So, every time the connector is called, a query to fetch the profile from database will be executed. To avoid this query, the code below in activity INVOKEAXIS2 step(7) needs to be modified. i.e comment out the call to database and hard code variables that come from the profile i.e  authPasswordValue, authUsernameValue, authDomain, authHostname and authScheme.
if (authProfileName != null && authProfileName.length() > 0)
                                                                                ParameterPage authOpenParams = new ParameterPage();
                                                                                authOpenParams.putString("pxObjClass", "Data-Admin-Security-AuthenticationProfile");
                                                                                authOpenParams.putString("pyProfileName", authProfileName);
                                                                                authProfilePage = tools.getDatabase().open(authOpenParams, true);
                                                                catch (DatabaseException e)
                                                                                throw new PRRuntimeException("Caught database exception: ", e);
                                                                                                                if (authProfilePage == null)
                                    throw new PRRuntimeException("Unable to find Data-Admin-Security-AuthenticationProfile: " + authProfileName);
// obtain the values from the auth profile
                                                java.util.HashMap propMap = svcUtil.getCredentials(keyList, authProfilePage, objPage);
                                                authPasswordValue = (propMap.get(prop_pw) == null) ? null : propMap.get(prop_pw).toString();
                                                authUsernameValue = (propMap.get(prop_un) == null) ? null : propMap.get(prop_un).toString();
                                                String authDomain = (propMap.get(prop_dom) == null) ? null : propMap.get(prop_dom).toString();
                                                String authHostname = (propMap.get(prop_host) == null) ? null : propMap.get(prop_host).toString();
                                                String authScheme = (propMap.get(prop_scheme) == null) ? null : propMap.get(prop_scheme).toString();
RULE-CONNECT-JMS INVOKEJMSCONNECTOR #20110712T003235.885 GMT Step: 1 Circum: 0
Database query took more than threshold of 250 ms: 349 ms SQL: select pzPVStream from pi_data_connect where pzInsKey = ? inserts: <DATA-ADMIN-CONNECT-JMSPRODUCERMODEL JMSMODEL>
Similar to first query above, the database call below in INVOKEJMSCONNECTOR Step(1) needs to be commented out and all variables that are assigned value from jmsPM.getString() has to be hard coded as below -
                                                // get producer model info
                                                ClipboardPage jmsPM = null;
                                                String pmName = stepPage.getString("pyJMSProducerModel");
                                                String factoryUsername = stepPage.getString("pyFactoryUsername");
                                                String factoryPassword = svcUtil.decodePassword(stepPage.getString("pyFactoryPassword"));
                                                                ParameterPage ruleKeys = new ParameterPage();
                                                                ruleKeys.putString("pxObjClass", "Data-Admin-Connect-JMSProducerModel");
                                                                ruleKeys.putString("pyProducerModelName", pmName);
                                                                jmsPM = tools.getDatabase().open(ruleKeys, false);


Submitted product enhancement request item FDBK-8284

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us