You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2016/04/19 22:28:25 UTC

[jira] [Comment Edited] (OFBIZ-5949) ofbizsetup create product store cause exception, remove use of temp file to load entity data

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

Jacques Le Roux edited comment on OFBIZ-5949 at 4/19/16 8:28 PM:
-----------------------------------------------------------------

There seems to be a confusion about the

1) ofbizsetup feature
2) multitenancy consideration
3) ofbizsetup as it operates at this time

As I see it...

1) ofbizsetup feature

It is simply a feature that allows a new owner to configure his ofbiz with initial data to start using his ofbiz. eg. 1st party and username, product, catalog, categories, product store, and most importantly general ledger setup for the owner organization.

This feature is friendly and convenient but not necessary as the owner can always go to the appropriate components to configure the above data provided he know where to go and what needs to be done.

By 'owner' I mean

a) The party that owns the ofbiz installation. ie general.properties/mulitenant=N
b) The party that is the owner of the tenant that was assigned to him by a multitenant ofbiz provider. ie general.properties/mulitenant=Y

2) multitenant consideration

As far as I'm aware, this is already multitenant aware. Ie. the owner logs in to his ofbiz installation using a preconfigured username with admin authorizations or logs in as a preconfigured tenant with associated tenantId and username with admin authorizations for that tenant.

3) ofbizsetup as it operates at this time

It is for this point this jira report was created. As it exist, ofbizsetup is using a temp file to load template data (eg. ProductStoreData.xml) into the database.  In a multitenant setup, this method is prone to data corruption if 2 tenants are loading their respective template data file.

I think the confusion was further aggrevated by the fact that there is also another enhancement to the code.  And that is the use of FlexibleStringExpander to load template data files. ie note the the change in the placeholder in template files...

eg. ProductStoreData.xml
{code}
PRODUCTSTOREID to ${productStoreId}
ORGPARTYID to ${orgPartyId}
{code}
etc.


As an additional comment, I'm not familiar with the discussion and history of ofbizsetup that Pierre Smits was referring to.  I think that is more related to the infrastructure of ofbiz.  This jira was not about that.  This jira is simply a bug fix + enhancement.


was (Author: wt):
There seems to be a confusion about the 

1) ofbizsetup feature
2) multitenancy consideration
3) ofbizsetup as it operates at this time

As I see it...

1) ofbizsetup feature

It is simply a feature that allows a new owner to configure his ofbiz with initial data to start using his ofbiz. eg. 1st party and username, product, catalog, categories, product store, and most importantly general ledger setup for the owner organization.

This feature is friendly and convenient but not necessary as the owner can always go to the appropriate components to configure the above data provided he know where to go and what needs to be done.

By 'owner' I mean

a) The party that owns the ofbiz installation. ie general.properties/mulitenant=N
b) The party that is the owner of the tenant that was assigned to him by a multitenant ofbiz provider. ie general.properties/mulitenant=Y

2) multitenant consideration

As far as I'm aware, this is already multitenant aware. Ie. the owner logs in to his ofbiz installation using a preconfigured username with admin authorizations or logs in as a preconfigured tenant with associated tenantId and username with admin authorizations for that tenant.

3) ofbizsetup as it operates at this time

It is for this point this jira report was created. As it exist, ofbizsetup is using a temp file to load template data (eg. ProductStoreData.xml) into the database.  In a multitenant setup, this method is prone to data corruption if 2 tenants are loading their respective template data file.

I think the confusion was further aggrevated by the fact that there is also another enhancement to the code.  And that is the use of FlexibleStringExpander to load template data files. ie note the the change in the placeholder in template files...

eg. ProductStoreData.xml
PRODUCTSTOREID to ${productStoreId}
ORGPARTYID to ${orgPartyId}
etc.


As an additional comment, I'm not familiar with the discussion and history of ofbizsetup that Pierre Smits was referring to.  I think that is more related to the infrastructure of ofbiz.  This jira was not about that.  This jira is simply a bug fix + enhancement.

> ofbizsetup create product store cause exception, remove use of temp file to load entity data
> --------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5949
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5949
>             Project: OFBiz
>          Issue Type: Bug
>          Components: commonext/setup
>    Affects Versions: Trunk
>            Reporter: Wai
>            Assignee: Jacques Le Roux
>         Attachments: OFBIZ-5949.patch, OFBIZ-5949.patch, OFBIZ-5949.patch
>
>
> The exception is caused by foreign key constraint violation between ShipmentCostEstimate and  CarrierShipmentMethod entities.
> Currently, when creating a new product store using ofbizsetup component default data associated with the product store is loaded into the database using the following steps.
> 1. read default data from entity xml file and replace specific items in the read data and write to temp file.
> 2. use service=parseEntityXmlFile to load the processed file into database.
> The issue with this method is that the temp file can present a problem when ofbiz is operating in multitenant mode.
> The solution is to modify the relevant services so that no temp file needs generated.



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