XML Data export using pre-configured sets

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

XML Data export using pre-configured sets

Dave Tenerowicz
I've used the (OFBiz) pre-configured sets for an xml export of product
data, and am getting foreign key errors. I created the files using
Product Part 1, followed by parts 2, 3 and 4. Dropped all the files into
a single directory and then attempted to import them into another
instance of OFBiz.
I get errors, as below.
The files created are numbered, and my assumption was that the numbering
would control the sequence in which they were loaded. Is this incorrect?
What is the correct sequence?

--snip errors (note: this is a partial snippet of the errors produced)--
2007-07-06 16:24:15,535 (main) [ TransactionUtil.java:291:WARN ] ----
exception report
----------------------------------------------------------
[TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
this stack trace shows where this is happening: Exception:
java.lang.Exception Message: Failure in create operation for entity
[ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
Exception while inserting the following entity:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(while inserting:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO
OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
has been rolled back.))). Rolling back transaction. ---- stack trace
---------------------------------------------------------------
java.lang.Exception: Failure in create operation for entity
[ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
Exception while inserting the following entity:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(while inserting:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO
OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
has been rolled back.))). Rolling back transaction.
org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:291)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:238)
org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java:580)
org.ofbiz.entity.GenericDelegator.storeAll(GenericDelegator.java:1097)
org.ofbiz.entity.util.EntitySaxReader.writeValues(EntitySaxReader.java:257)
org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:239)
org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:196)
org.ofbiz.entity.util.EntityDataLoader.loadData(EntityDataLoader.java:223)
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:266)
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:82)
org.ofbiz.base.start.Start.startStartLoaders(Start.java:263)
org.ofbiz.base.start.Start.startServer(Start.java:314)
org.ofbiz.base.start.Start.start(Start.java:318)
org.ofbiz.base.start.Start.main(Start.java:404)
--------------------------------------------------------------------------------

2007-07-06 16:24:15,535 (main) [ GenericDelegator.java:1131:ERROR] ----
exception report
---------------------------------------------------------- Failure in
storeAll operation: org.ofbiz.entity.GenericEntityException: Exception
while inserting the following entity:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(while inserting:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO
OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
has been rolled back.))). Rolling back transaction. Exception:
org.ofbiz.entity.GenericEntityException Message: Exception while
inserting the following entity:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(while inserting:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO
OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
has been rolled back.))) ---- stack trace
---------------------------------------------------------------
org.ofbiz.entity.GenericEntityException: Exception while inserting the
following entity:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(while inserting:
[GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO
OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
has been rolled back.)))
org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java:116)
org.ofbiz.entity.datasource.GenericHelperDAO.create(GenericHelperDAO.java:65)
--end snip

--
Dave Tenerowicz
[hidden email]

Office: 303.493.6727
Mobile 303.906.6116
Fax 303.814.8330

Visit us at http://www.salmonllc.com

Reply | Threaded
Open this post in threaded view
|

Re: XML Data export using pre-configured sets

Rodrigo Lima-2
Error:

caused a violation of foreign key constraint 'PROD_PRCAT_PROMO' for key (10020)

See 10020 duplicated key in table, or, remove the
constraint.


2007/7/12, Dave Tenerowicz <[hidden email]>:

