Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037681Openbravo ERPA. Platformpublic2018-01-19 10:272018-03-02 21:18
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
3.0PR18Q2 
caristu
Core
No
0037681: No need to create the ad_context_info table if audit trail is not active, remove Update Audit Trail Infrastructure.
The ad_context_info table is used by the audit trail triggers to retrieve the user id, process type and process id related with each captured change.

If the option to activate audit trail without recompiling and restarting tomcat is removed, then it would be possible to create the ad_context_info table only if audit trail was active when Tomcat was started. This would make the connection creation lighter.
-
1 - Remove the Update Audit Trail Infrastructure process, so that users have to rebuild Openbravo and restore Tomcat in order to create the Audit Trail triggers
2 - Do not create the ad_context_info temporary table if there were no audited tables when Tomcat was started.
Performance
related to defect 0037677 closed AugustoMauch No need to check if ad_context_info table exists before creating it 
related to defect 0037818 closed AugustoMauch API Change: UpdateAuditTrail process has been removed 
Issue History
2018-01-19 10:27AugustoMauchNew Issue
2018-01-19 10:27AugustoMauchAssigned To => AugustoMauch
2018-01-19 10:27AugustoMauchModules => Core
2018-01-19 10:27AugustoMauchTriggers an Emergency Pack => No
2018-01-19 10:28AugustoMauchRelationship addedrelated to 0037677
2018-01-29 10:30alostaleTag Attached: Performance
2018-02-01 13:14hgbotCheckin
2018-02-01 13:14hgbotNote Added: 0102117
2018-02-01 13:14hgbotStatusnew => resolved
2018-02-01 13:14hgbotResolutionopen => fixed
2018-02-01 13:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b42f32f0e0e9093fe8a9b7ba99eba0b2bbdc2a7e [^]
2018-02-01 13:14AugustoMauchReview Assigned To => caristu
2018-02-02 10:01AugustoMauchRelationship addedrelated to 0037818
2018-02-02 10:35AugustoMauchNote Added: 0102148
2018-02-12 17:17caristuNote Added: 0102339
2018-02-12 17:17caristuStatusresolved => new
2018-02-12 17:17caristuResolutionfixed => open
2018-02-12 17:17caristuNote Edited: 0102339bug_revision_view_page.php?bugnote_id=0102339#r16674
2018-02-14 10:40hgbotCheckin
2018-02-14 10:40hgbotNote Added: 0102393
2018-02-14 10:40hgbotCheckin
2018-02-14 10:40hgbotNote Added: 0102394
2018-02-14 10:40hgbotCheckin
2018-02-14 10:40hgbotNote Added: 0102395
2018-02-14 10:40hgbotStatusnew => resolved
2018-02-14 10:40hgbotResolutionopen => fixed
2018-02-14 10:40hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/b42f32f0e0e9093fe8a9b7ba99eba0b2bbdc2a7e [^] => http://code.openbravo.com/erp/devel/pi/rev/d0a6cc5b94d57859c9d80bb03bc43f71ce8ec94a [^]
2018-02-22 18:18hudsonbotCheckin
2018-02-22 18:18hudsonbotNote Added: 0102706
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102755
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102756
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102757
2018-02-28 19:57caristuNote Added: 0102880
2018-02-28 19:57caristuStatusresolved => closed
2018-02-28 19:57caristuFixed in Version => 3.0PR18Q2
2018-03-01 11:34hgbotCheckin
2018-03-01 11:34hgbotNote Added: 0102902
2018-03-02 21:18hudsonbotCheckin
2018-03-02 21:18hudsonbotNote Added: 0102961

Notes
(0102117)
hgbot   
2018-02-01 13:14   
Repository: erp/devel/pi
Changeset: b42f32f0e0e9093fe8a9b7ba99eba0b2bbdc2a7e
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Jan 19 13:42:17 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b42f32f0e0e9093fe8a9b7ba99eba0b2bbdc2a7e [^]

Fixes issue 37681: Dont create ad_context_info if audit trail not active

Records are only read/written from the ad_context_info if audit trail is enabled (if any ad_table is fully audited). If audit trail is disabled when
Tomcat is started, there is no need to create the ad_context_info table each time that a new connection is created. From now on it will no be possible
to enable the audit trail while Tomcat is active, enabling it will require to rebuild Openbravo and to restart Tomcat. Now:
- The Update Audit Trail Infrastructure has been removed
- When a new table is set to be audited in the AD, SessionInfo.setAuditTrailActive(true) will not be invoked, so that the isAuditTrailActive flag can
only be set to true when Tomcat starts.

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/ConnectionInitializerInterceptor.java
M src-core/src/org/openbravo/database/SessionInfo.java
M src-db/database/sourcedata/AD_MENU.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M src-db/database/sourcedata/AD_PROCESS.xml
M src-db/database/sourcedata/AD_TREENODE.xml
M src/org/openbravo/erpCommon/ad_callouts/SL_TableAudit.java
R src/org/openbravo/erpCommon/ad_process/UpdateAuditTrail.java
---
(0102148)
AugustoMauch   
2018-02-02 10:35   
The wiki has been updated: The wiki has been udpated: http://wiki.openbravo.com/wiki/Audit_Trail#Running_the_.27Update_Audit_Trail_infrastructure_process [^]
(0102339)
caristu   
2018-02-12 17:17   
Reopened: setting isAuditActive to false from the SL_TableAudit callout can lead to an inconsistent state.

See: https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]

(0102393)
hgbot   
2018-02-14 10:40   
Repository: erp/devel/pi
Changeset: 7c00470a19e9fbf2f56ab45945b27d65e54c82be
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Feb 14 10:15:36 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7c00470a19e9fbf2f56ab45945b27d65e54c82be [^]

Related with issue 37681: Dont call to setAuditActive(false) in SL_TableAudit

The SL_TableAudit callout is invoked when changing the value of the Is Fully Audited flag in ad_table. When the user set this flag to false to the only table that was
being audited, the callout was invoking SessionInfo.setAuditActive(false); to notify that there were no more tables being audited.

But this can lead to problems. Suppose:
- There is one table audited, the audit trail triggers are installed
- All connections have created the ad_context_info table because of this
- The user sets to false the Is Fully Audited flag of the audited table and invokes SessionInfo.setAuditActive(false);
- From then on new connections will not create the ad_context_info table. But the triggers are still installed in the table, because the audit trail infrastructure is not
updated until the system is rebuilt and restarted. If there is a change in data of that table and the connection in charge of doing it has not created the ad_context_info,
the change will not be commited because the triggers will fail.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_TableAudit.java
---
(0102394)
hgbot   
2018-02-14 10:40   
Repository: erp/devel/pi
Changeset: 19cd3ba5708f51f807253f34152d3a7a44d8ff7d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Feb 14 10:21:20 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/19cd3ba5708f51f807253f34152d3a7a44d8ff7d [^]

Related with issue 37681: Fixes typo in message, adds comment

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/ConnectionInitializerInterceptor.java
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0102395)
hgbot   
2018-02-14 10:40   
Repository: erp/devel/pi
Changeset: d0a6cc5b94d57859c9d80bb03bc43f71ce8ec94a
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Feb 14 10:37:25 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d0a6cc5b94d57859c9d80bb03bc43f71ce8ec94a [^]

Fixes issue 37681: Message is shown when enabling and disabling audit trail

---
M src/org/openbravo/erpCommon/ad_callouts/SL_TableAudit.java
---
(0102706)
hudsonbot   
2018-02-22 18:18   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/980a6ad5bbf5 [^]
Maturity status: Test
(0102755)
hudsonbot   
2018-02-22 18:19   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/980a6ad5bbf5 [^]
Maturity status: Test
(0102756)
hudsonbot   
2018-02-22 18:19   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/980a6ad5bbf5 [^]
Maturity status: Test
(0102757)
hudsonbot   
2018-02-22 18:19   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/980a6ad5bbf5 [^]
Maturity status: Test
(0102880)
caristu   
2018-02-28 19:57   
Code reviewed + tested OK.
(0102902)
hgbot   
2018-03-01 11:34   
Repository: erp/devel/pi
Changeset: 1b9efd28dc913c45d3f5ae84a201e4c7a1e06134
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Mar 01 11:32:50 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1b9efd28dc913c45d3f5ae84a201e4c7a1e06134 [^]

related to issue 37681: fix typo in comment

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/ConnectionInitializerInterceptor.java
---
(0102961)
hudsonbot   
2018-03-02 21:18   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/05dece3dc80b [^]
Maturity status: Test