Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012901Openbravo ERPA. Platformpublic2010-04-07 14:272010-04-19 21:13
shuehner 
mtaal 
urgentmajorhave not tried
closedfixed 
5
pi 
 
Core
No
0012901: OBDal.getInstance().getConnection() does not setup dateFormat correctly
This function (compared) to the ones in DalConnectionProvider or ConnectionProviderImpl is missing the dateFormat setup code based on Openbravo.properties which means handling of dates (in the dbms) is different from the rest of the application when using this connection.

Indirectly found in the testcase for issue 12106 as using CalledStoredProcedure for ad_column_identifier involving a date returned a different output from the expected one.
run IssuesTest.test12106 on oracle and notice it failing
Move dateFormat setup code from DalConnectionProvider to obdal.getconnection() as the latter one is already used by the former.

Ideally: test direct and indirect callers (modules) For regressions regarding date handling (i.e. CallProcess,CallStoredProcedure)
No tags attached.
related to defect 0012106 closed mtaal record identifier returned from dal uses ' ' as separator of columns, but normal pl-version uses ' - ' 
Issue History
2010-04-07 14:27shuehnerNew Issue
2010-04-07 14:27shuehnerAssigned To => mtaal
2010-04-07 14:27shuehnerRelationship addedrelated to 0012106
2010-04-07 14:30shuehnerNote Added: 0025941
2010-04-07 14:33shuehnerNote Added: 0025942
2010-04-07 23:08mtaalNote Added: 0025963
2010-04-07 23:08mtaalNote Added: 0025964
2010-04-08 09:35hgbotCheckin
2010-04-08 09:35hgbotNote Added: 0025967
2010-04-08 09:35hgbotStatusnew => resolved
2010-04-08 09:35hgbotResolutionopen => fixed
2010-04-08 09:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8e0cb4346d509574818d830340d424d74c74cfd0 [^]
2010-04-08 11:47mtaalNote Added: 0025971
2010-04-08 11:47mtaalStatusresolved => new
2010-04-08 11:47mtaalResolutionfixed => open
2010-04-09 20:28shuehnerStatusnew => scheduled
2010-04-09 20:28shuehnerfix_in_branch => pi
2010-04-09 21:00hgbotCheckin
2010-04-09 21:00hgbotNote Added: 0026049
2010-04-09 21:00hgbotStatusscheduled => resolved
2010-04-09 21:00hgbotResolutionopen => fixed
2010-04-09 21:00hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/8e0cb4346d509574818d830340d424d74c74cfd0 [^] => http://code.openbravo.com/erp/devel/pi/rev/253f727de17ee37af873599fdb757d468228081a [^]
2010-04-12 18:44shuehnerNote Added: 0026079
2010-04-12 18:44shuehnerStatusresolved => closed
2010-04-13 00:00anonymoussf_bug_id0 => 2986154
2010-04-19 21:12hudsonbotCheckin
2010-04-19 21:12hudsonbotNote Added: 0026434
2010-04-19 21:13hudsonbotCheckin
2010-04-19 21:13hudsonbotNote Added: 0026449

Notes
(0025941)
shuehner   
2010-04-07 14:30   
A testcase calling ad_column_identifier via xsql (or using a BaseTest.getConnectionProvider connection) and one calling it via dal for c_invoice would be fine to assure the same date-formatting in the future. This could perhaps be added to the test12106 as a third comparison.
(0025942)
shuehner   
2010-04-07 14:33   
Note: after fixing this issue the test12106 testcase should have its assert enabled, and should succeed.
(0025963)
mtaal   
2010-04-07 23:08   
Yes agree that adding an xsql would be nice. If you can provide a valid xsql then I am interested to try it out, for the rest I am fine with the current test.

gr. Martin
(0025964)
mtaal   
2010-04-07 23:08   
Will commit a change in a few minutes, all testcases pass with this change.

gr. Martin
(0025967)
hgbot   
2010-04-08 09:35   
Repository: erp/devel/pi
Changeset: 8e0cb4346d509574818d830340d424d74c74cfd0
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Apr 08 09:47:11 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/8e0cb4346d509574818d830340d424d74c74cfd0 [^]

fixes issue 12901: OBDal.getInstance().getConnection() does not setup dateFormat correctly

---
M src/org/openbravo/dal/service/OBDal.java
M src/org/openbravo/service/db/DalConnectionProvider.java
---
(0025971)
mtaal   
2010-04-08 11:47   
After some more discussion it seems better to move the date formatting sql call one level deeper to where the session is created.
(0026049)
hgbot   
2010-04-09 21:00   
Repository: erp/devel/pi
Changeset: 253f727de17ee37af873599fdb757d468228081a
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Fri Apr 09 21:12:35 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/253f727de17ee37af873599fdb757d468228081a [^]

fixes issue 12901: OBDal.getInstance().getConnection() does not setup dateFormat correctly

---
M src/org/openbravo/dal/core/DalSessionFactory.java
M src/org/openbravo/dal/service/OBDal.java
---
(0026079)
shuehner   
2010-04-12 18:44   
Tested in pi on pgsql+oracle via executing IssuesTest.test12106 junit-testcase to verify that now the dateFormat setup is identical for xsql-connections and dal-connections.

Note: This issue now setups the dateFormat properly for all connections in openbravo which was not done before completely for the dal part.

This only affects sql-code when run from a dal-context, like i.e. sql-functions in a hql-query (not a normal use-case), the use of CallProcess and CallStoredProcedure. For the first no existing user is known for the last two all published modules where search for its use and exemplary the MassInvoicing was checked in this regards: no issues were found.

So far the only notice of this defect at all was a failing test-case.

General risk estimation from platform-team: low to none
(0026434)
hudsonbot   
2010-04-19 21:12   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/8e0cb4346d50 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/91d98bda46c1 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17088.obx [^]
(0026449)
hudsonbot   
2010-04-19 21:13   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/253f727de17e [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/91d98bda46c1 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17088.obx [^]