Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0045493 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
defect | [Modules] Initial data load | major | sometimes | 2020-11-24 10:50 | 2021-02-23 10:11 | |||||||
Reporter | sebastien_liron | View Status | public | |||||||||
Assigned To | markmm82 | |||||||||||
Priority | immediate | Resolution | open | Fixed in Version | ||||||||
Status | scheduled | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | 2.50 | |||||||
OS | Linux 64 bit | Database | PostgreSQL | Java version | 7.x | |||||||
OS Version | Openbravo Appliance 14.04 | Database version | 9.3.x | Ant version | 1.9.x | |||||||
Product Version | 2.50 | SCM revision | ||||||||||
Regression date | ||||||||||||
Regression introduced by commit | ||||||||||||
Regression level | Production - Confirmed Stable | |||||||||||
Review Assigned To | ||||||||||||
Regression introduced in release | ||||||||||||
Summary | 0045493: IDL for inventory sometimes crash with coul not execute batch | |||||||||||
Description | With data file of 700 elements we had some issues using the idl stock. At some point the process will crash with this stack : Exception in component tJavaRow_3 javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute batch at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188) at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1490) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1470) at org.openbravo.dal.service.OBDal.flush(OBDal.java:265) at org.openbravo.idl.initial_data_load.stockjob_0_1.StockJob.tFileInputDelimited_1Process(StockJob.java:10289) at org.openbravo.idl.initial_data_load.stockjob_0_1.StockJob.runJobInTOS(StockJob.java:10683) at org.openbravo.idl.initial_data_load.stockjob_0_1.StockJob.runJob(StockJob.java:10613) at org.openbravo.idl.proc.StockProcess.runJob(StockProcess.java:51) at org.openbravo.idl.proc.IdlServiceETL.executeImport(IdlServiceETL.java:20) at org.openbravo.idl.proc.IdlService.executeProcess(IdlService.java:106) Caused by: org.hibernate.exception.ConstraintViolationException: could not execute batch at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:129) at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.addToBatch(BatchingBatch.java:89) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3175) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3690) at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:90) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:478) at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:356) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39) at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1484) ... 53 more Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into M_InventoryLine (AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, M_Inventory_ID, M_Locator_ID, M_Product_ID, Line, QtyBook, QtyCount, C_UOM_ID, QuantityOrderBook, M_InventoryLine_ID) values ('255610F4EA224E279210315249611061', '2041C2B394754A26A23F4A2034872BF9', 'Y', '2020-11-16 12:10:21.779+01'::timestamp, '5CA2699596C24B4F96AE045E8E62C019', '2020-11-16 12:10:21.779+01'::timestamp, '5CA2699596C24B4F96AE045E8E62C019', '8AFF7BB6406244808710BF07CEB52861', '5439F164C8F14FEC8CF5C449EAA7ED7C', '1638480A6ED045E9910B3253D6F35786', 10, '0', '10000', '100', '0', '364FF4B9A03543B48DBD341349DBBD14') was aborted: ERROR: insert or update on table "m_inventoryline" violates foreign key constraint "m_inventoryline_m_inventory" Detail: Key (m_inventory_id)=(8AFF7BB6406244808710BF07CEB52861) is not present in table "m_inventory". Call getNextException to see other errors in the batch. at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:145) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2179) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:479) | |||||||||||
Steps To Reproduce | use big files ( 1000 elements ) on stock import shoud trigger this error | |||||||||||
Proposed Solution | I have added a diff with some code that seems to fix the issue ( I also added some logs ... ) and this patch is currenlty used in the Prod env with no more issues. | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ![]() | |||||||||||
![]() |
|
![]() |
|
(0126296) vmromanos (manager) 2021-02-23 10:11 |
NOTE: IDL is a deprecated module. Quick fixes in general are OK (as it looks like the case for this issue), but no big effort will be invested in deprecated modules in general. |
![]() |
|||
Date Modified | Username | Field | Change |
2020-11-24 10:50 | sebastien_liron | New Issue | |
2020-11-24 10:50 | sebastien_liron | Assigned To | => Retail |
2020-11-24 10:50 | sebastien_liron | File Added: importStock.patch | |
2020-11-24 10:50 | sebastien_liron | Regression level | => Production - Confirmed Stable |
2021-02-23 10:09 | vmromanos | Assigned To | Retail => Triage Finance |
2021-02-23 10:09 | vmromanos | Severity | critical => major |
2021-02-23 10:11 | vmromanos | Status | new => scheduled |
2021-02-23 10:11 | vmromanos | Note Added: 0126296 | |
2021-02-23 10:11 | vmromanos | Assigned To | Triage Finance => markmm82 |
Copyright © 2000 - 2009 MantisBT Group |