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

Wai commented on OFBIZ-5949:
----------------------------

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)

Reply via email to