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

DB2 database: size for column name in Layout table is not enough

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: 6.2.10 EE GA1, 6.2.X EE, 7.0.0 M4
    • Fix Version/s: None
    • Labels:
      None
    • Fix Priority:
      4

      Description

      The column Layout.name has a size of VARCHAR(750) in DB2 and this lenght is obviously not enough since that field can contain an XML with the title translation for more than 20 languages.

      For the same column we define the following size depending on the database:

      • Mysql: Longtext.
      • Postgres: Text.
      • SQLServer: nvarchar(2000).
      • Oracle: varchar2(4000).

      So we should increase the size also in DB2.

      Steps to reproduce:

      • Configure the portal to use DB2 database.
      • Create a Layout.
      • Add several names for different languages so that the sum of the names are more than 750 characters.

      You will get an excepction similar to this (this trace was got after importing a LAR):

      1/15/15 16:38:29:458 CET] 00000037 SystemOut     O 16:38:29,458 INFO  [liferay/background_task-1][PortletDataContextListenerImpl:42] Import /group/11575/com.liferay.portal.model.Layout/27743-expando.xml
      [1/15/15 16:38:29:490 CET] 00000037 SystemOut     O 16:38:29,490 ERROR [liferay/background_task-1][JDBCExceptionReporter:82] [jcc][t4][102][10040][4.14.113] Batch failure.  The batch was submitted, but at least one exception occurred on an individual member of the batch._Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null [Sanitized]
      [1/15/15 16:38:29:490 CET] 00000037 SystemOut     O 16:38:29,490 ERROR [liferay/background_task-1][JDBCExceptionReporter:82] Error for batch element #1: DB2 SQL Error: SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=4.14.113
      [1/15/15 16:38:29:510 CET] 00000037 SystemOut     O 16:38:29,510 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:133] Unable to execute background task
      com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.DataException: Could not execute JDBC batch update
      	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:166)
      	at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:340)
      	at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:330)
      	at com.liferay.portal.lar.LayoutImporter.importLayout(LayoutImporter.java:933)
      	at com.liferay.portal.lar.LayoutImporter.doImportLayouts(LayoutImporter.java:660)
      	at com.liferay.portal.lar.LayoutImporter.importLayouts(LayoutImporter.java:250)
      	at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1763)
      	at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1812)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      	at java.lang.reflect.Method.invoke(Method.java:611)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:183)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
      	at $Proxy50.importLayouts(Unknown Source)
      	at com.liferay.portal.service.LayoutLocalServiceUtil.importLayouts(LayoutLocalServiceUtil.java:1308)
      	at com.liferay.portal.lar.backgroundtask.LayoutImportBackgroundTaskExecutor.execute(LayoutImportBackgroundTaskExecutor.java:62)
      	at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
      	at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      	at java.lang.Thread.run(Thread.java:738)
      Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.DataException: Could not execute JDBC batch update
      	at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:251)
      

      Additional Information
      It would be necessary to review other similar columns which could suffer the same issue.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              alberto.chaparro Alberto Chaparro
              Participants of an Issue:
              Recent user:
              Ahmed Abdin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 29 weeks, 3 days ago

                  Packages

                  Version Package