cancel
Showing results for 
Search instead for 
Did you mean: 

Ordernumber is increasing by two instead one

Former Member
0 Kudos

Hi there,

I had the following configuration. 2 numberseries one for the cnd one for the order:

 <bean id="orderCodeGenerator" class="de.hybris.platform.servicelayer.keygenerator.impl.PersistentKeyGenerator">
     <property name="key" value="${keygen.order.code.name}" />
     <property name="digits" value="10" />
     <property name="start" value="420000000" />
     <property name="numeric" value="true" />
     <property name="template" value="$" />
 </bean>

 <bean id="cartCodeGenerator" class="de.hybris.platform.servicelayer.keygenerator.impl.PersistentKeyGenerator">
     <property name="key" value="cart_code" />
     <property name="digits" value="10" />
     <property name="start" value="420000000" />
     <property name="numeric" value="true" />
     <property name="template" value="cart_$" />
 </bean>

 <bean id="commerceCartFactory" class="de.hybris.platform.commerceservices.order.impl.CommerceCartFactory">
     <property name="netGrossStrategy" ref="netGrossStrategy"/>
     <property name="keyGenerator" ref="cartCodeGenerator"/>
     <property name="modelService" ref="modelService"/>
     <property name="userService" ref="userService"/>
     <property name="commonI18NService" ref="commonI18NService"/>
     <property name="baseSiteService" ref="baseSiteService"/>
     <property name="baseStoreService" ref="baseStoreService"/>
     <property name="guidKeyGenerator" ref="guidKeyGenerator"/>
 </bean>

And cache size is set to 1: numberseries.cache.size.luckynumberseries=1

Unfortunately my configuration isn't working correctly, The order number will be always increased by two instead one. The cartcodegenerator on the other hand is working correctly... Does anybody know what I'm doing wrong?

Greetz

Accepted Solutions (0)

Answers (2)

Answers (2)

christoph_meyer
Active Participant
0 Kudos

Did you check all uses of the orderCodeGenerator in the spring definitions? A quick search shows several places, that might retrieve numbers from it.

Are you using the subscriptions module? It uses several carts/orders to manage different price types and might consume two order number at once.

Former Member
0 Kudos

Hi Dominik,

You can try instead of luckynumberseries in the property to the value of key mentioned in orderCodeGenerator as numberseries.cache.size.order_code=1

For example if the value mentioned in the property then numberseries.cache.size.order_code=1 should be used. You can find more information on below link as well. I hope this solves your issue.

https://wiki.hybris.com/display/forum/Scaling+like+Hulk+with+numberseries

Thanks,

Jayahar

Former Member
0 Kudos

Unfortunately your advice don't solve the problem. Do you have maybe some other hints for me? I already debug the whole checkout process and I did'nt found out why it increase the number everytime by 2... the KeyGenerator will be also called only one time...

Former Member
0 Kudos

You might have already done this. Just to check once again that whether you have configured like this.

  <property name="key" value="order_code" />
  <property name="digits" value="10" />

................

and providing numberseries.cache.size.order_code=1 the property.