Commit Graph
1462 Commits
Author SHA1 Message Date
Jacopo Cappellato 32f4e6bc9c Improved: made the entity delegator test less noisy by disabling the error log
level during the execution of these tests.

Thanks: Jacques Le Roux for requesting the improvement.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763453 13f79535-47bb-0310-9956-ffa450edef68
2016-10-05 14:00:46 +00:00
Jacques Le Roux b551796ad3 Improves: too much warning "Could not get a system property for..." in log
This should not be a warning but an info. Also I wonder if we really need to 
show all these, after all a default fallback should exist in a properties file

Still OFBIZ-7754 needs to be solved...


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763103 13f79535-47bb-0310-9956-ffa450edef68
2016-10-02 21:45:21 +00:00
Taher A. Alkhateeb b8dc04f281 Fixed: Adjusting access to static resources statically in entity unit tests
Minor fix in the preparation of resources to be used in unit tests to be
accessed statically instead of dynamically.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762349 13f79535-47bb-0310-9956-ffa450edef68
2016-09-26 17:20:20 +00:00
Jacopo Cappellato 7370ea5409 Improved: added some missing license headers.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762238 13f79535-47bb-0310-9956-ffa450edef68
2016-09-25 21:25:02 +00:00
Jacopo Cappellato b84345831b Improved: cleanups and enhancements in the FreeMarkerWorker class, and client
code using it, that wraps most of the OFBiz integration with FreeMarker.

This is the list of the main modifications:
* simplified and cleaned up the public methods of FreeMarkerWorker, used to 
retrieve and render Freemarker templates and changed client code accordingly to 
use them
* removed unused methods in FreeMarkerWorker and made some others private
* improved the integration code in FreeMarkerWorker to better use the Freemarker 
API and specifically to leverage the various TemplateLoaders and the Freemarker 
caching mechanism; it is now possible to switch the OFBiz legacy template 
caching mechanism to use the Freemarker one instead
* improved the implementation of Freemarker template rendering from strings 
(used by DataResourceWorker): it now leverages the Freemarker's 
StringTemplateLoader that provides the ability to cache the strings, retrieved 
from DataResources records, based on the timestamp of the last modification
* moved freemarkerImports.properties from "widget" to "base" component, and 
changed its content (and the content of the associated templates 
AutoImportTemplate.ftl and HtmlTemplate.ftl) to remove the dependency from base 
to widget&common; some resources of "widget" and "common" are still referenced 
from AutoImportTemplate.ftl (that is in "base") but even if they are soft 
dependencies: if they are missing the system will load properly without any 
error or warning; before this change it was impossible to use, or unit test, 
FreeMarkerWorker before the "widget" and "common" components were loaded by the 
system, now it is possible
* created a new class for unit tests for FreeMarkerWorker, named 
FreeMarkerWorkerTests: at the moment it contains just one simple unit test but 
more should be implemented
* refactored WebToolsServices.entityImport(...) to leverage the 
FreeMarkerWorker.renderTemplate(...) method to run the Freemarker template, 
rather than dealing with the Freemarker API directly; this is now possible 
thanks to the cleanups and improvements done in the FreeMarkerWorker class; this 
same approach should be implemented for a few other similar integration points 
(mostly in the "content" component); this is a TODO item
* moved the encodeDoubleQuotes(...) method from FreeMarkerWorker to 
MacroFormRenderer and made it private since this is the only calss using it and 
its logic is not related to FreeMarker



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762227 13f79535-47bb-0310-9956-ffa450edef68
2016-09-25 17:20:58 +00:00
Jacopo Cappellato 27c7baaa26 Improved: made several fields and methods of EntitySaxReader private.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762080 13f79535-47bb-0310-9956-ffa450edef68
2016-09-23 18:52:40 +00:00
Jacopo Cappellato 6f8da4c08d Implemented: converted EntitySaxReader to use the default Sax reader instead
of the legacy implementation from Javolution; removed a bunch of unused or 
deprecated methods; created some unit tests to test the EntitySaxReader in 
isolation. Removed the dependency from Javolution since this was the last class 
dependent on it.
(OFBIZ-5169)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762079 13f79535-47bb-0310-9956-ffa450edef68
2016-09-23 18:23:23 +00:00
Arun Patidar 6448c86d2b Fixed: XML parsing error caused with commit r1761175. Moved service-resource entry after entity resource in ofbiz-component file.
Thanks: Jacopo Cappellato for reporting issue.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761529 13f79535-47bb-0310-9956-ffa450edef68
2016-09-20 06:50:47 +00:00
Jacopo Cappellato 0798e39fca Implemented: unit tests for some mechanisms to create delegator objects and for
the initialization of the ControlFilter.

