ShoppingCart.java: a tabs has been automatically replaced by 8 spaces, fixes it
UtilValidate.java: removes useless parentheses
GeneriDao.java: fixes a wrong UtilValidate.isNotEmpty
ModelFormField.java: revert all UtilValidate.is(Not)Empty() changes though I ddid not find an error there, it must be one because https://localhost:8443/humanres/control/EditResponsibilityTypes is not rendered correctly. I will check again
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1169754 13f79535-47bb-0310-9956-ffa450edef68
Changes implementation of UtilValidate.isEmpty() for Collection and Map by using isEmpty() instead of c.size() == 0). It's more clear and as efficient. Removes also useless parentheses there.
Makes use of UtilValidate.is(Not)Empty() everywhere it makes senses. This for 2 reasons:
* Make the code more readable by replacing the (!)null/isEmpty pattern.
* Avoid possible NPEs when only isEmpty() was used (after Entity.find... for instance). I found a lot of cases (242 today) where isEmpty() could perhaps be replaced in Framework. But I guess no NPE checks were missing there and anyway it was too much for me to check them all... So I only did the relevant changes in Applications...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1169478 13f79535-47bb-0310-9956-ffa450edef68
Pb: If OFBiz is deployed on 2 servers in Load Balancing Mode, SequenceUtil will generate duplicate IDs because synchronization is done at JVM level instead of doing it in DB.
The OFBIZ-2353 SELECT FOR UPDATE solution.patch provides a simple mean to quickly resolve this issue. I did not remove the bank loop (useless since there is a DB contention).
I created a cluster general property. But since, most of the time, when you use a cluster you use also a sole database with a delegator having distributed-cache-clear-enabled set to true, I retrieve this information to automatically use SELECT FOR UPDATE in this case
This has been tested on a cluster with JMeter. BTW I found that UserLoginHistory can throw errors because it does not use a SeqId in PK but only login+fromDate. I guess there are other cases like that but in reality it's unlikely that someone log on 2 diff machines with the same login at the same time (ms), just a JMeter side effect...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1144537 13f79535-47bb-0310-9956-ffa450edef68
transaction timeout to be specified, and deprecate the old ones.
Additionally, the Callable now comes first, as that is groovy
compatible.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141283 13f79535-47bb-0310-9956-ffa450edef68
that calling code can pass the reconstructed objects directly to
Executor instances.
As a nice side effect, these classes show up in exceptions, so you can
know a bit more about the transaction nature of the call stack.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141282 13f79535-47bb-0310-9956-ffa450edef68
correct; someone didn't understand how generics work(if you are casting,
you are most likely doing something wrong; if you are storing Object,
you are most likely doing something wrong).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141275 13f79535-47bb-0310-9956-ffa450edef68
that is supposed to be used on older WebLogic containers. That code was
actually completely broken. I've fixed it based on the embedded url,
but can't test it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1141274 13f79535-47bb-0310-9956-ffa450edef68
put different fields into different field sets, and when you select any
field in a particular set, all fields in that set will be fetched. This
also cascades upwards thru views, including alias-all and alias.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139922 13f79535-47bb-0310-9956-ffa450edef68
This allows for LEFT JOINs that have additional filtering applied to
them. FIXME: not implemented on theta- database types.
This feature depends on the following svn commits: 1139856, 1139869,
1139870, 1139879, 1139919.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139921 13f79535-47bb-0310-9956-ffa450edef68
output, instead of doing it each time the sql string is generated. This
solidifies the definition of getColValue() and getColName(). colName is
the identifier used to refer to the column, it's generally what comes
after the AS keyword. colValue is used to the left of AS, and in
CONDITION/ORDER BY/GROUP BY clauses.
This change should allow EntityFieldValue to be rewritten, so it doesn't
have the hack of having to deal with the entityAliasStack. In theory,
it can just call getColName/getColValue(I'm not certain which is the
correct one for this case).
Also, EntityFieldValue should not have that hack at all, it should have
been put into a completely separate class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139919 13f79535-47bb-0310-9956-ffa450edef68
consistent, and prefix each message with [entityName] so that fixing the
problem in the model definition becomes easier.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139874 13f79535-47bb-0310-9956-ffa450edef68
ModelField; use that instead of fetching the ModelField directly from
the entity. This is a fix for view-conditions, as the EntityFieldValue
has an internal ModelViewEntity that it uses to fetch the field;
fetching the raw fieldName was not correct in these cases.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139870 13f79535-47bb-0310-9956-ffa450edef68
and declared indices, do the work in parallel. Also, when the database
does not support wildcard looking of primary key info, do the per-table
lookup in parallel.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139851 13f79535-47bb-0310-9956-ffa450edef68
In view entity definition, we can use <condition-expr> to create a filter condition between field and some value using specific operator. It should be also possible to make condition between field and rel-field through some kind operator. Such as:
<view-entity entity-name="xxx" package-name="xxx">
...
<entity-condition>
<condition-expr entity-alias="A" field-name="a" operator="equals" rel-entity-alias="B" rel-field-name="b" />
</entity-condition>
</view-entity>
But there's a trivial defect in current ModelViewEntity which prevent this case working.
} else if ( value == null && (operator.equals(EntityOperator.EQUALS) || operator.equals(EntityOperator.NOT_EQUAL))) {
return EntityCondition.makeCondition(lhs, UtilGenerics.<EntityComparisonOperator<?,?>>cast(operator), null);
} else {
In the above code extracted from ModelViewEntity, it does not consider the condition that the relField could be defined when value==null.
JLR:I checked that || should not be used in <<value == null && this.relFieldName>>, it was not obvious to me but is correct
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1137201 13f79535-47bb-0310-9956-ffa450edef68
Simply avoid to start a JMS Listener thread from Job Manager when DCC is on. Then set it back to previous value.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1131144 13f79535-47bb-0310-9956-ffa450edef68
Test mode rollback doesn't work right in GenericDelegator for calls to removeByPrimary() key and removeByValue() when the row to be deleted didn't exist in the first place. It creates a TestOperation with a null value and subsequently fails to create that during rollback.
First, the TestOperation shouldn't be created at all. Second, if null is passed to GenericDelegator.create() it tries to handle this, but fails with a NullPointerException.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1104423 13f79535-47bb-0310-9956-ffa450edef68
<<Slight improvement to prevent false error messages when putting spaces in readers names, eg after commas for instance>>
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1097712 13f79535-47bb-0310-9956-ffa450edef68
We found an infinite loop when instantiate the delegator. This happens when you use the distributetCacheClear .
I moved the init of the dist cache clear to a separate method and call it in the factory which resolves the loop issue.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1090952 13f79535-47bb-0310-9956-ffa450edef68