You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Mridul Pathak (JIRA)" <ji...@apache.org> on 2015/11/21 13:52:11 UTC

[jira] [Commented] (OFBIZ-6434) In ofbizsetup, create product category causes exception

    [ https://issues.apache.org/jira/browse/OFBIZ-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15020441#comment-15020441 ] 

Mridul Pathak commented on OFBIZ-6434:
--------------------------------------

ofbizsetup component creates the necessary categories when catalog setup is done, it creates browse root category which is required for the ecommerce and also the base promotion category. I think the current functionality is working as expected, the only constraint I see here is that prodCatalogId should be small enough to support the additional category creation.

That pops up an obvious question that why are we explicitly creating alphabetic IDs for these additional browse root and promotion categories when we could simply us OFBiz generated sequence IDs?

> In ofbizsetup, create product category causes exception
> -------------------------------------------------------
>
>                 Key: OFBIZ-6434
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6434
>             Project: OFBiz
>          Issue Type: Bug
>          Components: commonext/setup
>    Affects Versions: Trunk
>            Reporter: Wai
>
> in ofbizsetup. create 1st productCategory gives exception.
> Seems that ofbiz tries to auto create a promotions category but the resulting productCategoryId is too long for for the database field defined as a varchar(20).
> My database is currently configured to use utf8.
> ...console output...
> INSERT INTO public.PRODUCT_CATEGORY (PRODUCT_CATEGORY_ID, PRODUCT_CATEGORY_TYPE_ID, PRIMARY_PARENT_CATEGORY_ID, CATEGORY_NAME, DESCRIPTION, LONG_DESCRIPTION, CATEGORY_IMAGE_URL, LINK_ONE_IMAGE_URL, LINK_TWO_IMAGE_URL, DETAIL_SCREEN, SHOW_IN_SELECT, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES ('MYCOCLG1_ID_PROMOTIONS', 'CATALOG_CATEGORY', NULL, 'MYCOCLG1_ID Promotions', NULL, NULL, NULL, NULL, NULL, 'component://ecommerce/widget/CatalogScreens.xml#categorydetailmatrix', NULL, '2015-05-29 13:03:32.740000 -04:00:00', '2015-05-29 13:03:32.587000 -04:00:00', '2015-05-29 13:03:32.740000 -04:00:00', '2015-05-29 13:03:32.587000 -04:00:00')
> 2015-05-29 13:03:32,743 |ttp-bio-8443-exec-10 |GenericDelegator              |E| Failure in create operation for entity [ProductCategory]: org.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:ProductCategory][categoryName,MYCOCLG1_ID Promotions(java.lang.String)][createdStamp,2015-05-29 13:03:32.74(java.sql.Timestamp)][createdTxStamp,2015-05-29 13:03:32.587(java.sql.Timestamp)][detailScreen,component://ecommerce/widget/CatalogScreens.xml#categorydetailmatrix(java.lang.String)][lastUpdatedStamp,2015-05-29 13:03:32.74(java.sql.Timestamp)][lastUpdatedTxStamp,2015-05-29 13:03:32.587(java.sql.Timestamp)][productCategoryId,MYCOCLG1_ID_PROMOTIONS(java.lang.String)][productCategoryTypeId,CATALOG_CATEGORY(java.lang.String)] (SQL Exception while executing the following:INSERT INTO public.PRODUCT_CATEGORY (PRODUCT_CATEGORY_ID, PRODUCT_CATEGORY_TYPE_ID, PRIMARY_PARENT_CATEGORY_ID, CATEGORY_NAME, DESCRIPTION, LONG_DESCRIPTION, CATEGORY_IMAGE_URL, LINK_ONE_IMAGE_URL, LINK_TWO_IMAGE_URL, DETAIL_SCREEN, SHOW_IN_SELECT, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(20)))



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)