> I've used the (OFBiz) pre-configured sets for an xml export of product
> data, and am getting foreign key errors. I created the files using
> Product Part 1, followed by parts 2, 3 and 4. Dropped all the files into
> a single directory and then attempted to import them into another
> instance of OFBiz.
> I get errors, as below.
> The files created are numbered, and my assumption was that the numbering
> would control the sequence in which they were loaded. Is this incorrect?
> What is the correct sequence?
>
> --snip errors (note: this is a partial snippet of the errors produced)--
> 2007-07-06 16:24:15,535 (main) [ TransactionUtil.java:291:WARN ] ----
> exception report
> ----------------------------------------------------------
> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
> this stack trace shows where this is happening: Exception:
> java.lang.Exception Message: Failure in create operation for entity
> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
> Exception while inserting the following entity:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (while inserting:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO
> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
> has been rolled back.))). Rolling back transaction. ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Failure in create operation for entity
> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
> Exception while inserting the following entity:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (while inserting:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO
> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
> has been rolled back.))). Rolling back transaction.
> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:291)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:238)
> org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java:580)
> org.ofbiz.entity.GenericDelegator.storeAll(GenericDelegator.java:1097)
> org.ofbiz.entity.util.EntitySaxReader.writeValues(EntitySaxReader.java:257)
> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:239)
> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:196)
> org.ofbiz.entity.util.EntityDataLoader.loadData(EntityDataLoader.java:223)
> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:266)
> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:82)
> org.ofbiz.base.start.Start.startStartLoaders(Start.java:263)
> org.ofbiz.base.start.Start.startServer(Start.java:314)
> org.ofbiz.base.start.Start.start(Start.java:318)
> org.ofbiz.base.start.Start.main(Start.java:404)
> --------------------------------------------------------------------------------
>
> 2007-07-06 16:24:15,535 (main) [ GenericDelegator.java:1131:ERROR] ----
> exception report
> ---------------------------------------------------------- Failure in
> storeAll operation: org.ofbiz.entity.GenericEntityException: Exception
> while inserting the following entity:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (while inserting:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO
> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
> has been rolled back.))). Rolling back transaction. Exception:
> org.ofbiz.entity.GenericEntityException Message: Exception while
> inserting the following entity:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (while inserting:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO
> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
> has been rolled back.))) ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.entity.GenericEntityException: Exception while inserting the
> following entity:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (while inserting:
> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO
> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
> has been rolled back.)))
> org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java:116)
> org.ofbiz.entity.datasource.GenericHelperDAO.create(GenericHelperDAO.java:65)
> --end snip
>
> --
> Dave Tenerowicz
> [hidden email]
>
> Office: 303.493.6727
> Mobile 303.906.6116
> Fax 303.814.8330
>
> Visit us at http://www.salmonllc.com
>
>
Reply | Threaded
Open this post in threaded view
|

Re: XML Data export using pre-configured sets

Dave Tenerowicz
Rodrigo-

Thanks for the response. I find that there are indeed 2 rows in
PROD_PRCAT_PROMO with an ID of 10020. What I do not understand is why
OFBiz allowed this in the first place. If this violates a foreign key
constraint on import, why do I not see errors in the operating instance
from which I created the XML Export files???
Anyone understand why OFBiz allowed this in the first place?

-Dave

Rodrigo Souza wrote:

