Search This Blog

Thursday, November 29, 2012

Testing dialog activity - Customer Abandons Shopping Cart


  1. Register with the store in the test environment as a test customer; then place items in the shopping cart.
  2. For the ORDERS table, run an SQL query to simulate an abandoned cart for the test customer.
    For example, if the criteria for the trigger is "Check for customers with carts abandoned for 3 days," then manually change the ORDERS.LASTUPDATE data so that the last update date for the test customer's order was three days ago:
    1. To get the order ID and order time for the test customer's order, run the following SQL query:
      SELECT ORDERS_ID, LASTUPDATE FROM ORDERS 
      WHERE MEMBER_ID = (SELECT USERS_ID FROM 
      USERREG WHERE LOGONID='logon_ID')
       ORDER BY ORDERS_ID DESC
      Where logon_ID is the test customer's logon ID created during registration.
    2. To set the last update date for this order to be, for example, 3 days in the past, run the following SQL query:
      UPDATE ORDERS SET LASTUPDATE = 
      'updated_order_time' WHERE 
      ORDERS_ID = order_ID
      Where:
      updated_order_time
      is the timestamp to represent when the cart was abandoned for testing purposes. Use the same timestamp format used for the order time you retrieved with the first SQL query.
      order_ID
      is the ID of the test customer's order that you retrieved with the first SQL query
  3. Run an SQL query to force the daily processing of the trigger to occur again.
    Once a day at 2:00 a.m. (by default), the marketing services send the Customer Abandons Shopping Cart trigger to be processed by the SendMarketingTriggers scheduled job. On the day you are testing, if the send time has already passed, you can resend the trigger for processing. To do so, use the following SQL query to remove the entry from the DMACTATTR table that records that the trigger has already been processed. As a result, the trigger will be processed the next time the SendMarketingTriggers scheduled job runs.
    DELETE FROM DMACTATTR WHERE DMACTIVITY_ID = 
    0 OR DMACTIVITY_ID = (SELECT DMACTIVITY_ID 
    FROM DMACTIVITY WHERE 
    NAME = 'activity_name');
    Where activity_name is the name of the activity you are testing.
  4. Using the Administration Console, either run the SendMarketingTriggers jobmanually or wait for the next time the job runs according to its schedule interval setting.

Tuesday, November 27, 2012

WCBD for websphere commerce 6.0

WCBD with websphere commerce version 7.0 can be used with websphere commerce 6.0 as well.

 Just few jar and needs to be replaced those are already available with WCS 6.0 installation

Monday, November 26, 2012

Enabling UTF8 encoding on websphere commerce


To use multiple language encoding support in the administrative console, you must configure an application server with UTF-8 encoding enabled.
Steps for this task
  1. On the Application Server page, click on the name of the server you want enabled for UTF-8. (Servers > Server Types > Websphere application servers)
  2. On the settings page for the selected application server, click Process Definition. (Server Infrastructure > Java and Process Management > Process definition)
  3. On the Process Definition page, click Java Virtual Machine.
  4. On the Java Virtual Machine page, in Generic JVM Arguments, insert the following value -Dclient.encoding.override=UTF-8 and click OK.
  5. Click Save on the console taskbar.
  6. Restart the application server.
Note that the autoRequestEncoding option does not work with UTF-8 encoding enabled. The default behavior for WebSphere Application Server is, first, to check if charset is set on content type header. If it is, then the product uses content type header for character encoding; if it is not, then the product uses character encoding set on server using the system property default.client.encoding. If charset is not present and the system property is not set, then the product uses ISO-8859-1. Enabling autoRequestEncoding on a Web module changes the default behavior: if charset it not present on an incoming request header, the product checks the Accept-Language header of the incoming request and does encoding using the first language found in that header. If there is no charset on content type header and no Accept language header, then the product uses character encoding set on server using the system property default.client.encoding. As with the default behavior, if charset is not present and the system property is not set, then the product uses ISO-8859-1.
Further documentation surrounding this can be found at:
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-zos&topic=trun_svr_utf

Sunday, November 25, 2012

Websphere Commerce webservice client slow performance

When WebSphere Application Server functions as a JAX-RPC or JAX-WS webservice client, an intermittent web service performance problem can result.

