Commit Graph
1462 Commits
Author SHA1 Message Date
Adrian Crum d79ac2631a Upgrade Derby to 10.10.1.1.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1553893 13f79535-47bb-0310-9956-ffa450edef68
2013-12-28 19:20:08 +00:00
Adrian Crum 7cad5f6af5 A small code cleanup in the entity engine - remove deprecated functionality. Originally, the "blob" field type was used as a catch-all for java.sql.Blob, byte[], and java.lang.Object. Now each Java type has its own field type - so you must specify the correct one.
IMPORTANT: This commit might break some applications. If you get ClassCastExceptions, then you need to change the field type in your entity from blob to either byte-array or object. The change will have no effect on your database - because they are all persisted as BLOB SQL types.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1553890 13f79535-47bb-0310-9956-ffa450edef68
2013-12-28 19:15:58 +00:00
Jacques Le Roux 1276dc8eb8 Removes an useless debug log error, caught around anyway
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1552311 13f79535-47bb-0310-9956-ffa450edef68
2013-12-19 13:17:03 +00:00
Jacques Le Roux c75405ca4a Even if I don't like much never-ending stacks in logs, this adds a log error in case the exception would be swallowed (recommended practice)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1552249 13f79535-47bb-0310-9956-ffa450edef68
2013-12-19 08:08:16 +00:00
Jacques Le Roux 748770fb6d No functional change. As suggested Adrian on dev ML, creates the AtomicReference update outside the try-catch block.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1552120 13f79535-47bb-0310-9956-ffa450edef68
2013-12-18 21:56:33 +00:00
Jacques Le Roux be880e2c5f No functional automated changes
Add @Override annotations
Fixes comments indentation
Removes trailing blanks


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1552077 13f79535-47bb-0310-9956-ffa450edef68
2013-12-18 20:12:37 +00:00
Jacques Le Roux 60597ea005 Fixes <<FIXME: Replace DCL code with AtomicReference>>
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1552073 13f79535-47bb-0310-9956-ffa450edef68
2013-12-18 19:46:50 +00:00
Jacques Le Roux 3d458932c5 A slightly modified patch from Leon for "sequence-bank-size attributes does not work anymore" https://issues.apache.org/jira/browse/OFBIZ-5429
No matter how I set "sequence-bank-size" for an entity (in my example, its "EntityAuditLog"), the bank size is always default value "10".
It seems that this feature was lost by a serials update of revision 922724 to 922733 submitted by doogie.

jleroux: This thread http://markmail.org/message/ifosqek74gqtv7fz trace the root cause
Leon's fix is safe from a concurrency perspective. I just added a check on SequenceBank.maxBankSize and put some doc in the XSD

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1551744 13f79535-47bb-0310-9956-ffa450edef68
2013-12-17 22:45:20 +00:00
Adrian Crum fb23ff7e09 Improved error message in GenericEntity.java - no functional change. The improved message should help developers solve the problem causing the exception.
This has been discussed before, but I will mention it again for instruction: GenericEntity instances that are kept in the entity cache are shared among multiple threads. Therefore, they must be immutable. If you get a GenericEntity instance from the cache and you want to modify it, you must clone it first.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1547790 13f79535-47bb-0310-9956-ffa450edef68
2013-12-04 12:43:24 +00:00
Adrian Crum 3afb5a5c06 Fixed a regression in ModelEntity.java caused by the recent thread-safety refactoring. Patch provided by Leon - https://issues.apache.org/jira/browse/OFBIZ-5399.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1543994 13f79535-47bb-0310-9956-ffa450edef68
2013-11-21 00:37:08 +00:00
Jacques Le Roux a38a21fc0a This closes "Introduce Tomcat's JreMemoryLeakPreventionListener and why" https://issues.apache.org/jira/browse/OFBIZ-5395
The idea is to avoid ThreadLocal with custom classes, this can lead to memory leaks when an external application server is used.
Reverts r1075322 (commit for OFBIZ-4107) hence removes CompilerMatcher 
Uses PatternFactory instead of CompilerMatcher class (from CompilerMatcher keeps the compiled patterns cache idea)
In UtilHttp.java
  Removes dead code
  Removes useless "UtilHttp." for class methods and constants calls (moot point, have we conventions on this?).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1542960 13f79535-47bb-0310-9956-ffa450edef68