> Error:
>
> caused a violation of foreign key constraint 'PROD_PRCAT_PROMO' for
> key (10020)
>
> See 10020 duplicated key in table, or, remove the
> constraint.
>
>
> 2007/7/12, Dave Tenerowicz <[hidden email]>:
>> I've used the (OFBiz) pre-configured sets for an xml export of product
>> data, and am getting foreign key errors. I created the files using
>> Product Part 1, followed by parts 2, 3 and 4. Dropped all the files into
>> a single directory and then attempted to import them into another
>> instance of OFBiz.
>> I get errors, as below.
>> The files created are numbered, and my assumption was that the numbering
>> would control the sequence in which they were loaded. Is this incorrect?
>> What is the correct sequence?
>>
>> --snip errors (note: this is a partial snippet of the errors produced)--
>> 2007-07-06 16:24:15,535 (main) [ TransactionUtil.java:291:WARN ] ----
>> exception report
>> ----------------------------------------------------------
>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>> this stack trace shows where this is happening: Exception:
>> java.lang.Exception Message: Failure in create operation for entity
>> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
>> Exception while inserting the following entity:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (while inserting:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (SQL Exception while executing the following:INSERT INTO
>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>> has been rolled back.))). Rolling back transaction. ---- stack trace
>> ---------------------------------------------------------------
>> java.lang.Exception: Failure in create operation for entity
>> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
>> Exception while inserting the following entity:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (while inserting:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (SQL Exception while executing the following:INSERT INTO
>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>> has been rolled back.))). Rolling back transaction.
>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:291)
>>
>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:238)
>>
>> org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java:580)
>> org.ofbiz.entity.GenericDelegator.storeAll(GenericDelegator.java:1097)
>> org.ofbiz.entity.util.EntitySaxReader.writeValues(EntitySaxReader.java:257)
>>
>> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:239)
>> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:196)
>> org.ofbiz.entity.util.EntityDataLoader.loadData(EntityDataLoader.java:223)
>>
>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:266)
>>
>> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:82)
>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:263)
>> org.ofbiz.base.start.Start.startServer(Start.java:314)
>> org.ofbiz.base.start.Start.start(Start.java:318)
>> org.ofbiz.base.start.Start.main(Start.java:404)
>> --------------------------------------------------------------------------------
>>
>>
>> 2007-07-06 16:24:15,535 (main) [ GenericDelegator.java:1131:ERROR] ----
>> exception report
>> ---------------------------------------------------------- Failure in
>> storeAll operation: org.ofbiz.entity.GenericEntityException: Exception
>> while inserting the following entity:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (while inserting:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (SQL Exception while executing the following:INSERT INTO
>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>> has been rolled back.))). Rolling back transaction. Exception:
>> org.ofbiz.entity.GenericEntityException Message: Exception while
>> inserting the following entity:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (while inserting:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (SQL Exception while executing the following:INSERT INTO
>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>> has been rolled back.))) ---- stack trace
>> ---------------------------------------------------------------
>> org.ofbiz.entity.GenericEntityException: Exception while inserting the
>> following entity:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (while inserting:
>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>
>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>
>> (SQL Exception while executing the following:INSERT INTO
>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>> has been rolled back.)))
>> org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java:116)
>> org.ofbiz.entity.datasource.GenericHelperDAO.create(GenericHelperDAO.java:65)
>>
>> --end snip
>>
>> --
>> Dave Tenerowicz
>> [hidden email]
>>
>> Office: 303.493.6727
>> Mobile 303.906.6116
>> Fax 303.814.8330
>>
>> Visit us at http://www.salmonllc.com
>>
>>
>
>

--
Dave Tenerowicz
[hidden email]

Office: 303.493.6727
Mobile 303.906.6116
Fax 303.814.8330

Visit us at http://www.salmonllc.com

Reply | Threaded
Open this post in threaded view
|

Re: XML Data export using pre-configured sets

David E Jones

"OFBiz" doesn't check foreign key constraints, it creates foreign keys in the database so the database can do it.

What do you mean by what you said, BTW? I don't get it because "PROD_PRCAT_PROMO" is not a table, it's the name of a foreign key constraint.

-David


Dave Tenerowicz wrote:

> Rodrigo-
>
> Thanks for the response. I find that there are indeed 2 rows in
> PROD_PRCAT_PROMO with an ID of 10020. What I do not understand is why
> OFBiz allowed this in the first place. If this violates a foreign key
> constraint on import, why do I not see errors in the operating instance
> from which I created the XML Export files???
> Anyone understand why OFBiz allowed this in the first place?
>
> -Dave
>
> Rodrigo Souza wrote:
>> Error:
>>
>> caused a violation of foreign key constraint 'PROD_PRCAT_PROMO' for
>> key (10020)
>>
>> See 10020 duplicated key in table, or, remove the
>> constraint.
>>
>>
>> 2007/7/12, Dave Tenerowicz <[hidden email]>:
>>> I've used the (OFBiz) pre-configured sets for an xml export of product
>>> data, and am getting foreign key errors. I created the files using
>>> Product Part 1, followed by parts 2, 3 and 4. Dropped all the files into
>>> a single directory and then attempted to import them into another
>>> instance of OFBiz.
>>> I get errors, as below.
>>> The files created are numbered, and my assumption was that the numbering
>>> would control the sequence in which they were loaded. Is this incorrect?
>>> What is the correct sequence?
>>>
>>> --snip errors (note: this is a partial snippet of the errors produced)--
>>> 2007-07-06 16:24:15,535 (main) [ TransactionUtil.java:291:WARN ] ----
>>> exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>>> this stack trace shows where this is happening: Exception:
>>> java.lang.Exception Message: Failure in create operation for entity
>>> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
>>> Exception while inserting the following entity:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (while inserting:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (SQL Exception while executing the following:INSERT INTO
>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>>> has been rolled back.))). Rolling back transaction. ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Failure in create operation for entity
>>> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
>>> Exception while inserting the following entity:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (while inserting:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (SQL Exception while executing the following:INSERT INTO
>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>>> has been rolled back.))). Rolling back transaction.
>>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:291)
>>>
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:238)
>>>
>>> org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java:580)
>>> org.ofbiz.entity.GenericDelegator.storeAll(GenericDelegator.java:1097)
>>> org.ofbiz.entity.util.EntitySaxReader.writeValues(EntitySaxReader.java:257)
>>>
>>> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:239)
>>> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:196)
>>> org.ofbiz.entity.util.EntityDataLoader.loadData(EntityDataLoader.java:223)
>>>
>>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:266)
>>>
>>> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:82)
>>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:263)
>>> org.ofbiz.base.start.Start.startServer(Start.java:314)
>>> org.ofbiz.base.start.Start.start(Start.java:318)
>>> org.ofbiz.base.start.Start.main(Start.java:404)
>>> --------------------------------------------------------------------------------
>>>
>>>
>>> 2007-07-06 16:24:15,535 (main) [ GenericDelegator.java:1131:ERROR] ----
>>> exception report
>>> ---------------------------------------------------------- Failure in
>>> storeAll operation: org.ofbiz.entity.GenericEntityException: Exception
>>> while inserting the following entity:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (while inserting:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (SQL Exception while executing the following:INSERT INTO
>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>>> has been rolled back.))). Rolling back transaction. Exception:
>>> org.ofbiz.entity.GenericEntityException Message: Exception while
>>> inserting the following entity:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (while inserting:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (SQL Exception while executing the following:INSERT INTO
>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>>> has been rolled back.))) ---- stack trace
>>> ---------------------------------------------------------------
>>> org.ofbiz.entity.GenericEntityException: Exception while inserting the
>>> following entity:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (while inserting:
>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>
>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>
>>> (SQL Exception while executing the following:INSERT INTO
>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The statement
>>> has been rolled back.)))
>>> org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java:116)
>>> org.ofbiz.entity.datasource.GenericHelperDAO.create(GenericHelperDAO.java:65)
>>>
>>> --end snip
>>>
>>> --
>>> Dave Tenerowicz
>>> [hidden email]
>>>
>>> Office: 303.493.6727
>>> Mobile 303.906.6116
>>> Fax 303.814.8330
>>>
>>> Visit us at http://www.salmonllc.com
>>>
>>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: XML Data export using pre-configured sets

Dave Tenerowicz
Thanks David. That clarifies things.

As far as PROD_PRCAT_PROMO - I just cut and pasted from Rodrigo's
response, assuming everyone would understand . The actual table was
ProductPromoCategory. There were multiple rows with id of 10020,
although they did have different productPromoCondSeqID 's so I would not
have thought they would cause a problem.

What is the naming convention for foreign key constraints, btw?

-Dave

David E Jones wrote:

>
> "OFBiz" doesn't check foreign key constraints, it creates foreign keys
> in the database so the database can do it.
>
> What do you mean by what you said, BTW? I don't get it because
> "PROD_PRCAT_PROMO" is not a table, it's the name of a foreign key
> constraint.
>
> -David
>
>
> Dave Tenerowicz wrote:
>> Rodrigo-
>>
>> Thanks for the response. I find that there are indeed 2 rows in
>> PROD_PRCAT_PROMO with an ID of 10020. What I do not understand is why
>> OFBiz allowed this in the first place. If this violates a foreign key
>> constraint on import, why do I not see errors in the operating
>> instance from which I created the XML Export files???
>> Anyone understand why OFBiz allowed this in the first place?
>>
>> -Dave
>>
>> Rodrigo Souza wrote:
>>> Error:
>>>
>>> caused a violation of foreign key constraint 'PROD_PRCAT_PROMO' for
>>> key (10020)
>>>
>>> See 10020 duplicated key in table, or, remove the
>>> constraint.
>>>
>>>
>>> 2007/7/12, Dave Tenerowicz <[hidden email]>:
>>>> I've used the (OFBiz) pre-configured sets for an xml export of product
>>>> data, and am getting foreign key errors. I created the files using
>>>> Product Part 1, followed by parts 2, 3 and 4. Dropped all the files
>>>> into
>>>> a single directory and then attempted to import them into another
>>>> instance of OFBiz.
>>>> I get errors, as below.
>>>> The files created are numbered, and my assumption was that the
>>>> numbering
>>>> would control the sequence in which they were loaded. Is this
>>>> incorrect?
>>>> What is the correct sequence?
>>>>
>>>> --snip errors (note: this is a partial snippet of the errors
>>>> produced)--
>>>> 2007-07-06 16:24:15,535 (main) [ TransactionUtil.java:291:WARN ] ----
>>>> exception report
>>>> ----------------------------------------------------------
>>>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>>>> this stack trace shows where this is happening: Exception:
>>>> java.lang.Exception Message: Failure in create operation for entity
>>>> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
>>>> Exception while inserting the following entity:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (while inserting:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (SQL Exception while executing the following:INSERT INTO
>>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
>>>> statement
>>>> has been rolled back.))). Rolling back transaction. ---- stack trace
>>>> ---------------------------------------------------------------
>>>> java.lang.Exception: Failure in create operation for entity
>>>> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
>>>> Exception while inserting the following entity:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (while inserting:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (SQL Exception while executing the following:INSERT INTO
>>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
>>>> statement
>>>> has been rolled back.))). Rolling back transaction.
>>>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:291)
>>>>
>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:238)
>>>>
>>>> org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java:580)
>>>> org.ofbiz.entity.GenericDelegator.storeAll(GenericDelegator.java:1097)
>>>> org.ofbiz.entity.util.EntitySaxReader.writeValues(EntitySaxReader.java:257)
>>>>
>>>> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:239)
>>>> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:196)
>>>> org.ofbiz.entity.util.EntityDataLoader.loadData(EntityDataLoader.java:223)
>>>>
>>>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:266)
>>>>
>>>> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:82)
>>>>
>>>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:263)
>>>> org.ofbiz.base.start.Start.startServer(Start.java:314)
>>>> org.ofbiz.base.start.Start.start(Start.java:318)
>>>> org.ofbiz.base.start.Start.main(Start.java:404)
>>>> --------------------------------------------------------------------------------
>>>>
>>>>
>>>> 2007-07-06 16:24:15,535 (main) [ GenericDelegator.java:1131:ERROR]
>>>> ----
>>>> exception report
>>>> ---------------------------------------------------------- Failure in
>>>> storeAll operation: org.ofbiz.entity.GenericEntityException: Exception
>>>> while inserting the following entity:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (while inserting:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (SQL Exception while executing the following:INSERT INTO
>>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
>>>> statement
>>>> has been rolled back.))). Rolling back transaction. Exception:
>>>> org.ofbiz.entity.GenericEntityException Message: Exception while
>>>> inserting the following entity:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (while inserting:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (SQL Exception while executing the following:INSERT INTO
>>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
>>>> statement
>>>> has been rolled back.))) ---- stack trace
>>>> ---------------------------------------------------------------
>>>> org.ofbiz.entity.GenericEntityException: Exception while inserting the
>>>> following entity:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (while inserting:
>>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
>>>>
>>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
>>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
>>>>
>>>> (SQL Exception while executing the following:INSERT INTO
>>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
>>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
>>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
>>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
>>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
>>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
>>>> statement
>>>> has been rolled back.)))
>>>> org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java:116)
>>>> org.ofbiz.entity.datasource.GenericHelperDAO.create(GenericHelperDAO.java:65)
>>>>
>>>> --end snip
>>>>
>>>> --
>>>> Dave Tenerowicz
>>>> [hidden email]
>>>>
>>>> Office: 303.493.6727
>>>> Mobile 303.906.6116
>>>> Fax 303.814.8330
>>>>
>>>> Visit us at http://www.salmonllc.com
>>>>
>>>>
>>>
>>>
>>
>
>

