Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037697
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Retail Modules] Web POSminorhave not tried2017-06-19 19:182018-01-25 15:10
ReportershuehnerView Statuspublic 
Assigned Tomarvintm 
PrioritynormalResolutionfixedFixed in VersionRR17Q3.3
StatusclosedFix in branchFixed in SCM revisionea2b01369e1a
ProjectionnoneETAnoneTarget VersionRR17Q3.3
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomigueldejuana
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037697: (Expected) duplicate pk on insert of Logclient apart from info message still logs 2* ERROR

DescriptionLogClientLoader expects to see duplicate messages and logs + then ignores the duplicate row.

However apart from that INFO message 2* ERROR are logged to openbravo.log including the full json message which in some customers is a huge amount of the ERROR's messages seen per day.

Those 2*ERROR should be supressed.

Example case:
70a8a81e 2017-06-19 11:50:33,164 [ajp-bio-127.0.0.1-8009-exec-171] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 inser
t into obmobc_logclient (AD_Client_ID, AD_Org_ID, Isactive, Created, Createdby, Updated, Updatedby, Deviceid, Msg, Loglevel, Cache_Sess
ion_ID, Isonline, Obmobc_Logclient_ID) values ('AA', 'BB', 'Y', '2017-6-19
11:48:57.908000 -5:0:0', 'CC', '2017-6-19 11:50:33.161000 -5:0:0', 'CC', 'DEVICEID', 'runSyncProcess: synchronization successfully done; stackTrace: https://the.url/openbravo/web/js/gen/bd5 [^]
2e366338bc6dc386ed72358a97e05_WebPOS.js:1487:483', 'Info', 'DF929F87F1334E61BCDF9ABC23837689', 'Y', '9E51244B6472BA64D4C59580D19D1A00')
 was aborted. Call getNextException to see the cause.
70a8a81e 2017-06-19 11:50:33,164 [ajp-bio-127.0.0.1-8009-exec-171] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "obmobc_logclient_pk"
  Detail: Key (obmobc_logclient_id)=(9E51244B6472BA64D4C59580D19D1A00) already exists.
70a8a81e 2017-06-19 11:50:33,174 [ajp-bio-127.0.0.1-8009-exec-171] INFO org.openbravo.mobile.core.utils.LogClientLoader - Found duplicated log client message with id: 9E51244B6472BA64D4C59580D19D1A00. Ignoring
Steps To Reproduce.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0036288 closedgorka_gil (Expected) duplicate pk on insert of Logclient apart from info message still logs 2* ERROR 

-  Notes
(0101848)
hgbot (developer)
2018-01-22 15:24

Repository: retail/backports/3.0RR17Q3.3/org.openbravo.mobile.core
Changeset: ea2b01369e1adc5e75852d63aefc40e25f0ce47c
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Jan 22 15:23:58 2018 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR17Q3.3/org.openbravo.mobile.core/rev/ea2b01369e1adc5e75852d63aefc40e25f0ce47c [^]

Fixed issue 37697. (Expected) duplicate pk on insert of Logclient apart from info message still logs 2* error

Controled the exception when inserting the log line in the backend, for the case of duplicate id.
To control the exception needed to not use DAL nor xsql, and use instead a prepared statement directly.

In the case of error, we do a sql in the db and if the id is in the db, is a duplicated and everthing is fine.
Note that this case of duplicate is not common case, so this query to check duplicates should not be very frequent.

A future improvement is the use of merge functionality of postgres 9.5 that has upsert, that can do inserts and
ignore the cases of duplicates. But also needed to find something similar in oracle.
Note that in the moment of fix we still support postgres 9.3 so not possible to use it.
Other option was the use of interceptors but will affect all the queries of the application so was discarded.

---
M src/org/openbravo/mobile/core/utils/LogClientLoader.java
---
(0101849)
hgbot (developer)
2018-01-22 15:24

Repository: retail/backports/3.0RR17Q3.3/org.openbravo.mobile.core
Changeset: b2420ffab4b02bd8215131bf497f63acca99a1e5
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Jan 22 15:24:25 2018 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR17Q3.3/org.openbravo.mobile.core/rev/b2420ffab4b02bd8215131bf497f63acca99a1e5 [^]

Related to issue 37697. (Expected) duplicate pk on insert of Logclient apart from info message still logs 2* error

Updated license year

---
M src/org/openbravo/mobile/core/utils/LogClientLoader.java
---
(0101850)
hgbot (developer)
2018-01-22 15:25

Repository: retail/backports/3.0RR17Q3.3/org.openbravo.mobile.core
Changeset: 53638019337bb3a8c299f22aaa48f0662d5d86c9
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Jan 22 15:24:49 2018 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR17Q3.3/org.openbravo.mobile.core/rev/53638019337bb3a8c299f22aaa48f0662d5d86c9 [^]

Related to issue 37697. (Expected) duplicate pk on insert of Logclient apart from info message still logs 2* error

Apply shu review

---
M src/org/openbravo/mobile/core/utils/LogClientLoader.java
---
(0101945)
migueldejuana (developer)
2018-01-25 15:10

Tested and reviewed

- Issue History
Date Modified Username Field Change
2018-01-22 15:21 marvintm Type defect => backport
2018-01-22 15:21 marvintm Target Version => RR17Q3.3
2018-01-22 15:24 hgbot Checkin
2018-01-22 15:24 hgbot Note Added: 0101848
2018-01-22 15:24 hgbot Status scheduled => resolved
2018-01-22 15:24 hgbot Resolution open => fixed
2018-01-22 15:24 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/77be95078aa45a3a1d621db07654da0f6337e6d5 [^] => http://code.openbravo.com/retail/backports/3.0RR17Q3.3/org.openbravo.mobile.core/rev/ea2b01369e1adc5e75852d63aefc40e25f0ce47c [^]
2018-01-22 15:24 hgbot Checkin
2018-01-22 15:24 hgbot Note Added: 0101849
2018-01-22 15:25 hgbot Checkin
2018-01-22 15:25 hgbot Note Added: 0101850
2018-01-25 11:28 marvintm Assigned To gorka_gil => marvintm
2018-01-25 15:10 migueldejuana Review Assigned To marvintm => migueldejuana
2018-01-25 15:10 migueldejuana Note Added: 0101945
2018-01-25 15:10 migueldejuana Status resolved => closed
2018-01-25 15:10 migueldejuana Fixed in Version => RR17Q3.3


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker