Wednesday, August 26, 2015

Run Or debug WebSphere Commerce Dataload Utilities from RAD

To run / debug your WebSphere Commerce Dataload Utilities from RAD,

Click on “Run Configurations”





Double click on java application: New_configration will appear


 Select new_configuration : In “Main” tab, Provide Main class as “com.ibm.commerce.foundation.dataload.DataLoaderMain”
 In the “Arguments” tab,
 In “Program arguments”, provide Dataload command with all the required parameters '
 In “VM arguments”, provide the value as “-Dj2se=true”

 In “Working directory”  --> other, provide bin folder path















In the “Classpath” tab, add ojdb5.jar as External Jar (If you using Oracle as backend DB)














While running the job, run it as the configuration, you have created


Tuesday, August 25, 2015

DB2 SQL Error: SQLCODE=-723, SQLSTATE=09000

Error: DB2 SQL Error: SQLCODE=-723, SQLSTATE=09000, SQLERRMC=DB2WCS.STAGIATTRNONECMC;-420;22018;BIGINT, DRIVER=3.57.82
SQLState:  09000
ErrorCode: -723


What error mean : 

The SQLCODE=-723 error is telling us that an error occurred in the named trigger (in this case, the trigger is named DB2WCS.STAGIATTRNONECMC).

Refer : SQLCODE=-723

Furthermore, in the second part of the message, DB2 is telling us that the error that is occurring in the trigger is SQL0818N (SQLSTATE 22018)


Here mostly We are passing BIGINT value where it accept CHAR or some other thing.



Friday, August 21, 2015

Rename existing table in db2

Directly renaming table in db2 is difficult. Alternet approch to achieve the same is:

Create table <NewTableName> like <ExistingTableName>
--- It will create same table structure as of existing table

insert into <NewTableName> select * from <ExistingTableName>
--- It will insert all data what we had in existing one.

Tuesday, August 18, 2015

SRVE0190E: File not found: /ManagementCenter.swf

Problem : After doing BuildOpenLazloProject it updates ManagementCenter.swf (Located at \workspace\LOBTools\WebContent) get updated. Some time when we open managment centre we see blank page.


Resolution : From your previour workspace take copy ManagementCenter.swf file and past at \workspace\LOBTools\WebContent. Dont build lazlo project again. Reopen managment centre. It will work

Thursday, August 13, 2015

Avoid dataload failure in ibm wcs


Many time while doing dataload, It get fail at some time for key constrant. How we can avoid it:--


1. Open wc-loader-XXXXX.xml file
2. Search for - <_config:BusinessObjectMediator

3. Get the className, And exyend the class.

4. Override transform method as below. Same way you can get catentry details in catch part.





@Override
protected void transform(Object catalogEntryNoun, boolean deleteFlag)
throws DataLoadException {
// TODO Auto-generated method stub


try{
super.transform(catalogEntryNoun, deleteFlag);
}catch (Exception e) {
TableDataObject.findByPrimaryKey(getAttrID(), null);

System.out.println("Attribute exception"+catalogEntryNoun.toString());
// TODO: handle exception
}



5. Update your loader xml file classname with newly created class and rerun.


Now it will load all data without failure. Some conflich data will go in cath part.

Wednesday, August 12, 2015

Direct add item in cart in ibm wcs through URL



For load testing some time we need to add multiple item in cart. We can achieve it by creating script just need to update catentryId



start /min chrome http://<Domain Name>/webapp/wcs/stores/servlet/NewProductDetailsActionControl?catEntryId=16033169^&quantity=1^&orderId=.^&outOrderName=orderId^&Add2ShopCart=true^&URL=/webapp/wcs/stores/servlet/OrderItemDisplay 

Great example of CREATE TRIGGER with declear set if statment


************************INSERT*****************************************

Create  trigger IBUNDELDERIVED
               AFTER INSERT ON CATENTREL REFERENCING NEW AS N
               FOR EACH ROW MODE DB2SQL
               BEGIN ATOMIC
                           declare reltype CHAR(32);
                           declare existing INT;
                           set reltype=TRIM(N.CATRELTYPE_ID);
                           if  (reltype is not NULL AND reltype  = 'BUNDLE_COMPONENT')
    THEN
                SET existing=(select count(*) from X_BUNDLE_DERIVED where BUNDLE_CATENTRY_ID=N.CATENTRY_ID_PARENT and ATTRIBUTE='Sequence');
                if (existing=0)
                then
                        insert into X_BUNDLE_DERIVED(BUNDLE_CATENTRY_ID,ATTRIBUTE,DERIVATION_STATUS)
                                VALUES (N.CATENTRY_ID_PARENT,'Sequence','UnProcessed');
                end if;
        end if;
               END#

********************************UPDATE*************************************
CREATE TRIGGER UBUNDELDERIVED
AFTER UPDATE ON CATENTREL REFERENCING NEW AS N OLD AS O
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC

declare reltype CHAR(32);
declare existing INT;
set reltype=TRIM(N.CATRELTYPE_ID);

if  (reltype is not null and reltype  = 'BUNDLE_COMPONENT')
    then
SET existing=(select count(*) from X_BUNDLE_DERIVED where BUNDLE_CATENTRY_ID=N.CATENTRY_ID_PARENT and ATTRIBUTE='Sequence');
if (existing =0)
then
insert into X_BUNDLE_DERIVED(BUNDLE_CATENTRY_ID,ATTRIBUTE,DERIVATION_STATUS)
values(N.CATENTRY_ID_PARENT,'Sequence','UnProcessed');
end if;
end if;
 END#