--
Dave Tenerowicz
[hidden email]

Office: 303.493.6727
Mobile 303.906.6116
Fax 303.814.8330

Visit us at http://www.salmonllc.com

Reply | Threaded
Open this post in threaded view
|

Re: XML Data export using pre-configured sets

Rodrigo Lima-2
Well,

> >> Rodrigo Souza wrote:
> >>> Error:
> >>>
> >>> caused a violation of foreign key constraint 'PROD_PRCAT_PROMO' for
> >>> key (10020)
> >>>
> >>> See 10020 duplicated key in table, or, remove the
> >>> constraint.

I don't speak 'PROD_PRCAT_PROMO'  table.



2007/7/13, Dave Tenerowicz <[hidden email]>:

> Thanks David. That clarifies things.
>
> As far as PROD_PRCAT_PROMO - I just cut and pasted from Rodrigo's
> response, assuming everyone would understand . The actual table was
> ProductPromoCategory. There were multiple rows with id of 10020,
> although they did have different productPromoCondSeqID 's so I would not
> have thought they would cause a problem.
>
> What is the naming convention for foreign key constraints, btw?
>
> -Dave
>
> David E Jones wrote:
> >
> > "OFBiz" doesn't check foreign key constraints, it creates foreign keys
> > in the database so the database can do it.
> >
> > What do you mean by what you said, BTW? I don't get it because
> > "PROD_PRCAT_PROMO" is not a table, it's the name of a foreign key
> > constraint.
> >
> > -David
> >
> >
> > Dave Tenerowicz wrote:
> >> Rodrigo-
> >>
> >> Thanks for the response. I find that there are indeed 2 rows in
> >> PROD_PRCAT_PROMO with an ID of 10020. What I do not understand is why
> >> OFBiz allowed this in the first place. If this violates a foreign key
> >> constraint on import, why do I not see errors in the operating
> >> instance from which I created the XML Export files???
> >> Anyone understand why OFBiz allowed this in the first place?
> >>
> >> -Dave
> >>
> >> Rodrigo Souza wrote:
> >>> Error:
> >>>
> >>> caused a violation of foreign key constraint 'PROD_PRCAT_PROMO' for
> >>> key (10020)
> >>>
> >>> See 10020 duplicated key in table, or, remove the
> >>> constraint.
> >>>
> >>>
> >>> 2007/7/12, Dave Tenerowicz <[hidden email]>:
> >>>> I've used the (OFBiz) pre-configured sets for an xml export of product
> >>>> data, and am getting foreign key errors. I created the files using
> >>>> Product Part 1, followed by parts 2, 3 and 4. Dropped all the files
> >>>> into
> >>>> a single directory and then attempted to import them into another
> >>>> instance of OFBiz.
> >>>> I get errors, as below.
> >>>> The files created are numbered, and my assumption was that the
> >>>> numbering
> >>>> would control the sequence in which they were loaded. Is this
> >>>> incorrect?
> >>>> What is the correct sequence?
> >>>>
> >>>> --snip errors (note: this is a partial snippet of the errors
> >>>> produced)--
> >>>> 2007-07-06 16:24:15,535 (main) [ TransactionUtil.java:291:WARN ] ----
> >>>> exception report
> >>>> ----------------------------------------------------------
> >>>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
> >>>> this stack trace shows where this is happening: Exception:
> >>>> java.lang.Exception Message: Failure in create operation for entity
> >>>> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
> >>>> Exception while inserting the following entity:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (while inserting:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (SQL Exception while executing the following:INSERT INTO
> >>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> >>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> >>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> >>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> >>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> >>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> >>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
> >>>> statement
> >>>> has been rolled back.))). Rolling back transaction. ---- stack trace
> >>>> ---------------------------------------------------------------
> >>>> java.lang.Exception: Failure in create operation for entity
> >>>> [ProductPromoCategory]: org.ofbiz.entity.GenericEntityException:
> >>>> Exception while inserting the following entity:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (while inserting:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (SQL Exception while executing the following:INSERT INTO
> >>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> >>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> >>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> >>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> >>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> >>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> >>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
> >>>> statement
> >>>> has been rolled back.))). Rolling back transaction.
> >>>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:291)
> >>>>
> >>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:238)
> >>>>
> >>>> org.ofbiz.entity.GenericDelegator.create(GenericDelegator.java:580)
> >>>> org.ofbiz.entity.GenericDelegator.storeAll(GenericDelegator.java:1097)
> >>>> org.ofbiz.entity.util.EntitySaxReader.writeValues(EntitySaxReader.java:257)
> >>>>
> >>>> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:239)
> >>>> org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:196)
> >>>> org.ofbiz.entity.util.EntityDataLoader.loadData(EntityDataLoader.java:223)
> >>>>
> >>>> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:266)
> >>>>
> >>>> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:82)
> >>>>
> >>>> org.ofbiz.base.start.Start.startStartLoaders(Start.java:263)
> >>>> org.ofbiz.base.start.Start.startServer(Start.java:314)
> >>>> org.ofbiz.base.start.Start.start(Start.java:318)
> >>>> org.ofbiz.base.start.Start.main(Start.java:404)
> >>>> --------------------------------------------------------------------------------
> >>>>
> >>>>
> >>>> 2007-07-06 16:24:15,535 (main) [ GenericDelegator.java:1131:ERROR]
> >>>> ----
> >>>> exception report
> >>>> ---------------------------------------------------------- Failure in
> >>>> storeAll operation: org.ofbiz.entity.GenericEntityException: Exception
> >>>> while inserting the following entity:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (while inserting:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (SQL Exception while executing the following:INSERT INTO
> >>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> >>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> >>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> >>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> >>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> >>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> >>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
> >>>> statement
> >>>> has been rolled back.))). Rolling back transaction. Exception:
> >>>> org.ofbiz.entity.GenericEntityException Message: Exception while
> >>>> inserting the following entity:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (while inserting:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (SQL Exception while executing the following:INSERT INTO
> >>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> >>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> >>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> >>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> >>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> >>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> >>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
> >>>> statement
> >>>> has been rolled back.))) ---- stack trace
> >>>> ---------------------------------------------------------------
> >>>> org.ofbiz.entity.GenericEntityException: Exception while inserting the
> >>>> following entity:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (while inserting:
> >>>> [GenericEntity:ProductPromoCategory][andGroupId,_NA_(java.lang.String)][createdStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][createdTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][includeSubCategories,Y(java.lang.String)][lastUpdatedStamp,2007-07-06
> >>>>
> >>>> 16:24:15.472(java.sql.Timestamp)][lastUpdatedTxStamp,2007-07-06
> >>>> 16:24:15.285(java.sql.Timestamp)][productCategoryId,SuperSaver(java.lang.String)][productPromoActionSeqId,_NA_(java.lang.String)][productPromoApplEnumId,PPPA_INCLUDE(java.lang.String)][productPromoCondSeqId,01(java.lang.String)][productPromoId,10020(java.lang.String)][productPromoRuleId,01(java.lang.String)]
> >>>>
> >>>> (SQL Exception while executing the following:INSERT INTO
> >>>> OFBIZ.PRODUCT_PROMO_CATEGORY (PRODUCT_PROMO_ID, PRODUCT_PROMO_RULE_ID,
> >>>> PRODUCT_PROMO_ACTION_SEQ_ID, PRODUCT_PROMO_COND_SEQ_ID,
> >>>> PRODUCT_CATEGORY_ID, AND_GROUP_ID, PRODUCT_PROMO_APPL_ENUM_ID,
> >>>> INCLUDE_SUB_CATEGORIES, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP,
> >>>> CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> >>>> ?, ?) (INSERT on table 'PRODUCT_PROMO_CATEGORY' caused a violation of
> >>>> foreign key constraint 'PROD_PRCAT_PROMO' for key (10020). The
> >>>> statement
> >>>> has been rolled back.)))
> >>>> org.ofbiz.entity.datasource.GenericDAO.insert(GenericDAO.java:116)
> >>>> org.ofbiz.entity.datasource.GenericHelperDAO.create(GenericHelperDAO.java:65)
> >>>>
> >>>> --end snip
> >>>>
> >>>> --
> >>>> Dave Tenerowicz
> >>>> [hidden email]
> >>>>
> >>>> Office: 303.493.6727
> >>>> Mobile 303.906.6116
> >>>> Fax 303.814.8330
> >>>>
> >>>> Visit us at http://www.salmonllc.com
> >>>>
> >>>>
> >>>
> >>>
> >>
> >
> >
>
> --
> Dave Tenerowicz
> [hidden email]
>
> Office: 303.493.6727
> Mobile 303.906.6116
> Fax 303.814.8330
>
> Visit us at http://www.salmonllc.com
>
>
Reply | Threaded
Open this post in threaded view
|

