You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Deepak Dixit <de...@hotwaxmedia.com> on 2010/10/27 08:14:52 UTC
Re: svn commit: r985298 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
Hello Adam,
I am using Ofbiz10.0.4 branch, and I am facing same problem, it seems
like a bug in Ofbiz10.04 branch.
So we can fix this for Ofbiz10.04 branch as well.
Thanks & Regards
--
Deepak Dixit
doogie@apache.org wrote:
> Author: doogie
> Date: Fri Aug 13 17:42:51 2010
> New Revision: 985298
>
> URL: http://svn.apache.org/viewvc?rev=985298&view=rev
> Log:
> Different entity groups can point to the same helper. However, since
> the entities defined in the group are what is passed to the helper for
> checking, it makes no sense to have protection against a helper from
> being checked multiple times.
>
> Ideally, the proper fix would be to find all groups by helper, combine
> all the entities together, then pass them to the helper in one shot.
> However, with the new tenant system, this grouping needs to be done by
> target database uri(and other parameters), not by helper name. This
> might get done later.
>
> Before this commit, any ofbiz installation that put multiple entity
> groups into the same helper would only have the entities from the first
> group get created.
>
> Modified:
> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>
> Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=985298&r1=985297&r2=985298&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
> +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Fri Aug 13 17:42:51 2010
> @@ -247,7 +247,6 @@ public class GenericDelegator implements
> }
>
> // initialize helpers by group
> - TreeSet<String> helpersDone = new TreeSet<String>();
> Set<String> groupNames = getModelGroupReader().getGroupNames(delegatorBaseName);
> for (String groupName: groupNames) {
> GenericHelperInfo helperInfo = this.getGroupHelperInfo(groupName);
> @@ -256,12 +255,6 @@ public class GenericDelegator implements
> if (Debug.infoOn()) Debug.logInfo("Delegator \"" + delegatorFullName + "\" initializing helper \"" +
> helperBaseName + "\" for entity group \"" + groupName + "\".", module);
> if (UtilValidate.isNotEmpty(helperInfo.getHelperFullName())) {
> - // make sure each helper is only loaded once
> - if (helpersDone.contains(helperInfo.getHelperFullName())) {
> - if (Debug.infoOn()) Debug.logInfo("Helper \"" + helperInfo.getHelperFullName() + "\" already initialized, not re-initializing.", module);
> - continue;
> - }
> - helpersDone.add(helperInfo.getHelperFullName());
> // pre-load field type defs, the return value is ignored
> ModelFieldTypeReader.getModelFieldTypeReader(helperBaseName);
> // get the helper and if configured, do the datasource check
>
>
>
Re: svn commit: r985298 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
Posted by Deepak Dixit <de...@hotwaxmedia.com>.
Thanks Ashish.
Thanks & Regards
--
Deepak Dixit
Ashish Vijaywargiya wrote:
> Thanks Deepak for reporting the bug. If Adam will not get a chance to commit
> it in ReleaseBranch 10.04 then I will commit it tomorrow.
>
> --
> Ashish
>
> On Wed, Oct 27, 2010 at 11:44 AM, Deepak Dixit <deepak.dixit@hotwaxmedia.com
>
>> wrote:
>>
>
>
>> Hello Adam,
>>
>> I am using Ofbiz10.0.4 branch, and I am facing same problem, it seems like
>> a bug in Ofbiz10.04 branch.
>> So we can fix this for Ofbiz10.04 branch as well.
>>
>> Thanks & Regards
>> --
>> Deepak Dixit
>>
>>
>>
>>
>> doogie@apache.org wrote:
>>
>>
>>> Author: doogie
>>> Date: Fri Aug 13 17:42:51 2010
>>> New Revision: 985298
>>>
>>> URL: http://svn.apache.org/viewvc?rev=985298&view=rev
>>> Log:
>>> Different entity groups can point to the same helper. However, since
>>> the entities defined in the group are what is passed to the helper for
>>> checking, it makes no sense to have protection against a helper from
>>> being checked multiple times.
>>>
>>> Ideally, the proper fix would be to find all groups by helper, combine
>>> all the entities together, then pass them to the helper in one shot.
>>> However, with the new tenant system, this grouping needs to be done by
>>> target database uri(and other parameters), not by helper name. This
>>> might get done later.
>>>
>>> Before this commit, any ofbiz installation that put multiple entity
>>> groups into the same helper would only have the entities from the first
>>> group get created.
>>>
>>> Modified:
>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>>
>>> Modified:
>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=985298&r1=985297&r2=985298&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>> (original)
>>> +++
>>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Fri
>>> Aug 13 17:42:51 2010
>>> @@ -247,7 +247,6 @@ public class GenericDelegator implements
>>> }
>>> // initialize helpers by group
>>> - TreeSet<String> helpersDone = new TreeSet<String>();
>>> Set<String> groupNames =
>>> getModelGroupReader().getGroupNames(delegatorBaseName);
>>> for (String groupName: groupNames) {
>>> GenericHelperInfo helperInfo =
>>> this.getGroupHelperInfo(groupName);
>>> @@ -256,12 +255,6 @@ public class GenericDelegator implements
>>> if (Debug.infoOn()) Debug.logInfo("Delegator \"" +
>>> delegatorFullName + "\" initializing helper \"" +
>>> helperBaseName + "\" for entity group \"" + groupName
>>> + "\".", module);
>>> if (UtilValidate.isNotEmpty(helperInfo.getHelperFullName())) {
>>> - // make sure each helper is only loaded once
>>> - if (helpersDone.contains(helperInfo.getHelperFullName()))
>>> {
>>> - if (Debug.infoOn()) Debug.logInfo("Helper \"" +
>>> helperInfo.getHelperFullName() + "\" already initialized, not
>>> re-initializing.", module);
>>> - continue;
>>> - }
>>> - helpersDone.add(helperInfo.getHelperFullName());
>>> // pre-load field type defs, the return value is ignored
>>>
>>> ModelFieldTypeReader.getModelFieldTypeReader(helperBaseName);
>>> // get the helper and if configured, do the datasource
>>> check
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
Re: svn commit: r985298 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
Posted by Ashish Vijaywargiya <vi...@gmail.com>.
Thanks Deepak for reporting the bug. If Adam will not get a chance to commit
it in ReleaseBranch 10.04 then I will commit it tomorrow.
--
Ashish
On Wed, Oct 27, 2010 at 11:44 AM, Deepak Dixit <deepak.dixit@hotwaxmedia.com
> wrote:
> Hello Adam,
>
> I am using Ofbiz10.0.4 branch, and I am facing same problem, it seems like
> a bug in Ofbiz10.04 branch.
> So we can fix this for Ofbiz10.04 branch as well.
>
> Thanks & Regards
> --
> Deepak Dixit
>
>
>
>
> doogie@apache.org wrote:
>
>> Author: doogie
>> Date: Fri Aug 13 17:42:51 2010
>> New Revision: 985298
>>
>> URL: http://svn.apache.org/viewvc?rev=985298&view=rev
>> Log:
>> Different entity groups can point to the same helper. However, since
>> the entities defined in the group are what is passed to the helper for
>> checking, it makes no sense to have protection against a helper from
>> being checked multiple times.
>>
>> Ideally, the proper fix would be to find all groups by helper, combine
>> all the entities together, then pass them to the helper in one shot.
>> However, with the new tenant system, this grouping needs to be done by
>> target database uri(and other parameters), not by helper name. This
>> might get done later.
>>
>> Before this commit, any ofbiz installation that put multiple entity
>> groups into the same helper would only have the entities from the first
>> group get created.
>>
>> Modified:
>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>>
>> Modified:
>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=985298&r1=985297&r2=985298&view=diff
>>
>> ==============================================================================
>> ---
>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
>> (original)
>> +++
>> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Fri
>> Aug 13 17:42:51 2010
>> @@ -247,7 +247,6 @@ public class GenericDelegator implements
>> }
>> // initialize helpers by group
>> - TreeSet<String> helpersDone = new TreeSet<String>();
>> Set<String> groupNames =
>> getModelGroupReader().getGroupNames(delegatorBaseName);
>> for (String groupName: groupNames) {
>> GenericHelperInfo helperInfo =
>> this.getGroupHelperInfo(groupName);
>> @@ -256,12 +255,6 @@ public class GenericDelegator implements
>> if (Debug.infoOn()) Debug.logInfo("Delegator \"" +
>> delegatorFullName + "\" initializing helper \"" +
>> helperBaseName + "\" for entity group \"" + groupName
>> + "\".", module);
>> if (UtilValidate.isNotEmpty(helperInfo.getHelperFullName())) {
>> - // make sure each helper is only loaded once
>> - if (helpersDone.contains(helperInfo.getHelperFullName()))
>> {
>> - if (Debug.infoOn()) Debug.logInfo("Helper \"" +
>> helperInfo.getHelperFullName() + "\" already initialized, not
>> re-initializing.", module);
>> - continue;
>> - }
>> - helpersDone.add(helperInfo.getHelperFullName());
>> // pre-load field type defs, the return value is ignored
>>
>> ModelFieldTypeReader.getModelFieldTypeReader(helperBaseName);
>> // get the helper and if configured, do the datasource
>> check
>>
>>
>>
>>
>
>
>