These unit tests are experimental but interesting because they provide test 
coverage in isolation for some aspect of the framework that were not covered 
before or only covered by integration tests.
The tests for the ControlFilter are particularly interesting because they 
leverage Mockito to run the test in isolation by mocking the FilterConfig 
object.
Please review and run these tests in your local environment, provide your 
feedback and report any issues you may find: this will help to define a pattern 
for the definition of unit tests that could be applied more extensively.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761440 13f79535-47bb-0310-9956-ffa450edef68
2016-09-19 13:36:32 +00:00
Arun Patidar 1b814bd613 Implemented: Added CRUD services for EmplPositionClassType, ConfigOptionProductOption and Component entity.
(OFBIZ-8049) (OFBIZ-8058)(OFBIZ-8059)

Thanks: Amit Gadaley for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761175 13f79535-47bb-0310-9956-ffa450edef68
2016-09-17 10:10:15 +00:00
Jacques Le Roux dc7c438e9a Improves: Use try-with-resources statement wherever it's possible
(OFBIZ-8202)

These are a non functional changes for the accounting component
I forgot to commit the change in EntityListIterator.java, hence a lot of confusion, sorry guys

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761047 13f79535-47bb-0310-9956-ffa450edef68
2016-09-16 15:15:34 +00:00
Jacques Le Roux d642114ff7 Fixes: reverts r1760566, unfortunately in this commit I did not see that not only the ToirtoiseSvn was removed but also other pending changes where ticked (I did not, thanks ToirtoiseSvn to make me show silly :/)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760567 13f79535-47bb-0310-9956-ffa450edef68
2016-09-13 16:07:50 +00:00
Jacques Le Roux 47761c3f62 Completes: (no functionnal change) remove the ToirtoiseSvn template to avoid confusion for other possible users of ToirtoiseSvn. I keep my local change, not a bid deal, to be revisited...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760566 13f79535-47bb-0310-9956-ffa450edef68
2016-09-13 16:02:31 +00:00
Jacopo Cappellato 66554a45a5 Improved: Removed the "geronimo" component and moved GeronimoTransactionFactory into the "entity" component.
(OFBIZ-8179)

Without functional changes, this design removes a cyclic dependency between the "entity" and "geronimo" components.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760376 13f79535-47bb-0310-9956-ffa450edef68
2016-09-12 14:09:00 +00:00
Jacopo Cappellato 8150cf2e2d Throw an exception rather than failing with a NPE if delegatorInfo is null: this can happen for example when the entityconfig.xml file is missing.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759372 13f79535-47bb-0310-9956-ffa450edef68
2016-09-06 07:18:01 +00:00
Jacopo Cappellato 4cbedfc518 Improved error message logged by DelegatorFactoryImpl.getInstance(...) when a delegator can't be created; added a TODO comment to remind that the code should be refactored to throw the exception instead.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759371 13f79535-47bb-0310-9956-ffa450edef68
2016-09-06 07:15:21 +00:00
Jacopo Cappellato 8fdaa37885 Fixed wrong module name in the DelegatorFactory class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759370 13f79535-47bb-0310-9956-ffa450edef68
2016-09-06 07:12:28 +00:00
Shi Jinghai 5981061dcf OFBIZ-8137 Entityname starts with schema name causes error in PostgreSQL
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759155 13f79535-47bb-0310-9956-ffa450edef68
2016-09-04 08:57:44 +00:00
Jacques Le Roux 4dd6a0475b Fixes "a bunch of small leaks (closes missing, reported as warnings in Eclipse)" - https://issues.apache.org/jira/browse/OFBIZ-8115
No functional changes, simply use the try-with-resources statement everywhere it's possible, mostly to clean the finally statements and have consistent code

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759088 13f79535-47bb-0310-9956-ffa450edef68
2016-09-03 12:49:47 +00:00
Jacques Le Roux 38e9885d3d Fixes "a bunch of small leaks (closes missing, reported as warnings in Eclipse)" - https://issues.apache.org/jira/browse/OFBIZ-8115
At r1758927 I tried to fixe a bunch of closes missing, reported as warnings in Eclipse

