Wednesday, November 19, 2014

Tuning cache size and disk offload and disk cache size | Dynacache

Default cache size is 2000 and for production environments, it should be tuned to 10000 and this value would work in most cases.

It is a good idea to check enable disk offload in production environment. As the cache size exceeds the limit, it would offload to disk
Also make sure the disk in production environment has space allocated for this disk offload and 10 GB for production environment would be a good range in production. Make sure this setting is replicated on all application servers.

Tuesday, November 18, 2014

JVM Settings | Tuning heap size

It is very important to tune heap size with correct values in production.
Default values are minimum 256 MB and maximum heap size of 1024 MB.  For production environments the values are ideally around minimum heap size 4GB (4096m) and max heap size 6GB(6144m)
java -Xmx6144m -Xms4096m

Application Server
In the Administration Console select Servers
Expand Server Type and select WebSphere application servers
Click on the name of your server
Expand Java and Process Management and select Process Definition

Thursday, November 13, 2014

OverRide OOB outbound order XML to write to a table !!

If we need OverRide OOB outbound order XML process to write to a table, please find the below steps:

1. Create an EJB for a custom table XOrderTransfer table.
2. Override wc-component-client.xml as mentioned below
3. Override class as mentioned below.
4. In WC adminconsole, set up a broadcast job for the command "RaiseECEvent"

OverRide XML:

<_config:DevelopmentClientConfiguration xmlns:_config=""
xsi:schemaLocation=" ../xsd/wc-component-client.xsd">


<_config:action name="ProcessOrder" asynchronous="false">


public class CustomJCAInvocationBindingImpl extends JCAInvocationBindingImpl implements InvocationBinding {

public InvocationServiceObject invoke(Action action, InvocationServiceObject requestDataObject) throws InvocationServiceException {
final String methodName = "invoke";
LOGGER.entering(CLASSNAME, methodName);
String inputXML = new String(requestDataObject.getXML());
//get the orderId from the request data object
ProcessOrderType processOrderType = (ProcessOrderType) requestDataObject.getDataObject();
OrderType currentOrder = (OrderType)processOrderType.getDataArea().getOrder().get(0);
String orderId = currentOrder.getOrderIdentifier().getUniqueID();
Long orderIdLong = new Long(orderId);

//persist the order XML in the XORDERTransfer table.
XOrderTransferAccessBean orderTransferAB = new XOrderTransferAccessBean(orderIdLong, inputXML);

//invoke super class's implementation for actual message transfer
InvocationServiceObject invocationServiceObject = super.invoke(action, requestDataObject);

LOGGER.exiting(CLASSNAME, methodName);
return invocationServiceObject;

Debugging Solr Search Sort Issue on Department(Category) pages

It loads the page Layouts/CategoryNavigationResults.jsp and when selecting different sort options
When debugging the Ajax call in the Net tab, you will see the orderBy value corresponding to the values defined in the search profile.
Enable Trace:

Search in trace.log: Find searchProfile=[IBM_ in logs
e.g: found
schema.xml  : Make sure the entries are correctly available in the schema file
      <field name="abcRanking" type="tfloat" indexed="true" stored="false" multiValued="false" />
 <field name="abcRanking_display" type="float" indexed="true" stored="true" multiValued="false" />

Do not make any customization's to the FEP for this file and this would have performance impact and would cause multiple issues in future upgrades.
There are targetable versions for each environment wc-search.xml, make sure
Find the corresponding search profile in extended wc-search.xml
 <_config:profile indexName="CatalogEntry" name="IBM_ComposeProductListByCategoryId">

Check for the attribute value in the database by running in DB
select av.value,cat.partnumber,cat.catentry_id from attrvaldesc av, catentryattr cattr, attr a, catentry cat where
av.attrval_id = cattr.attrval_id
and cattr.attr_id = a.attr_id
and cattr.catentry_id =cat.catentry_id
and a.identifier='abcAttribute' order by value desc

Make sure the attribute is searchable:

Check for the Attribute in the following tables:

It is possible that attrdictsrchconf .SRCHFIELDNAME is mapped to a different name than the actual attribute name in

select * from attrdictsrchconf where attr_id in (select attr_id from attr where identifier in ('abcAttribute'))

select * from srchattr where identifier like '%abcAttribute';


    <_config:profile indexName="CatalogEntry" name="IBM_ComposeProductListByCategoryId">
            <_config:param name="maxRows" value="50"/>
            <_config:param name="maxTimeAllowed" value="15000"/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:provider classname=""/>
            <_config:field name="name"/>
            <_config:field name="1" value="mfName_ntk asc"/>
            <_config:field name="2" value="name_ntk asc"/>
            <_config:field name="3" value="price_* asc"/>
            <_config:field name="4" value="price_* desc"/>
            <_config:field name="5" value="quantitySold desc"/>
            <_config:field name="6" value="abcRanking desc" />
            <_config:field name="7" value="totalPriceSold desc"/>
            <_config:filter classname=""/>
            <_config:filter classname=""/>
            <_config:filter classname=""/>
            <_config:filter classname=""/>
            <_config:filter classname=""/>
            <_config:filter classname=""/>
            <_config:param name="sort" value="count"/>
            <_config:param name="minCount" value="1"/>
            <_config:param name="limit" value="200"/>        

Tuesday, November 11, 2014

Enabling server side logs and levels | WCS

How to get to Admin console:
Right click on Server -->Administration -->Run Administrative Console

Left menu Troubleshooting->Logs and trace and click on server and get to (Logging and Tracing > server1 > Change log detail levels).

If you need the trace to be in effect immediately, do the same setting on the Runtime tab and if you need the settings saved post server start, you would put that in Configuration.

Important trace components: e.g:

Do not try to leave trace logs on in production since it will have a huge impact on performance and even on toolkit if you don't need , i would avoid since it slows down quite a bit.

Tuesday, November 4, 2014

Using Javascript for Eval | AjaxAddOrderItem | Adding multiple parts to Cart

I ran into this problem in the past and realized, it's hard to remember the eval function and without that you could end up spending a lot of time, trying to figure out passing multiple params with dynamic values. (partNumber_1, quanitty_1...partNumber_2, quantity_2).

eval() evaluates the expression in the argument. If the argument is one or more JavaScript statements, eval() executes the statements.
E.g. service code.

    var renderCtx = wc.render.getContextById("AjaxAddToCartContext");
     //setting context properties['partNumber'] = partNumber;['quantity'] = quantity;

     eval("params.partNumber_" + counter + "='"+partNumber+ "';");
     eval("params.quantity_" + counter + "="+quantity+ ";");
    //invoke the AJAX service for orderitem add (Cart Service)
     wc.service.getServiceById("AjaxAddOrderItem").formId = orderFormId;
     wc.service.invoke("AjaxAddOrderItem", params);

Saturday, November 1, 2014

Setup instructions for outbound order XML | write to file on local toolkit

1) Setup the transport for order message in WC admin console as shown in the screenshots.
2) Place an order using front end flow pages.
3) In WC admin console, set up a broadcast job for the command "RaiseECEvent"
4) The file (filename: orderID) will be generated at the location ( C:\IBM\WCDE_ENT70\wasprofile\ordersxml) in your toolkit.