2013-11-18 09:46:35 +00:00
Hans Bakker 0b22680991 some errors left from the removal of the postgresqlnew data resource
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1537396 13f79535-47bb-0310-9956-ffa450edef68
2013-10-31 07:45:36 +00:00
Adrian Crum a2c1465efd Fixed a bug in the entity tests - JUnit expected and actual arguments were reversed in the testTransactionUtilRollback test.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533542 13f79535-47bb-0310-9956-ffa450edef68
2013-10-18 16:34:09 +00:00
Adrian Crum 4b75f74431 Fixed some flaws in the JDBC password handling code. Improved JavaDocs in updated code.
The original code would provide a null or empty password (depending on code branching) if no password was configured, so I wasn't able to determine what the desired behavior was. Now an exception is thrown if there is no JDBC password, and datasource connection attempts fail gracefully.

If we want to support 'authenticationless' JDBC connections, then this will need to be looked at again.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533202 13f79535-47bb-0310-9956-ffa450edef68
2013-10-17 18:33:49 +00:00
Adrian Crum 047036654c Added some convenience methods to GenericHelperInfo.java that will help simplify client code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533171 13f79535-47bb-0310-9956-ffa450edef68
2013-10-17 17:27:51 +00:00
Adrian Crum 4dd795cb50 Code cleanup and small optimization in GenericHelperInfo.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533147 13f79535-47bb-0310-9956-ffa450edef68
2013-10-17 16:42:42 +00:00
Jacques Le Roux 0381244267 This completes r1530237 where fieldtypepostnew.xml has been removed.
* Removes useless commented out blocks of <group-maps in <delegators definitions
* Removes now useless localpostnew <datasource definition
* Default the result-fetch-size attribute to 50, and comment about older unsupported versions of jdbc drivers

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1531269 13f79535-47bb-0310-9956-ffa450edef68
2013-10-11 12:21:51 +00:00
Adrian Crum 771000f8f0 Allow redefinition of view entities. XML schema change only - implementation exists already.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530976 13f79535-47bb-0310-9956-ffa450edef68
2013-10-10 13:41:45 +00:00
Jacques Le Roux c8ce55ecc9 A patch from Anahita Goljahani for Fixed mispelling of "occurred" https://issues.apache.org/jira/browse/OFBIZ-5342
jleroux: this includes a safe change in jquery.validate.js and jquery.validate.min.js

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530341 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 16:35:40 +00:00
Jacques Le Roux e5791f84bf SAP changes for CC date type was missing at r1530235
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530238 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 11:40:22 +00:00
Jacques Le Roux d7de823054 As suggested on dev ML: merges fieldtypepostgres.xml and fieldtypepostnew.xml and finally removes fieldtypepostnew.xml
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530237 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 11:39:08 +00:00
Jacques Le Roux 8fcd9e7ad7 Fix a bug reported by Anahita Goljahani on dev ML
At r1529674 I forgot that CC numbers are encoded in DB and CC dates are not 4 (1013) but 7 chars (10/2013)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530235 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 11:36:07 +00:00
Adrian Crum 0a48201604 There is some confusion over maximum email address length due to conflicting RFCs. So, we will accept the longest length specified and let the email servers decide what they will accept.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1529838 13f79535-47bb-0310-9956-ffa450edef68
2013-10-07 13:31:55 +00:00
Jacques Le Roux 3ca4b45d8f Same restriction for email addresses than recently done for url. An email address is now definitively no more than 254 characters:
https://en.wikipedia.org/wiki/Email_address#Syntax
http://stackoverflow.com/questions/386294/what-is-the-maximum-length-of-a-valid-email-address#answer-574698
Also a CC number and date are respectively no more than 19 and 4 digits: https://en.wikipedia.org/wiki/ISO/IEC_7813

I decided to not limit the tel numbers (now 60 chars seems plenty enough), maybe someone will even needs to increase in a far future :)

