Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-69033

Post-Upgrade Fix for DXP to handle Multi-byte characters in Liferay with an Oracle DB



      Liferay permits up to 4000 characters in a varchar2 field but Oracle 11g and 12c default to a 4000 byte limit. If multi-byte characters are used as input, an exception like the following can be encountered:

      14:38:56,542 ERROR [http-bio-8443-exec-39][JDBCExceptionReporter:234] ORA-01461: can bind a LONG value only for insert into a LONG column
      14:38:56,544 ERROR [http-bio-8443-exec-39][DefaultTransactionExecutor:93] Application exception overridden by commit exception
      org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [update User_ set uuid_=?, companyId=?, createDate=?, modifiedDate=?, defaultUser=?, contactId=?, password_=?, passwordEncrypted=?, passwordReset=?, passwordModifiedDate=?, digest=?, reminderQueryQuestion=?, reminderQueryAnswer=?, graceLoginCount=?, screenName=?, emailAddress=?, facebookId=?, ldapServerId=?, openId=?, portraitId=?, languageId=?, timeZoneId=?, greeting=?, comments=?, firstName=?, middleName=?, lastName=?, jobTitle=?, loginDate=?, loginIP=?, lastLoginDate=?, lastLoginIP=?, lastFailedLoginDate=?, failedLoginAttempts=?, lockout=?, lockoutDate=?, agreedToTermsOfUse=?, emailAddressVerified=?, status=? where userId=?]; SQL state [72000]; error code [1461]; Could not execute JDBC batch update; nested exception is org.hibernate.QueryTimeoutException: Could not execute JDBC batch update
      	at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:645)
      	at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:793)

      Steps to Reproduce:
      1. Configure Liferay Portal 6.2 EE to use Oracle Database.
      2. Create a user via the User menu with the screen name "omniadmin".
      3. Navigate to Control Panel > Server Admin > Script.
      4. Run the attached Groovy Script which attempts to set user comments

      Since less than 4000 characters are used, the user's comments will be updated.
      User comments are not updated because Oracle is using a byte limit, not a character limit.

      Additional Testing:
      6.2.x: a7857fd6e0c7b232782d2f7e5e7265ff6354070b
      Issue reproduced in branch.
      DXP: 818582ccbb75c29d4c7c981bb34abda15d765113
      Issue reproduced in branch.


          Issue Links



              • Assignee:
                daniel.song Daniel Song (Inactive)
                daniel.song Daniel Song (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Days since last comment:
                  3 years, 47 weeks ago


                  Version Package