ORA-01704: string literal too long when trying to update a mail template

Description

Hi,

I'm facing an issue when a user tries to update a mail template.
Steps to reproduce :

  • log into a tenant which has a single language (it won't work with GardenAdmin)

  • create a new mail template, fill subject and mail header ; save

  • now, update the content of the mail text (CLOB) with a text > 4000 char and save.

The sql executed on PO at line 4134 (// auto update all translations) will fail and throws a ORA-01704: string literal too long.

I think the solution is (when the column type is CLOB) to split the content (AFAIU, same as PO_LOB) but not sure how to do it properly as the updateTranslations method is creating a “direct” sql.
Should we remove those columns from the sql and update them by code (easier to split the content)

 

: any idea?

 

Thanks,

Nicolas

Environment

None

Activity

Carlos Ruiz
June 1, 2022 at 9:47 AM

I see two possibilities:

  • Change the updateTranslations method to make the UPDATE with binding variables and parameters

    • I mean something like: UPDATE R_MailText_Trl SET MailText=?,IsTranslated=? WHERE R_MailText_ID=?

  • The second option is to change the UPDATE to work with a subselect, similar to how the insertTranslations work

    • something like: UPDATE R_MailText_Trl SET MailText=(SELECT MailText FROM R_MailText WHERE R_MailText_ID=1000005), IsTranslated='Y' WHERE R_MailText_ID=1000005

The second option sounds easier, not sure if the first option will work straight with CLOBs

Carlos Ruiz
June 1, 2022 at 7:57 AM

effectively is just oracle - again a poor design decision of oracle

the exception in log shows this:

Nicolas Micoud
June 1, 2022 at 4:20 AM

Hi

Reproduced on test-oracle ; using a new tenant "client mono lingual".
Note that the insert is ok ; it takes some times, but save is done.

Is ok on PG ; same test done on test-idempiere and no error message.

BTW, I think I miss something but I would have expect to see those errors in About Window > Errors tab - but is empty.
Something has changed ?

 

Thanks

 

Nicolas

Carlos Ruiz
May 31, 2022 at 4:11 PM

Hi - is this just oracle?
Can you create a failing scenario in test-oracle ?

Fixed

Details

Assignee

Reporter

Labels

Fix versions

Priority

Created May 31, 2022 at 3:15 PM
Updated August 1, 2022 at 5:58 PM
Resolved June 7, 2022 at 8:32 PM