Adding a data item to an Entity

lshein
In reply to this post by David E Jones
I would like to add a check number to the entity EftAccount.  I have added
the field definition to my entitymodel.xml file (see below).  This has
correctly added the column to the table definition.
How will the calls to existing services, for example
'addPyamentMethodToOrder', know to also update this field?


entitymodel.xml
<extend-entity entity-name="EftAccount">

<field name="checkNumber" type="name"></field>

</extend-entity>


Reply | Threaded
Open this post in threaded view
|

Re: Adding a data item to an Entity

David E Jones

The EftAccount is for the checking account, not an individual check.

-David


Len wrote:

> I would like to add a check number to the entity EftAccount.  I have
> added the field definition to my entitymodel.xml file (see below).  This
> has correctly added the column to the table definition.
> How will the calls to existing services, for example
> 'addPyamentMethodToOrder', know to also update this field?
>
>
> entitymodel.xml
> <extend-entity entity-name="EftAccount">
>
> <field name="checkNumber" type="name"></field>
>
> </extend-entity>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding a data item to an Entity

Dave Tenerowicz
I suspect the entity that should be extended is the Payment entity.


David E Jones wrote:

>
> The EftAccount is for the checking account, not an individual check.
>
> -David
>
>
> Len wrote:
>> I would like to add a check number to the entity EftAccount.  I have
>> added the field definition to my entitymodel.xml file (see below).  
>> This has correctly added the column to the table definition.
>> How will the calls to existing services, for example
>> 'addPyamentMethodToOrder', know to also update this field?
>>
>>
>> entitymodel.xml
>> <extend-entity entity-name="EftAccount">
>>
>> <field name="checkNumber" type="name"></field>
>>
>> </extend-entity>
>>
>>
>
>

