Notes |
|
(0069937)
|
shankarb
|
2014-09-03 10:59
|
|
Issue not reproducible in Oracle version 11.2.0.2.0 using Ubuntu. Attached a video of the same. |
|
|
|
It is not reproducible using the default bbdd.sessionConfig value (ALTER SESSION SET NLS_DATE_FORMAT='DD-MM-YYYY' NLS_NUMERIC_CHARACTERS='.,') |
|
|
(0071311)
|
hgbot
|
2014-10-31 14:44
|
|
Repository: erp/devel/pi
Changeset: 32ef96c592a4573f46d5b9549de349733ccf4e6d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Oct 31 14:42:52 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/32ef96c592a4573f46d5b9549de349733ccf4e6d [^]
Fixes issue 27378:sessionConfig query is executed before calling ad_db_modified
The problem was the following:
- Before dbsourcemanager executed ad_db_modified to calculate the db_checksum, it did not exec, the sessionConfig query defined in Openbravo.properties was not executed
- When ad_db_modified is executed from the Module Management Console flow, the sessionConfig query has already been executed
Executing the sessionConfig query can modify the db_checksum generated. For instance, adding NLS_SORT='BINARY' to the sessionConfig query will modify the sorting of tables/columns/etc, and the db_checksum
will be modified.
To avoid this, the sessionConfig query should either be always or never executed before calling ad_db_modified. It is not easy to avoid executing it in the module management console flow, because it is aut
omatically executed when the connection is retrieved. It has been decided then to execute it always. Now the query is executed before ad_db_modified is executed in the DBSMOUtil.hasBeenmodified method, in
the DBSMOUtil.updateCRC method and in the postgresql and oracle database.postcreate scripts.
---
M src-db/database/build-create.xml
M src-db/database/lib/dbsourcemanager.jar
---
|
|
|
(0071312)
|
hgbot
|
2014-10-31 14:46
|
|
Repository: erp/devel/dbsm-main
Changeset: 32ac51156b100be46b20a76f63953eb2800684e3
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Oct 31 14:40:00 2014 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/32ac51156b100be46b20a76f63953eb2800684e3 [^]
Fixes issue 27378:sessionConfig query is executed before calling ad_db_modified
The problem was the following:
- Before dbsourcemanager executed ad_db_modified to calculate the db_checksum, it did not exec, the sessionConfig query defined in Openbravo.properties was not executed
- When ad_db_modified is executed from the Module Management Console flow, the sessionConfig query has already been executed
Executing the sessionConfig query can modify the db_checksum generated. For instance, adding NLS_SORT='BINARY' to the sessionConfig query will modify the sorting of tables/columns/etc, and the db_checksum will be modified.
To avoid this, the sessionConfig query should either be always or never executed before calling ad_db_modified. It is not easy to avoid executing it in the module management console flow, because it is automatically executed when the connection is retrieved. It has been decided then to execute it always. Now the query is executed before ad_db_modified is executed in the DBSMOUtil.hasBeenmodified method, in the DBSMOUtil.updateCRC method and in the postgresql and oracle database.postcreate scripts.
---
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
|
|
|
|
Tested in postgresql and oracle |
|
|
|
Test plan:
1- Set this value in the bbdd.sessionConfig parameter: alter session set NLS_DATE_FORMAT='DD-MM-YYYY' NLS_SORT='BINARY' NLS_NUMERIC_CHARACTERS='.,'
2- Execute ant install.source
3- When it finishes, execute this on the database:
* alter session set NLS_DATE_FORMAT='DD-MM-YYYY' NLS_SORT='BINARY' NLS_NUMERIC_CHARACTERS='.,'
* select ad_db_modified('N') from dual;
(Those commands are executed in that order when adding a module using the Module Management Console) The response should be 'N'
4- Execute update.database. Repeat step 3, the result should be the same.
5- Try installing a module using the module management console (i.e. the Hello World module). Database local changes should not be detected. |
|
|
|
Reopened, because it is causing an exception when running export.database:
[exportdatabase] Error while executing the sessionConfig query
[exportdatabase] java.io.FileNotFoundException: /home/openbravo/workspaces/src/pi-bugfixing/../../config/Openbravo.properties (No such file or directory)
[exportdatabase] at java.io.FileInputStream.open(Native Method)
[exportdatabase] at java.io.FileInputStream.<init>(FileInputStream.java:140)
[exportdatabase] at java.io.FileInputStream.<init>(FileInputStream.java:96)
[exportdatabase] at org.openbravo.ddlutils.util.DBSMOBUtil.executeSessionConfigQuery(DBSMOBUtil.java:1168)
[exportdatabase] at org.openbravo.ddlutils.util.DBSMOBUtil.updateCRC(DBSMOBUtil.java:588)
[exportdatabase] at org.openbravo.ddlutils.task.ExportDatabase.execute(ExportDatabase.java:272)
[exportdatabase] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[exportdatabase] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
... |
|
|
(0071372)
|
hgbot
|
2014-11-03 16:44
|
|
Repository: erp/devel/dbsm-main
Changeset: b55aa7117d468268b7a3b3b46a4e3b0eaaa086e6
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Nov 03 16:42:26 2014 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/b55aa7117d468268b7a3b3b46a4e3b0eaaa086e6 [^]
Fixes issue 27378: Obtains properly path to Openbravo.properties
The Openbravo.properties file was not being properly obtained when executing the export.database task. When the update.database task was run the workingDir was openbravoRoot/src-db/database, but when export.database is run the workingDir is just openbravoRoot.
Now the executeSessionConfigQuery method checks for both paths in order to retrieve the Openbravo.properties file. This problem could have been solved by passing the sessionConfig paramater to the update.database and export.database tasks, but it has been preferred not to modify the build.xml file, as that would disallow using that file with a previous version of dbsourcemanager.
---
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
|
|
|
(0071373)
|
hgbot
|
2014-11-03 16:45
|
|
Repository: erp/devel/pi
Changeset: a274c96e27ad7289c81e5a59508f7ec98224dd42
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Nov 03 16:44:16 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a274c96e27ad7289c81e5a59508f7ec98224dd42 [^]
Fixes issue 27378: Obtains properly path to Openbravo.properties
The Openbravo.properties file was not being properly obtained when executing the export.database task. When the update.database task was run the workingDir was openbravoRoot/src-db/database, but when expor
t.database is run the workingDir is just openbravoRoot.
Now the executeSessionConfigQuery method checks for both paths in order to retrieve the Openbravo.properties file. This problem could have been solved by passing the sessionConfig paramater to the update.d
atabase and export.database tasks, but it has been preferred not to modify the build.xml file, as that would disallow using that file with a previous version of dbsourcemanager.
---
M src-db/database/lib/dbsourcemanager.jar
---
|
|
|
|
Reopened because the alter session statement is being executed on a pooled connection (dbcp is used to retrieve it).
It would be better to use an unpooled connection to ensure that the alter session query only affects the query to ad_db_modified. |
|
|
(0071492)
|
hgbot
|
2014-11-07 11:40
|
|
Repository: erp/devel/pi
Changeset: 8c34cbb6b4adab030bd7e8c9cf7da00646b54ab2
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Nov 07 11:37:03 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8c34cbb6b4adab030bd7e8c9cf7da00646b54ab2 [^]
Fixes issue 27378: Execute the alter session statement in unpooled connection
It is better to execute the alter session query in an unpooled connection, to ensure that the only query affected by it is the call to ad_db_modified. Now the connection used to execute ad_db_modified is retrieved through DriverManager.getConnection.
---
M src-db/database/lib/dbsourcemanager.jar
---
|
|
|
|
code reviewed.
Tested in PG and ORA. ORA with different values for NLS_SORT param |
|
|
|
|
|
|
|
|
|
|
|
(0073783)
|
hgbot
|
2015-01-26 16:26
|
|
Repository: erp/devel/dbsm-main
Changeset: cd8048353155e9f34751f8783e0a4784e99018fb
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Nov 07 11:30:58 2014 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/cd8048353155e9f34751f8783e0a4784e99018fb [^]
Fixes issue 27378: Execute the alter session statement in unpooled connection
It is better to execute the alter session query in an unpooled connection, to ensure that the only query affected by it is the call to ad_db_modified. Now the connection used to execute ad_db_modified is retrieved through DriverManager.getConnection.
---
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
|
|
|
|
This issue was automatically reopened again after pushing the changeset that fixed it to the dbsourcemanager repo |
|