Topic
  • 4 replies
  • Latest Post - ‏2013-02-16T05:26:27Z by SystemAdmin
SystemAdmin
SystemAdmin
8614 Posts

Pinned topic DuplicateKey exception in CTXMGMT table, when Akamai Caching is enabled

‏2012-12-11T05:30:46Z |
Hi,

Am facing a wierd issue in IE alone, only when Akamai Caching is enabled. The issue does not occur always, it behaves in an inconsistent way.
On searching for something, at times, my Search functionality gets triggered twice for some reason. To prevent multiple form submission in IE:
1. My form has an onSubmit() parameter & a Submit button
2. The submit button does not have any onClick().
3. I disable the submit button once it's hit.

At times, after the control comes out of the performExecute() of my searchCtrlCmd, a second call is again triggered. But this time, no new activity token is created in CTXMGMT, because of which this second call causes the duplicateKey exception pasted below.

The following create operation exception has occurred during processing: "javax.ejb.DuplicateKeyException: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;WCBE.CTXMGMT, DRIVER=4.7.112DSRA0010E: SQL State = 23505, Error Code = -803".". com.ibm.commerce.context.exception.BusinessContextServiceException: The following create operation exception has occurred during processing: "javax.ejb.DuplicateKeyException: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;WCBE.CTXMGMT, DRIVER=4.7.112DSRA0010E: SQL State = 23505, Error Code = -803".

If I refresh the page, I am directed to the expected page correctly (this time a new Activity Token is created, the value is one sequentially after the one that was supposed to have been created in the second call).

Could someone please give me an idea as to when exactly does an entry fall in CTXMGMT table & why was it not created during my 2nd submission?

Note: My Search command has been added in the exclusion list of DoubleClickMonitoredCommands, just to ensure that a double click would not cause any issue.

Thanks in advance,
Shiji
Updated on 2013-02-16T05:26:27Z at 2013-02-16T05:26:27Z by SystemAdmin
  • KiranYayavaram
    KiranYayavaram
    45 Posts

    Re: DuplicateKey exception in CTXMGMT table, when Akamai Caching is enabled

    ‏2012-12-11T14:16:08Z  
    Not sure if your env is already on 7.0.0.6 level, Take a look at this tech note...
    http://www-01.ibm.com/support/docview.wss?uid=swg1JR41633
  • SystemAdmin
    SystemAdmin
    8614 Posts

    Re: DuplicateKey exception in CTXMGMT table, when Akamai Caching is enabled

    ‏2012-12-12T05:41:59Z  
    Not sure if your env is already on 7.0.0.6 level, Take a look at this tech note...
    http://www-01.ibm.com/support/docview.wss?uid=swg1JR41633
    Thanks for the quick reply Kiran.
    We had seen that tech note, but the scenario seems to be quite different from what we face.
    We do not have any session timeout happening here in the meantime, but the tech note has mentioned about that and the error code also seems to be different from what we get.

    Our environment is 7.0.0.5.
  • SystemAdmin
    SystemAdmin
    8614 Posts

    Re: DuplicateKey exception in CTXMGMT table, when Akamai Caching is enabled

    ‏2012-12-29T17:40:09Z  
    Thanks for the quick reply Kiran.
    We had seen that tech note, but the scenario seems to be quite different from what we face.
    We do not have any session timeout happening here in the meantime, but the tech note has mentioned about that and the error code also seems to be different from what we get.

    Our environment is 7.0.0.5.
    We've also had the problem of double-submit that occured only in the IE8 and earlier versions of IE. It was a very strange issue, but our developer found out that the javascript comments(!) in one of the files were the cause of this behaviour.

    We replaced comments:
    
    
    /*Some comment*/ some code   
    /*Another comment*/ another code
    


    with
    
    
    //Some comment some code   
    //Another comment another code
    


    and the double-submit behaviour stopped, I think IE has some problems with this /*comments*/
  • SystemAdmin
    SystemAdmin
    8614 Posts

    Re: DuplicateKey exception in CTXMGMT table, when Akamai Caching is enabled

    ‏2013-02-16T05:26:27Z  
    Hi All,

    Just thought of publishing workaround we identified for this issue.
    The command causing the issue is a browse command & hence does not require a new user object to be created for each user invoking it. Hence, we made our command generic by overriding the isGeneric() to return true. Since a new user object is not created for generic users, the CTXMGMT table is not accessed & the DuplicateKeyException would not occur.

    Thanks,
    Shiji