--
Dave Tenerowicz
[hidden email]

Office: 303.493.6727
Mobile 303.906.6116
Fax 303.814.8330

Visit us at http://www.salmonllc.com

Reply | Threaded
Open this post in threaded view
|

Re: Adding a data item to an Entity

lshein
I see, but my main question still remains .  If I move the check number to
the payment entity when the payment entity is updated by one of the existing
services, How will it know to also update the check number field?

----- Original Message -----
From: "Dave Tenerowicz" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, July 18, 2007 1:44 PM
Subject: Re: Adding a data item to an Entity


>I suspect the entity that should be extended is the Payment entity.
>
>
> David E Jones wrote:
>>
>> The EftAccount is for the checking account, not an individual check.
>>
>> -David
>>
>>
>> Len wrote:
>>> I would like to add a check number to the entity EftAccount.  I have
>>> added the field definition to my entitymodel.xml file (see below).
>>> This has correctly added the column to the table definition.
>>> How will the calls to existing services, for example
>>> 'addPyamentMethodToOrder', know to also update this field?
>>>
>>>
>>> entitymodel.xml
>>> <extend-entity entity-name="EftAccount">
>>>
>>> <field name="checkNumber" type="name"></field>
>>>
>>> </extend-entity>
>>>
>>>
>>
>>
>
> --
> Dave Tenerowicz
> [hidden email]
>
> Office: 303.493.6727
> Mobile 303.906.6116
> Fax 303.814.8330
>
> Visit us at http://www.salmonllc.com
>
>