Jacopo noticed and reported on dev ML http://markmail.org/message/b4hvzi7foftfq3j5 2 possible issues:
1) you are adding a close statement to code that already had the close statement in the "finally" block; your modification actually introduces a code pattern that is not correct (if an exception is thrown your close statement are not executed)
2) I suspect that you are closing the socket connection too early in PcChargeApi

1)The best option when closing resources (which implement AutoCloseable) is actually to use the try-with-resources statement. At least when there are no performance issues.
I have fixed the issue (only in DatabaseUtil.java) this way because
* there are not performance issues, we anyway create a Statement in both cases, we don't reuse one.
* The finally part is cleaner

I have also used the try-with-resources statement in other places where it fitted.

There is only 1 place where I was undecided: ScriptUtil.parseScript() which uses GroovyUtil.parseClass().
I put only a logError() there and returned null. 
I did not throw an IOException because else it spreads everywhere in FlexibleStringExpander.
Here introducing Optional would be better, but I have no time or that today.

2) was not a problem


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758951 13f79535-47bb-0310-9956-ffa450edef68
2016-09-02 13:18:35 +00:00
Jacques Le Roux 8bf34869da Reverts r1758927 to check issues reported by Jacopo on dev ML
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758935 13f79535-47bb-0310-9956-ffa450edef68
2016-09-02 10:47:30 +00:00
Jacques Le Roux 6636d4ae01 Fixes "a bunch of small leaks (closes missing, reported as warnings in Eclipse)" - https://issues.apache.org/jira/browse/OFBIZ-8115
Fixes a bunch of small leaks (closes missing, only warnings in Eclipse)
By-product: automatically sort few imports

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758927 13f79535-47bb-0310-9956-ffa450edef68
2016-09-02 10:07:31 +00:00
Arun Patidar 3e7e7db27b Applied patch from jira issue - OFBIZ-7911 - Enforce noninstantiability to TransactionUtil class. Thanks Rishi Solanki and Pratik Kulshreshth for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1757962 13f79535-47bb-0310-9956-ffa450edef68
2016-08-27 07:56:48 +00:00
Jacques Le Roux 19010d1ae9 No functional changes, simply updates the documentation: deprecated wiki links
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1756335 13f79535-47bb-0310-9956-ffa450edef68
2016-08-14 21:46:21 +00:00
Jacques Le Roux b4cf32a0de No functional changes, simply update the documentation with respect to Gradle changes - OFBIZ-7677
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1756334 13f79535-47bb-0310-9956-ffa450edef68
2016-08-14 21:45:22 +00:00
Jacques Le Roux ef7996c983 Fixes "Remove warnings regarding missing component lib folders" - https://issues.apache.org/jira/browse/OFBIZ-7776 - by cleaning/clearing the references to non existent/empty dirs.
Notes: 
* Also removes empty framework/base/lib/scripting and useless applications\content\lib\uno\README (miss doc in wiki)
* When jpim-0.1.jar will be (hopefully) replaced we can drop lib ref in framework/base/ofbiz-component.xml
* I wonder if we should let the geronimo component alone with only 2 classes, could we not put that in entity or entityext?
 
    



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1755306 13f79535-47bb-0310-9956-ffa450edef68
2016-08-05 12:27:21 +00:00
Deepak Dixit 834691742b (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Taher A. Alkhateeb b37ef2d280 Migrate ALL java files from /src to /src/main/java - OFBIZ-7790
This is the first of two steps in the above mentioned JIRA. This
first step changes the java source directory for every component
from /src to /src/main/java. The next step will be adding unit
tests to every component in /src/test/java

Thank you to Deepak Dixit for tips on how to use the SVN commands
to make the appropriate file moving.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752838 13f79535-47bb-0310-9956-ffa450edef68
2016-07-15 14:17:14 +00:00
Taher A. Alkhateeb 4d2b415a91 Another major patch for OFBIZ-7534 replacing Ant with Gradle
This is the first patch that takes OFBiz to the point of no return
in terms of switching from Ant to Gradle build system. Specifically
this patch applies the following items:

- Delete all old Ant and Maven build scripts
- Delete 169 Jar libraries and replace them with remote ones in the
  gradle build script
- update the gradle build scripts for the dependencies and other minor
  changes needed for the script work correctly

All tests pass with the command ./gradlew cleanAll loadDefault testIntegration

Again, thank you for everyone who contributed valueble time and effort in this
process.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752033 13f79535-47bb-0310-9956-ffa450edef68
2016-07-09 18:10:19 +00:00
Jacopo Cappellato e0da901504 OFBIZ-7760 Removed from UtilCache the ability to persist entries in the file system.
This feature has been contributed a long time ago as an experimental feature but never really matured into a production ready artifact: since it was contributed, no users asked about how to use it, or tested it, or reported bugs or enhancement requests.
More importantly, the feature has always been disabled in the OFBiz framework (i.e. the widget code and the entity engine code were not using it).
This removal should not impact our user base; however, after the removal, an entry to the Attic will be created to keep track of it and to make it easier, to interested users, to get this code, improve it (e.g. by making it dependent on a live external jar, for example MapDB instead of JDBM) and possibly contribute it back to the project.
The most compelling reason for its removal is that the feature was based on a snapshot, unreleased version of JDBM, which is now a mostly dead project: for licensing reasons we are no more allowed to bundle jars in our releases. Additionally, having code that relies an old jar from a no more active project represents a maintenance issue for the community.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751817 13f79535-47bb-0310-9956-ffa450edef68
2016-07-07 17:00:05 +00:00
Nicolas Malin fa265a8460 no functionnal change, fix formating if
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751670 13f79535-47bb-0310-9956-ffa450edef68
2016-07-06 12:21:04 +00:00
Nicolas Malin 5bb21306a6 no functionnal change, remove space end line
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751667 13f79535-47bb-0310-9956-ffa450edef68
2016-07-06 12:18:32 +00:00
Nicolas Malin 55660a9859 no functionnal change, remove space end line
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751660 13f79535-47bb-0310-9956-ffa450edef68
2016-07-06 11:43:35 +00:00
Nicolas Malin 9e72d270f1 Add new process on entity-auto for create invocation to populate automatically the field changeUserLoginId and statusDate for EntityStatus. The purpose is track userlogin for status change, and apply on all entity that cover the EntityStatus concept. The origin issue has been raise by Nameet Jain on OFBIZ-7611
This improvement add a control to not update or delete an EntityStatus by entity-auto (for help developer) and complete unit test

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751530 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 19:06:52 +00:00
Arun Patidar 7d7fba2cd2 Applied patch from jira issue - OFBIZ-7717 - Enforce noninstantiability to EntityTypeUtil class. Thanks Rahul Singh Kushwah and Rishi Solanki for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751482 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 14:05:06 +00:00
Deepak Dixit dd05dbe7a3 (OFBIZ-7750) Applied patch jira issue.
===========================================
Error adding foreign key: ModelEntity was null for related entity name Tenant
===========================================

Thanks Nameet Jain for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751423 13f79535-47bb-0310-9956-ffa450edef68
2016-07-05 08:54:26 +00:00
Arun Patidar 002513ff7e Applied patch from jira issue - OFBIZ-7740 - Enforce noninstantiability to EntityUtilProperties class. Thanks Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751324 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 15:50:27 +00:00
Arun Patidar 9372e9a540 Applied patch from jira issue - OFBIZ-7733 - Enforce noninstantiability to EntityUtil class. Thanks Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751306 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 15:06:34 +00:00
Arun Patidar 74afcc004d Applied patch from jira issue - OFBIZ-7710 - Enforce noninstantiability to EntityFinderUtil class. Thanks Rishi Solanki and Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751305 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 15:04:00 +00:00
Arun Patidar 1316f3e26f Applied patch from jira issue - OFBIZ-7732 - Enforce noninstantiability to ModelUtil class. Thanks Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751298 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 14:47:30 +00:00
Arun Patidar c25b45ab1a Applied patch from jira issue - OFBIZ-7715 - Enforce noninstantiability to SqlJdbcUtil class. Thanks Rishi solanki and Rohit Koushal for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1751296 13f79535-47bb-0310-9956-ffa450edef68
2016-07-04 14:36:44 +00:00
Jacques Le Roux 6e54fba04e A last slightly modified patch from James Yong for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
I have uploaded a patch for the simple methods schema.
In general, the top level attributes are converted to simpleType, and attributeGroups to complexType.

Changed the following attribute name
1. ‘field’ to ‘fieldType’
2. ‘level’ to ‘levelType'

Denormalize the following attributeGroups
1. attlist.compare
2. attlist.compare-field

Left attributeGroup ‘typeDefaultString’ unchanged, cos it doesn’t matter. Not in use, it seem.

jleroux: we also fixed an issue with 
<xs:element name="field" type="fieldType"/> 
to 
<xs:element ref="field"/>
In the patch 

And I found a small issue (not minilang related) in ExampleCompoundWidgets.xml
-            <sm:log message="CompoundWidgetsFunc runs" sm:level="info"/>
+            <sm:log message="CompoundWidgetsFunc runs" level="info"/>


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750647 13f79535-47bb-0310-9956-ffa450edef68
2016-06-29 14:06:29 +00:00
Jacques Le Roux 642f42886e A temporary workaround for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
Reverts the simple method to use the original schema without namespace. "Duplicates" simple-methods.xsd in simple-methods-ns.xsd as we did, to get the simple-method namespace for compound-widgets.

For myself: when we will do the 3rd more elegant option (no schema duplication), have been changed also:
minilang-catalog.xml
compound-widgets.xsd


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749938 13f79535-47bb-0310-9956-ffa450edef68
2016-06-23 16:40:22 +00:00
Jacques Le Roux c8ba932772 Fixes a "typo" in last commit for "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
We used targetNamespace (should only be used in schema) instead of xsi:schemaLocation



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749634 13f79535-47bb-0310-9956-ffa450edef68
2016-06-22 05:58:26 +00:00
Jacques Le Roux 89212904bd Completes and finish "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061
This is the 2nd step: puts back the original names, so it will be transparent for remaining references in xml catalogs, Java code, etc.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749489 13f79535-47bb-0310-9956-ffa450edef68
2016-06-21 11:37:47 +00:00
Jacques Le Roux 4931db1ed9 Completes and finish "Autocompletion for Compound Widget" - https://issues.apache.org/jira/browse/OFBIZ-7061 by replacing xsd files references in xml files by -ns.xsd files and removing the concerned xsd files
This is a 1st step, in a 2nd I will put back the original names, so it will be transparent for remaining reference in xml catalogs, Java code, etc.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749488 13f79535-47bb-0310-9956-ffa450edef68
2016-06-21 11:14:16 +00:00
Jacques Le Roux 11b4e86332 A patch from Gareth Carter for "connection pooling not working" https://issues.apache.org/jira/browse/OFBIZ-7346
Connection pooling does not seem to work. Connections are created fine but as the close() method is called (outside of transaction) or the transaction is committed the connections are closed to the db server and not returned to the pool.

I believe the issue is with org.apache.commons.dbcp2.PoolableConnectionFactory passivateObject method. This will call rollback() when rollbackOnReturn is set to true even if the transaction is committed. This is because any connection wrappers extending org.apache.commons.dbcp2.DelegatingConnection cache autoCommit status. At some point, this cached autoCommit is different from the underlying connection autoCommit. The rollback() method will throw an exception and the connection is destroyed rather than put back to the pool

Environment this has been tested on:
ofbiz: rev 1725574 and latest trunk (as of 2016-06-14)
db: postgresql 9.1
jdbc driver: postgresql-9.3-1101.jdbc4
os: linux and windows

jleroux: this issue doest not exist with Derby, it's a matter of driver (DBMS actually) see Derby vs Postgres

    https://db.apache.org/derby/docs/10.9/devguide/cdevconcepts29416.html
    https://www.postgresql.org/docs/9.1/static/ecpg-sql-set-autocommit.html

Another solution would be to force Postgres to autocommit but I'd not do that, better not change this DBMS dependent behaviour.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748837 13f79535-47bb-0310-9956-ffa450edef68
2016-06-17 11:51:13 +00:00
Jacques Le Roux 6eaa2239a6 Fixes "The Connection Pool Status feature in webtools is broken" - https://issues.apache.org/jira/browse/OFBIZ-7363
Completes the work I did in r1748689. Actually I worked on different editors and mixed things so not all was committed previously, here they are

Removes now useless commented out line about DebugManagedDataSource (// Useful to debug the usage of connections in the pool). I put more information in the class head while fixing the type warnings

Fixes other type warnings I missed previously

Eventually removes the old comment
        // Hmm... then how do we close the JDBC connections?
Because "we" don't close JDBC connections, DBPC takes care of that (or at least should, I did not check).


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748693 13f79535-47bb-0310-9956-ffa450edef68
2016-06-16 12:13:02 +00:00
Jacques Le Roux e0c49bb75f Fixes "The Connection Pool Status feature in webtools is broken" - https://issues.apache.org/jira/browse/OFBIZ-7363
The Connection Pool Status feature was introduced by OFBIZ-4864 hence 1st in R13.07 where it still work well (see demo), as the connection pooling. But has been broken since, with the pooling.
Fortunately, it's easy to fix and has no implications has long has you don't enable verbose logging (the DebugManagedDataSource only extends ManagedDataSource for verbose logging and to generate the info needed for the Connection Pool Status feature).

I fixed it by using directly the DebugManagedDataSource. It's not an issue as long as you don't set the logging level to verbose which is anyway not something you would do in production. In case you do so and don't want to be disturbed in the log (focusing on something else), it's still easy to comment out the line from DebugManagedDataSource. I also fixed some type warnings while at it.

I also removed this old comment
        // Hmm... then how do we close the JDBC connections?
Because "we" don't close JDBC connections, DBPC takes care of that (or at least should, I did not check).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748689 13f79535-47bb-0310-9956-ffa450edef68
2016-06-16 11:46:03 +00:00
Jacques Le Roux bd0b57613c A patch from Wai for "EntityUtilProperties" https://issues.apache.org/jira/browse/OFBIZ-7112
OFBiz reads properties from either a properties file or the entity:SystemProperty. The way it worked previously is that OFBiz reads from the entity:SystemProperty first and if there is no value associated with the target propertyname, it would then locate the value from the relevant properties file.
In other words, if there is a database entry for a property, the database entry should override the associated properties file.
The issue is that if a database entry exist but the value is empty, it would look for a value from the properties file.  It should not do so.  If a database entry exists for the propertyname of interest, the value should be taken from the database even if it holds an empty value.

"isExistInDb" is first defined in Map<String, String> getSystemPropertyValue(String, String, Delegator).  This method is call by many other methods.  "isExistInDb" is used to indicate whether the method is returning an empty value for the property that 'exists' in the database rather than as a result of an absent database entry for the property.

The other methods...
  boolean propertyValueEqualsIgnoreCase(String, String, String, Delegator)
  String getPropertyValue(String, String, String, Delegator)
  String getPropertyValue(String, String, Delegator) 
  String getMessage(String, String, Locale, Delegator)
uses the above method and needs to decide whether to use the empty value returned (ie. empty value from an existing property entry in database) or decide if it needs to read from the property file (ie. property entry does not exist in database)

jleroux: this also add systemPropertyValue data in CommonSystemPropertyData.xml

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1748560 13f79535-47bb-0310-9956-ffa450edef68
2016-06-15 11:23:54 +00:00