Topic
5 replies Latest Post - ‏2013-07-05T18:56:10Z by ApoorvaKhatri
ApoorvaKhatri
ApoorvaKhatri
14 Posts
ACCEPTED ANSWER

Pinned topic Who/what controls PX_PROMOTION_ID / CALCODE_ID generation in Management Center?

‏2013-06-09T16:29:58Z |

When we store a promo through management center, these ID's (PX_PROMOTION_ID, CALCODE_ID) are generated as negative sequence. However, KEYS table have positive entry in them. And we can't change them to negative in KEYS table.

 
This is causing a lot of issues for my promotion migration from legacy system to WCS.
What controls these ID's generation in Management Center?
 
Best,
Apoorva.

 

  • Raj.S
    Raj.S
    511 Posts
    ACCEPTED ANSWER

    Re: Who/what controls PX_PROMOTION_ID / CALCODE_ID generation in Management Center?

    ‏2013-06-10T06:28:26Z  in response to ApoorvaKhatri

    I think, even ManagementCenter tool refers to KEYS table to create primary keys for tables CALCODE and PX_PROMOTION. I tried creating couple of promotions through management center and found the PK's to me in sync with the KEYS.COUNTER.

    Is it some specific approach you are following to create promotions ?

    Please check if this helps. Try enabling the following traces

    EJBContainer=all:PMGR=all        // logs the sql queries across the txn, you can check if KEYS table is being queried during promotion creation.

    com.ibm.websphere.commerce.WC_SERVER  // I hope this should log any traces during the execution of KeyLocator Framework

    The trace may give some clue of what is happening. This traces may fill the log files quickly and I recommend enabling the trace just before clicking on SAVE (of promotion) from management center.

     

    Rgds, Raj

    • ApoorvaKhatri
      ApoorvaKhatri
      14 Posts
      ACCEPTED ANSWER

      Re: Who/what controls PX_PROMOTION_ID / CALCODE_ID generation in Management Center?

      ‏2013-06-10T15:12:37Z  in response to Raj.S

      Thank you for the response Raj.

      I enabled this : "*=info: EJBContainer=all: PMGR=all: com.ibm.websphere.commerce.WC_SERVER=all: com.ibm.websphere.commerce.WC_SERVER_MANAGEMENT=all: com.ibm.ejs.persistence.*=all"

      I don't see word "keys" in trace at all. Here is the trace just before promo ID is assigned:

       

      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  <  EJBpostInvoke(4:_copyFromEJB) Exit
      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  3   ObjectResolver:postinvoke(java.lang.Boolean)
      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  3   ObjectResolver:preinvoke(com.ibm.commerce.tools.epromotion.objects._EJSRemoteCMPCalculationCodePromotionHome_9ef7490a_Tie, create__com_ibm_commerce_context_content_resources_EntityBeanCreationData)
      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  3   doesJaccNeedsEJBArguments returning false
      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  >  mapMethodInfo(0,null) Entry
      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  <  mapMethodInfo Exit
      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  >  EJBpreInvoke(0:create) Entry
      [6/10/13 10:42:09:531 EDT] 00000069 EJSWrapperCom >  pinOnce: BeanId(__homeOfHomes#__homeOfHomes#__homeOfHomes, WC_MBPQA#Merchandising-PromotionsAndDiscountsData.jar#CalculationCodePromotion) Entry
      [6/10/13 10:42:09:531 EDT] 00000069 EJSWrapperCom <  pinOnce : 1 Exit
      [6/10/13 10:42:09:531 EDT] 00000069 WrapperManage 3   preInvoke : pinned = true
                                       com.ibm.commerce.tools.epromotion.objects.EJSRemoteCMPCalculationCodePromotionHome_9ef7490a
      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  3   preInvokeActivate : Invoking EJBComponentInitializationCollaborator.preInvoke method on: com.ibm.ws.asynchbeans.naming.JavaCompManager
      [6/10/13 10:42:09:531 EDT] 00000069 EJSContainer  3   preInvokeActivate : Invoking BeforeActivationAfterCompletionCollaborator.preInvoke method on: com.ibm.ws.pmi.reqmetrics.PmiRmEJBCollaborator
      [6/10/13 10:42:09:532 EDT] 00000069 TransactionCo >  preInvoke Entry
      [6/10/13 10:42:09:532 EDT] 00000069 TransactionCo >  completeTxTimeout Entry
      [6/10/13 10:42:09:532 EDT] 00000069 TransactionCo <  completeTxTimeout exit Exit
      [6/10/13 10:42:09:532 EDT] 00000069 Required      >  preInvoke Entry
      [6/10/13 10:42:09:532 EDT] 00000069 Required      <  preInvoke Exit
      [6/10/13 10:42:09:532 EDT] 00000069 TransactionCo <  preInvoke : com.ibm.ejs.csi.TxCookieImpl@7aae7aae Exit
      [6/10/13 10:42:09:532 EDT] 00000069 EJSContainer  >  getCurrentTx (tid=186593, global) Entry
      [6/10/13 10:42:09:532 EDT] 00000069 EJSContainer  <  getCurrentTx : ContainerTx@65dc65dc#tid=186593 Exit
      [6/10/13 10:42:09:532 EDT] 00000069 ContainerTx   1   current isolation level = TRANSACTION_READ_COMMITTED, attempting to change to = TRANSACTION_READ_COMMITTED
      [6/10/13 10:42:09:532 EDT] 00000069 UncachedActiv >  atActivate (BeanId(__homeOfHomes#__homeOfHomes#__homeOfHomes, WC_MBPQA#Merchandising-PromotionsAndDiscountsData.jar#CalculationCodePromotion)) Entry
                                       ContainerTx@65dc65dc#tid=186593
      [6/10/13 10:42:09:532 EDT] 00000069 UncachedActiv <  atActivate Exit
                                       StatelessBeanO(null, state = POOLED)
      [6/10/13 10:42:09:532 EDT] 00000069 EJSContainer  <  EJBpreInvoke(0:create)  Invoking method 'create' on bean 'com.ibm.commerce.tools.epromotion.objects.EJSRemoteCMPCalculationCodePromotionHome_9ef7490a(BeanId(__homeOfHomes#__homeOfHomes#__homeOfHomes, WC_MBPQA#Merchandising-PromotionsAndDiscountsData.jar#CalculationCodePromotion))', 'ContainerTx@65dc65dc#tid=186593', isGlobalTx=true Exit
      [6/10/13 10:42:09:532 EDT] 00000069 EJSContainer  3   getCurrentTx() : ContainerTx@65dc65dc#tid=186593
      [6/10/13 10:42:09:532 EDT] 00000069 EJSHome       >  createBeanO(ContainerTx, activate) activate = false Entry
      [6/10/13 10:42:09:532 EDT] 00000069 EJSHome       3   CallbackBeanO = ContainerManagedBeanO(null, state = POOLED)
      [6/10/13 10:42:09:532 EDT] 00000069 EJSHome       <  createBeanO(ContainerTx, activate) activate = false Exit
      [6/10/13 10:42:09:532 EDT] 00000069 EJSHome       >  postCreate Entry
                                       calCodeId=-647671216 promotionId=-647669216

       

      Updated on 2013-06-10T15:13:04Z at 2013-06-10T15:13:04Z by ApoorvaKhatri
      • ApoorvaKhatri
        ApoorvaKhatri
        14 Posts
        ACCEPTED ANSWER

        Re: Who/what controls PX_PROMOTION_ID / CALCODE_ID generation in Management Center?

        ‏2013-06-10T15:47:12Z  in response to ApoorvaKhatri

        In addition to that, I enabled following traces:

        com.ibm.ws.rsadapter.jdbc.*=all: com.ibm.ws.rsadapter.jdbcproviderutils.*=all

         

        Still no "keys" in the trace, and no clarify as to who creates this negative px_promotion_id/calcode_id :(

         

        Apoorva.

        • Raj.S
          Raj.S
          511 Posts
          ACCEPTED ANSWER

          Re: Who/what controls PX_PROMOTION_ID / CALCODE_ID generation in Management Center?

          ‏2013-06-11T05:18:04Z  in response to ApoorvaKhatri

          Hmmm, can you please capture trace with

              com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement=all:EJBContainer=all

          and share the trace.log.

          Also, could you please share the entries of PX_PROMOTION and CALCODE tables from KEYS table.

           

          Atleast, these may leave some clue.

           

          Rgds, Raj.

          • ApoorvaKhatri
            ApoorvaKhatri
            14 Posts
            ACCEPTED ANSWER

            Re: Who/what controls PX_PROMOTION_ID / CALCODE_ID generation in Management Center?

            ‏2013-07-05T18:56:10Z  in response to Raj.S

            I played around with KEYS table and was able to fix this with following entries: lowerbound set to 0, upperbound to really high value and counter set to a value larger than current counter and current upperbound.

            Our current theory is that this is some sort of migration (WC6 to 7) issue from a couple of years back. Root cause is unknown at this point in time.