The delay occurs after the client-side JAX-RPC handler (if present) is invoked and before the actual SOAP message is sent to the provider.  Because the delay occurs in the IBM web services engine, this problem can be difficult to detect.

Depending on the quality of service coded into the application itself, there might be application related timeouts which can occur.  However, the problem can occur without the presence of any exceptions or errors logged to the SystemOut.log.

A build-up of threads waiting on a HashMap in the Web services engine OutboundConnectionCache can occur if a thread requests a connection and creating the connection will cause the number of connections in the OutboundConnectionCache to exceed the maximum connection's limit.  This is expected behavior in high load situations, but unfortunately these same symptoms could indicate a problem in the outbound connection pool.

Adding monitoring code to the OutboundConnectionCache will diagnose these kinds of problems.

The web service runtime maintains a pool of outbound connections.  The pool contains connections that are currently in-use, connections that have recently been used, and connections that are no longer in use.

If a web service application needs to establish a new connection and the web service pool is full, the web service application is forced to wait until a connection is available from the pool.  This is the correct behaviour and allows the web service engine to execute in temporary high load situations.  High load is defined as connections having to wait due to a lack of space in the pool.

However, when these high load scenarios occur we currently do not have sufficient debug trace to examine the status of the connection pool or examine the wait times.  In addition, customers who experience these high loads don't want to turn on extensive debug trace because gathering trace may degrade performance.

As a result, several customers have asked for a trace setting that can be used to capture connection pool and wait time information without significantly impacting performance. 

This APAR introduces new JAX-RPC and JAX-WS settings that can
be used to gather connection pool information.

 The new setting for JAX-RPC is:
com.ibm.ws.webservices.engine.transport.channel.Monitor=all=enabled

 The new setting for JAX-WS is:
com.ibm.ws.websvcs.transport.channel.Monitor=all=enabled

trace will show
entries similar to these which repeat:

[8/19/09 18:08:29:658 GMT] 00000047 OutboundConne 1   Enter:
WSWS3595I: Current pool size: 25. Connections-in-use size: 0.
Configured pool size: 25


In addition, that same trace spec will show long delays in
executing the .findGroupAndGetConnection() method:

[8/19/09 18:08:03:428 GMT] 00000047 OutboundConne >
OutboundConnectionCache.findGroupAndGetConnection()
WAITING_THREADS_THRESHOLD is 5 Entry

<WSWS3595I repeats in between>

[8/19/09 18:08:38:358 GMT] 00000047 OutboundConne <
OutboundConnectionCache.findGroupAndGetConnection() Exit

Quick Fix.

- Reduce the
'com.ibm.websphere.webservices.http.connectionPoolCleanUpTime'
from the default of 180 to 120 seconds
- Increase the max connections
'com.ibm.websphere.webservices.http.maxConnection' property from
default of 25 to 50.
This will also require increasing the web container thread pool
size to 100.


For more details please refer to 

http://www-01.ibm.com/support/docview.wss?uid=swg1PK94494

http://www-01.ibm.com/support/docview.wss?uid=swg1PK77273


Friday, November 23, 2012

Differentiate cache id for mobile and base stores


The Madisons mobile starter store has some shared views with Madisons starter store.
For these shared views, how can different cache-ids be generated to cache the mobile version of the page separate from the non-mobile version of the same page?

1) In the wc-server.xml file, add the following code to /config/Components/component[name="DynaCacheFilterMappings"]:

                <map className="com.ibm.commerce.dynacache.filter.DeviceFormatIdCallBack" display="false" dynacacheAttributeName="DC_deviceFormatId" methodName="setDeviceFormatId" name="setDeviceFormatId"/>


This callback is used to generate the CacheFilter attribute "DC_deviceFormatId"


2) In the cachespec.xml file, add the following to all cache-id entries that are shared by the base store and the mobile store:

            <component id="DC_deviceFormatId" type="attribute">
                <required>true</required>
            </component>

Friday, November 16, 2012