While at it, normalises fieldtypepostnew.xml:
* Removes confusing comment in header
* Restricts most types like in fieldtypepostgres.xml (no needs to have them longer), but keep unlimited (actually 2GB max): comment, description


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1529674 13f79535-47bb-0310-9956-ffa450edef68
2013-10-06 20:03:12 +00:00
Adrian Crum 684d49d8b1 Updated the Hypersonic SQL support in the entity engine.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1529644 13f79535-47bb-0310-9956-ffa450edef68
2013-10-06 16:35:50 +00:00
Adrian Crum a04a0a2746 Increased the "url" field type to 2000 characters.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1529637 13f79535-47bb-0310-9956-ffa450edef68
2013-10-06 15:57:31 +00:00
Adrian Crum 91294728c2 Fixed a problem with bad try-catch-finally nesting and transaction handling in GenericDelegator.
1. The only exception caught was GenericEntityException, so any other thrown exception was missed - meaning the transaction was committed and GenericDelegator acted as if nothing was wrong.

2. The commit was performed in the finally block, so it was ALWAYS performed - even after an exception was thrown and the transaction was rolled back.

We managed to get away with this all along because typically there is a wrapping transaction that clears it all up. But still, the Delegator code needs to handle transactions correctly.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1527810 13f79535-47bb-0310-9956-ffa450edef68
2013-09-30 22:43:02 +00:00
Adrian Crum d64e8c0c7c Fixed a subtle flaw in the GenericDelegator.findOne method. When a database query returns no result, GenericValue.NULL_VALUE is put in the pk cache - so future findOne calls will know the entity value doesn't exist. But the findOne method never checked for GenericValue.NULL_VALUE in cache gets, so the database was queried again for an entity value we already know doesn't exist.
https://issues.apache.org/jira/browse/OFBIZ-5332


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1527626 13f79535-47bb-0310-9956-ffa450edef68
2013-09-30 16:13:03 +00:00
Adrian Crum 8117cb5756 Small change to GenericDelegator.findOne method - moved the primary key validation check to the beginning of the method.
I believe the original intention was to perform the validation check after the EV_VALIDATE ECAs were run, but the primary key was being used in three method calls before that happened - so those methods could have been passed an invalid primary key.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1527609 13f79535-47bb-0310-9956-ffa450edef68
2013-09-30 15:15:35 +00:00
Adrian Crum d5511e39cd Small code cleanup and optimization in ModelEntityChecker.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1526226 13f79535-47bb-0310-9956-ffa450edef68
2013-09-25 16:44:16 +00:00
Jacques Le Roux ff5f0a5096 A patch for "Deprecate doCacheClear in Delegator interface and class and related minilang classes" https://issues.apache.org/jira/browse/OFBIZ-5325
* Deprecates methods in Delegator interface and class
* Deprecates cache clear related variable and methods in EntitySaxReader class
* Deprecates cache clear related variables in minilang related delegator classes
* In simple-method schema annotations, marks do-cache-clear attribute as deprecated 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1524704 13f79535-47bb-0310-9956-ffa450edef68
2013-09-19 12:03:47 +00:00
Adrian Crum 572ac66d16 Minor change to GenericDelegator - Put some logging calls inside if blocks.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1524183 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 19:17:49 +00:00
Adrian Crum 8004ad04c2 JavaDoc fix - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1524134 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 17:17:56 +00:00
Jacques Le Roux 53343461e0 Since we decided to keep findAll, no reasons to deprecate
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1523645 13f79535-47bb-0310-9956-ffa450edef68
2013-09-16 13:38:08 +00:00
Jacques Le Roux ca73e7694e As suggested on dev ML, reintroduces findAll("EntityName") but uses the new pattern with a cache variable rather than a signature with "Cache" in method name (thanks to Adrian's comment on dev ML)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1523507 13f79535-47bb-0310-9956-ffa450edef68
2013-09-15 21:58:38 +00:00
Jacques Le Roux d54e2f098c As suggested on dev ML, reintroduce findAll("EntityName"), I decided that findAllCache("EntityName") could be also. If you disagree on findAllCache, just remove it...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1523466 13f79535-47bb-0310-9956-ffa450edef68
2013-09-15 17:53:43 +00:00
Jacques Le Roux 251558ca8c Better to have this in doc than in a comment
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1520249 13f79535-47bb-0310-9956-ffa450edef68
2013-09-05 08:23:59 +00:00
Jacopo Cappellato 3fd7d250d9 Fixed bug introduced in rev 1490678 (removal of cached DOM tree code and refactoring for thread-safety): after that commit it was not possible to define entity data readers at runtime, this fix re-enables the feature.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1516094 13f79535-47bb-0310-9956-ffa450edef68
2013-08-21 06:20:42 +00:00
Jacques Le Roux 1956e731a3 No functional changes, only formatting.
While looking for other cases like r1459222 and r1509164 introduced by r1300812 and r1305309. I noticed there were a lot of wrong for loops formatting (miss a white space after for), this changes it

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1511742 13f79535-47bb-0310-9956-ffa450edef68
2013-08-08 12:28:01 +00:00
Adam Heath d950b6fb05 FEATURE: Allow constant numbers to be directly added to a query, instead
of having to deal with some kind of map/generic value.  This makes it
simpler to use full-text-search queries thru the entity
engine(postgresql and oracle).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1497893 13f79535-47bb-0310-9956-ffa450edef68
2013-06-28 19:08:39 +00:00
Adam Heath 8a497262d9 FIX: If using <extend-entity> to change the type of a pre-existing
field, then we need to be certain to remove the existing defined field
from the list of available fields.  Otherwise, you'll end up with the
same field being queried in SELECT, and the same field being updated in
INSERT or UPDATE.

This issue was discovered when changing the type of a pre-existing
field(so that the length of the field could be increased).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1497889 13f79535-47bb-0310-9956-ffa450edef68
2013-06-28 19:08:09 +00:00
Adrian Crum c60b808b92 Reverting rev 1486552:
https://issues.apache.org/jira/browse/OFBIZ-5214


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1491170 13f79535-47bb-0310-9956-ffa450edef68
2013-06-09 10:04:15 +00:00
Adrian Crum c1c2028fd4 Fixed a thread deadlock issue that seems to be specific to loading the MS SQL JDBC driver.
https://issues.apache.org/jira/browse/OFBIZ-5216


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1491165 13f79535-47bb-0310-9956-ffa450edef68
2013-06-09 09:24:49 +00:00
Adrian Crum 06ec6b5eaf Removed some code I introduced in recent commits where I was hoping to support reloading the entityengine.xml file in a controlled manor, but it seems to be causing thread deadlocks.
https://issues.apache.org/jira/browse/OFBIZ-5216


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490965 13f79535-47bb-0310-9956-ffa450edef68
2013-06-08 11:55:12 +00:00
Adrian Crum 91949082c1 Cleaned up the auto-generated code in the entity config models.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490940 13f79535-47bb-0310-9956-ffa450edef68
2013-06-08 10:00:45 +00:00
Adrian Crum 18b5135a31 Third pass at removing cached DOM tree code from EntityConfigUtil.java. I converted some of the code to use the new thread-safe models.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490938 13f79535-47bb-0310-9956-ffa450edef68
2013-06-08 09:34:47 +00:00
Adrian Crum 964a1d956d Second pass at removing cached DOM tree code from EntityConfigUtil.java. I converted some of the code to use the new thread-safe models.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490678 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 15:18:27 +00:00
Adrian Crum 7b84188235 First pass at removing cached DOM tree code from EntityConfigUtil.java. I converted some of the code to use the new thread-safe models. I also fixed some concurrency problems in related classes by replacing DCL with java.util.concurrent classes. I discovered the new multi-threaded component loader was creating duplicate resources, so these changes fix that.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490541 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 08:39:44 +00:00
Adrian Crum a2622d1d37 Improved entityengine.xml models:
1. Added file name and line number to validation code so exceptions can show where things went wrong.
2. Convert some attributes to primitive types.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490535 13f79535-47bb-0310-9956-ffa450edef68
2013-06-07 08:21:22 +00:00
Adrian Crum 767deefce4 New models for the entityengine.xml file. These will be used to replace the DOM caching/parsing code in the same way as the service engine.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1490187 13f79535-47bb-0310-9956-ffa450edef68
2013-06-06 08:02:14 +00:00