Hello All:
For those who don't know this, I forgot to mention that there isn't a way to simply "expire" a product as suggested by "Pierre".

Once the product is installed in the database - it is there to be seen by whoever is smart enough to find it. That doesn't mean you can't find ways to make it difficult to find. It means that if you know what you are doing, you can find the product.

Best Regards
Ruth Hoffman
http://www.aesolves.com
rhoff...@aesolves.net
On 1/30/15 11:18 AM, Ruth Hoffman wrote:
Hello All:
If you are at all curious where these keywords are coming from and why there is this foreign-key dependency in the first place, then read on:

These database records are being created automatically because there are Entity-Control-Actions (ECAs) placed directly on several of the Entities that model the database table(s) used to create and manage products.

ECAs allow you to trigger one or more actions (automatically - no human intervention) based on specified database manipulation(s) for configured target Entities. For example, indexing keywords that are found in a product description.

More to your situation: If you want to minimize the number of keywords created for a product and thus minimize the number of database records you must delete before you can remove the product record, then take a look at the Catalog Manager -> Products -> Keywords -> Delete All Keywords.

Finally, IMHO there should be a way to delete a product from the database. There are business situations where deleting a product is valid and expiring a product is not. Unfortunately, the OFBiz Entity Engine does not support cascading deletes.

Best Regards,
Ruth Hoffman
http://www.aesolves.com
rhoff...@aesolves.net

On 1/30/15 3:16 AM, i...@agentur-m3.de wrote:
Hi All,

I tried to create some test products (just product_id
and description and a user defined PRODUCT_TYPE_ID
"FLEAMARKETITEM")  using  a simple method.

ofbiz now gives me an error when deleting them.

Pressing delete-button the data engine says:

Delete failed (write error): org.ofbiz.entity.GenericEntityException:
org.ofbiz.entity.GenericDataSourceException: Exception while deleting
the following entity:
[GenericEntity:Product][productId,fleamarket(java.lang.String)] (SQL
Exception while executing the following:DELETE FROM OFBIZ.PRODUCT WHERE
PRODUCT_ID=? (DELETE on table 'PRODUCT' caused a violation of foreign
key constraint 'PROD_KWD_PROD_NEW' for key (fleamarket). The statement
has been rolled back.)) (Exception while deleting the following entity:
[GenericEntity:Product][productId,fleamarket(java.lang.String)] (SQL
Exception while executing the following:DELETE FROM OFBIZ.PRODUCT WHERE
PRODUCT_ID=? (DELETE on table 'PRODUCT' caused a violation of foreign
key constraint 'PROD_KWD_PROD_NEW' for key (fleamarket). The statement
has been rolled back.)))

Also I tried with SQL:

SQL Exception while executing the following:DELETE FROM PRODUCT WHERE
PRODUCT_TYPE_ID = 'FLEAMARKETITEM' (DELETE on table 'PRODUCT' caused a
violation of foreign key constraint 'PROD_KWD_PROD_NEW' for key
(fleamarket). The statement has been rolled back.)


So it seems I can't delete these items. What is going wrong?
How can I reset the entity state to correct relations?


Thank you!


Reply via email to