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

Multi-byte characters can break the Oracle byte limit for some columns and result in ORA-01461

    Details

      Description

      Description:
      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. Navigate to Control Panel > Server Admin > Script.
      3. Create a user via the User menu with the screen name "omniadmin".
      4. Run the attached Groovy Script which attempts to set user comments

      Expected:
      Since less than 4000 characters are used, the user's comments will be updated.
      Actual:
      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.
      Master: 8f319fe5b2a8d505f89b09ad6ec49e3eefed52f5
      Cannot test in Master; Master is not compatible with Oracle.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 2 weeks, 6 days ago

                  Packages

                  Version Package