daniel_locious wrote:In addition to the above issue, when I try to add a product, after fill in the fields and click save, I got
Unable to add entity for org.broadleafcommerce.core.catalog.domain.ProductImpl
org.broadleafcommerce.common.exception.ServiceException: Unable to add entity for org.broadleafcommerce.core.catalog.domain.ProductImpl
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: ERROR: duplicate key value violates unique constraint "blc_sku_pkey"
Detail: Key (sku_id)=(2) already exists.
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
org.hibernate.exception.ConstraintViolationException: ERROR: duplicate key value violates unique constraint "blc_sku_pkey"
Detail: Key (sku_id)=(2) already exists.
org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:128)
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "blc_sku_pkey"
Detail: Key (sku_id)=(2) already exists.
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
Does this mean the sku_id generator were set to 0 which is conflicted with existing records?
Cheers,
Dan
I found the reason for this one:
The import sql for sequence_generator table wasn't loaded for some reason. I tried to re-edit the configure file but still can't load those data; the rest of the import sql files runs well, that's say sql files before and after this sql file, run well. I suspected it's some mis-type-in in the sql, but I copy&paste into my db console and it runs well. So no idea what's happen.
At the moment I hv to manually run the script on dev everytime restart the server, as a workaround.