Openbravo Issue Tracking System - Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0045493 | Modules | Initial data load | public | 2020-11-24 10:50 | 2024-01-06 00:43 |
Reporter | sebastien_liron | ||||
Assigned To | markmm82 | ||||
Priority | immediate | Severity | major | Reproducibility | sometimes |
Status | closed | Resolution | fixed | ||
Platform | OS | 30 | OS Version | Openbravo Appliance 14.04 | |
Product Version | 2.50 | ||||
Target Version | 2.50 | Fixed in Version | |||
Merge Request Status | approved | ||||
Regression date | |||||
Regression introduced by commit | |||||
Regression level | Production - Confirmed Stable | ||||
Review Assigned To | |||||
Support ticket | |||||
OBNetwork customer | Gold | ||||
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. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://issues.openbravo.com/file_download.php?file_id=15121&type=bug ![]() https://issues.openbravo.com/file_download.php?file_id=15389&type=bug | ||||
Issue History | |||||
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 | ||
2020-11-24 10:50 | sebastien_liron | Resolution time | => 1607122800 | ||
2020-11-24 10:50 | sebastien_liron | OBNetwork customer | => Gold | ||
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 | ||
2021-03-10 13:12 | markmm82 | File Added: 20201005importSTK+(1).csv | |||
2021-03-10 13:13 | markmm82 | Note Added: 0126586 | |||
2021-03-10 17:01 | hgbot | Merge Request Status | => open | ||
2021-03-10 17:01 | hgbot | Note Added: 0126589 | |||
2021-03-11 10:00 | hgbot | Merge Request Status | open => approved | ||
2021-03-11 10:00 | hgbot | Resolution | open => fixed | ||
2021-03-11 10:00 | hgbot | Status | scheduled => closed | ||
2021-03-11 10:00 | hgbot | Note Added: 0126623 | |||
2021-03-11 10:00 | hgbot | Fixed in Version | => PR21Q2 | ||
2021-03-11 10:00 | hgbot | Note Added: 0126624 | |||
2024-01-06 00:43 | eugeni | Issue Monitored: eugeni |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|