Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033507Openbravo ERPA. Platformpublic2016-07-20 12:402016-08-30 10:08
alostale 
NaroaIriarte 
urgentcriticalrandom
closedfixed 
5
 
3.0PR16Q4 
alostale
Core
No
0033507: copy lines can generate incorrect audit trail info
Some sqlc processes can generate incorrect audit trail information.

Sqlc processes making use of getTransactionConnection do not set properly context information table, this can lead to incorrect audit information.
1. Activate the instance
2. As System Admin set C_Order table as fully audited
3. Generate Audit trail infrastructure
4. Login as Openbravo Admin
5. Create a new Sales Order header
6. Open chrome's dev tools > network
7. Open Copy Lines process
8. Select a line and execute
9. In dev tools select CopyFromOrder.html request and copy as curl
10. Execute bench 2000 "curl whateverYouCopied --silent" [1]
11. Execute this query: select count(*), processtype, process_id from ad_audit_trail where action='I' group by 2,3

  -> Expected: all records should have 211 (Copy From) as process_id
  -> Got: some of them have different process_id

[1] https://raw.githubusercontent.com/alostale/ob-scripts/master/misc/bench [^]
No tags attached.
related to defect 0033438 closed alostale DalConnectionProvider.getTransactionConnection does not obtain connection from common pool 
Issue History
2016-07-20 12:40alostaleNew Issue
2016-07-20 12:40alostaleAssigned To => platform
2016-07-20 12:40alostaleModules => Core
2016-07-20 12:40alostaleTriggers an Emergency Pack => No
2016-07-20 12:45alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12693#r12693
2016-07-20 12:48alostaleRelationship addedrelated to 0033438
2016-07-20 12:48alostaleStatusnew => scheduled
2016-07-20 12:48alostaleAssigned Toplatform => NaroaIriarte
2016-08-01 09:54hgbotCheckin
2016-08-01 09:54hgbotNote Added: 0088707
2016-08-01 09:54hgbotStatusscheduled => resolved
2016-08-01 09:54hgbotResolutionopen => fixed
2016-08-01 09:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6bef7cf32538272b1119cafab0ab29d998d5d5c4 [^]
2016-08-01 10:02NaroaIriarteReview Assigned To => alostale
2016-08-11 18:40hudsonbotCheckin
2016-08-11 18:40hudsonbotNote Added: 0089027
2016-08-30 10:08alostaleNote Added: 0089532
2016-08-30 10:08alostaleStatusresolved => closed
2016-08-30 10:08alostaleFixed in Version => 3.0PR16Q4

Notes
(0088707)
hgbot   
2016-08-01 09:54   
Repository: erp/devel/pi
Changeset: 6bef7cf32538272b1119cafab0ab29d998d5d5c4
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Fri Jul 29 11:18:31 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6bef7cf32538272b1119cafab0ab29d998d5d5c4 [^]

Fixed issue 33507: Incorrect Audit info was generated sometimes.

There was a problem when creating audit info data by some sqlc processes, sometimes wrong data was being created. The problem was that when the processes used the getTransactionConnection, the context information table was not correctly set. This table is set by the SessionInfo.setDBSessionInfo method.
To fix this, a call to this method has been added in the ConnectionProviderImpl.getTransactionConnection() and in the DalConnectionProvider.getTransactionConnection().

---
M src-core/src/org/openbravo/database/ConnectionProviderImpl.java
M src/org/openbravo/service/db/DalConnectionProvider.java
---
(0089027)
hudsonbot   
2016-08-11 18:40   
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/edaa05b1fb18 [^]
Maturity status: Test
(0089532)
alostale   
2016-08-30 10:08   
code reviewed

tested with old and new db pools