Cleaning WCS developer database using DBClean

  • You need to copy these files from Windows installation of WCS..
  • Copy setenv.bat as setenv_DBClean.bat in {Toolkit_Home}\bin
  • Edit setenv_DBClean.bat and add the following line at the top of the file (without the ‘—>’ of course)
         —>   SET DB2_DRIVER={DB2_HOME}\java\db2java.zip
       where {DB2_HOME} is the value of your DB2 install root.
       Also change the .. to {WC6Toolkit_Home} so it looks like
         —>   call setshortname WCS_HOME {Toolkit_Home}
         —>   call setshortname WCLOGDIR {Toolkit_Home}\logs
         —>   call setshortname WCTEMPDIR {Toolkit_Home}\temp
  • Copy dbclean.bat from {WC_HOME}\bin to {Toolkit_Home}\bin
  • Edit {Toolkit_Home}\bin\dbclean.bat
         - change setenv.bat to setenv_DBClean.bat
         - change the path for Enablement-BaseComponentsLogic.jar from \wc.ear to \workspace\WC
         - change the path for jtopen.jar from \lib to \workspace\WC\lib
  • Import cleanconf rows for your toolkit’s CLEANCONF table or insert new rows as needed.

Monday, November 5, 2012

Tuning Websphere Commerce Schedulers



As of WCS 7, fix pack 2, we have few additional options to fine tune the scheduler jobs.
you can define a custom transaction timeout for scheduler Jobs which will be independent of your WAS level setting for global transaction timeout.

a. Disabling Scheduler in WCS instance
follow these steps If you have a need to not run any scheduler jobs from a given WCS instance,
Edit the wc-server.xml file of a given instance and edit the value enabled=false, this configuration will disable scheduler jobs from running on this instance.
 It is important to note that by doing this you are disabling the ability of this JVM to run any Broadcast event Jobs as well.

        <component
            compClassName="com.ibm.commerce.scheduler.SchedulerComm"
            enable="false" name="Scheduler">
            <property autoClean="off" broadcastExpireTime="1800"
                contextSetName="Authoring" cycleTime="600" display="false"/>
        </component>

b. Defining transaction timeout for Scheduler Jobs

Here are the steps which is part of APAR IZ02770, which explains how to specify the         
scheduler-specific transaction timeout settings:                       
                                                                        
Update the WC_installdir/instances/instanceName/xml/instanceName.xml
to include the new transactionTimeout field. Set the value in seconds  
for your desired transaction timeout for scheduled jobs                
                                                                       
<component                                                             
compClassName="com.ibm.commerce.scheduler.SchedulerComm"               
enable="true" name="Scheduler">                                         
<property autoClean="off"                                              
broadcastExpireTime="1800"                                             
transactionTimeout="1800"                                               
contextSetName="Authoring"                                             
cycleTime="600"                                                        
display="false">                                                       
</property>                                                             
</component>                                                           
                                                                       
Restart the application and test your scenario

2. Defining dedicated Container threads for Jobs
This setting might be useful if you are using WCS JVM to serve external traffic and also run some of the Scheduler jobs, the configuration defines maximum threads for various Jobs.

<component                                                             
compClassName="com.ibm.commerce.scheduler.SchedulerComm"               
enable="true" name="Scheduler">                                         
<property autoClean="off"                                              
broadcastExpireTime="1800"                                             
transactionTimeout="1800"                                              
contextSetName="Authoring"                                             
cycleTime="600"                                                        
display="false"> 
<applicationType applicationName="default" maxNumofThreads="10"/>      
<applicationType applicationName="broadcast" maxNumofThreads="10"/>    
<applicationType applicationName="auction" maxNumofThreads="10"/>      
<applicationType applicationName="inventory" maxNumofThreads="10"/>    
</property>                                                             
</component>

Refer following link for more details
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.admin.doc/concepts/cjsconfig.htm
 
More Reading

Maintaining Scheduler
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/index.jsp?topic=/com.ibm.commerce.admin.doc/tasks/tjsmaint.htm

Websphere Commerce Scheduler Mustgather 
https://www-304.ibm.com/support/docview.wss?uid=swg21454411

Use following trace component for troubleshooting and scheduler related issues.
*=info: enable.trace.log.*=all: com.ibm.websphere.commerce.WC_THREAD=all: com.ibm.websphere.commerce.WC_SERVER=all

Maintaining the WebSphere Commerce Scheduler tables
https://www-304.ibm.com/support/docview.wss?uid=swg21397348