Openbravo Issue Tracking System - Modules
View Issue Details
0017616ModulesAdvanced Paymentspublic2011-06-13 12:252011-09-13 12:31
malsasua 
mirurita 
highminoralways
newopen 
20Community Appliance
2.50 
 
0017616: error in add payment process when there are more than 1000 financial accounts
if there are more than 1000 financial accounts, when you run the process add payment in Sales invoice window, error is returned:
ORA-01795: el número máximo de expresiones en una lista es 1000
the error is reproducible in ORACLE database. In postgres it works fine

. ORACLE DATABASE

. create 1000 financial accounts with payment method "p1"
Financial Management || Receivables & Payables || Transactions || Financial Account || Account

. create new sales invoice with payment method "p1"
Sales Management || Transactions || Sales Invoice || Header
. process invoice
. run add payment

error is returned

the hibernate log is

a3196480 12:21:23 [http-8080-6] DEBUG org.hibernate.SQL - select this_.Fin_Paymentmethod_ID as Fin1_268_0_, this_.AD_Client_ID as AD2_268_0_, this_.AD_Org_ID as AD3_268_0_, this_.Created as Created268_0_, this_.Createdby as Createdby268_0_, this_.Updated as Updated268_0_, this_.Updatedby as Updatedby268_0_, this_.Isactive as Isactive268_0_, this_.Name as Name268_0_, this_.Description as Descrip10_268_0_, this_.Automatic_Receipt as Automatic11_268_0_, this_.Automatic_Payment as Automatic12_268_0_, this_.Automatic_Deposit as Automatic13_268_0_, this_.Automatic_Withdrawn as Automatic14_268_0_, this_.Payin_Allow as Payin15_268_0_, this_.Payout_Allow as Payout16_268_0_, this_.Payin_Execution_Type as Payin17_268_0_, this_.Payout_Execution_Type as Payout18_268_0_, this_.Payin_Execution_Process_ID as Payin19_268_0_, this_.Payout_Execution_Process_ID as Payout20_268_0_, this_.Payin_Deferred as Payin21_268_0_, this_.Payout_Deferred as Payout22_268_0_, this_.Uponreceiptuse as Uponrec23_268_0_, this_.Upondeposituse as Upondep24_268_0_, this_.Inuponclearinguse as Inuponc25_268_0_, this_.Uponpaymentuse as Uponpay26_268_0_, this_.Uponwithdrawaluse as Uponwit27_268_0_, this_.Outuponclearinguse as Outupon28_268_0_ from FIN_PaymentMethod this_ where this_.AD_Org_ID in (?, ?,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, ?) and this_.AD_Client_ID in (?, ?) and this_.Isactive=?
a3196480 12:21:23 [http-8080-6] ERROR org.hibernate.util.JDBCExceptionReporter - ORA-01795: el número máximo de expresiones en una lista es 1000
No tags attached.
related to defect 0016001 closed eduardo_Argal error in add payment process when there are more than 1000 financial accounts 
Issue History
2011-06-13 12:25malsasuaNew Issue
2011-06-13 12:25malsasuaAssigned To => adrianromero
2011-06-13 12:25malsasuaIssue Monitored: networkb
2011-06-13 12:25malsasuaRelationship addedrelated to 0016001
2011-06-13 12:25malsasuaAssigned Toadrianromero => eduardo_Argal
2011-08-02 17:11jonalegriaesarteAssigned Toeduardo_Argal => adrianromero
2011-08-11 13:55adrianromeroNote Added: 0040121
2011-08-11 13:55adrianromeroAssigned Toadrianromero => mirurita

Notes
(0040121)
adrianromero   
2011-08-11 13:55   
This is the same case as the related issue 160001. But the solution adopted in that issue is not the best. It was splitted the long IN() clause by several IN() clauses that to not reach the 1000 limit.

It would be better to refactor the query and probably replace the IN() clause by a subquery.