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

Fix PersistenceTests so that they can be run in PostgreSQL

    Details

      Description

      There are errors in PersistenceTests executing integration test suite against PostgreSQL. They are related to Blob fields within a transaction.

      com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: could not update: com.liferay.portlet.documentlibrary.model.DLContentDataBlobModel#81526
      at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:30)
      at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:147)
      at com.liferay.portal.kernel.dao.orm.ClassLoaderSession.flush(ClassLoaderSession.java:237)
      at com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl.closeSession(SessionFactoryImpl.java:46)
      at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.closeSession(BasePersistenceImpl.java:83)
      at com.liferay.portlet.documentlibrary.service.persistence.DLContentPersistenceImpl.updateImpl(DLContentPersistenceImpl.java:2462)
      at com.liferay.portlet.documentlibrary.service.persistence.DLContentPersistenceImpl.updateImpl(DLContentPersistenceImpl.java:1)
      at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:333)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      at com.liferay.portal.test.persistence.TransactionalPersistenceAdvice.invoke(TransactionalPersistenceAdvice.java:39)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      at sun.proxy.$Proxy346.update(Unknown Source)
      at com.liferay.portlet.documentlibrary.service.persistence.DLContentPersistenceTest.addDLContent(DLContentPersistenceTest.java:366)
      at com.liferay.portlet.documentlibrary.service.persistence.DLContentPersistenceTest.testDynamicQueryByPrimaryKeyExisting(DLContentPersistenceTest.java:247)
      at com.liferay.portal.kernel.test.RunBeforeTestMethodCallback.evaluate(RunBeforeTestMethodCallback.java:45)
      at com.liferay.portal.kernel.test.RunAfterTestMethodCallback.evaluate(RunAfterTestMethodCallback.java:49)
      at com.liferay.portal.kernel.test.RunBeforeTestClassesCallback.evaluate(RunBeforeTestClassesCallback.java:39)
      at com.liferay.portal.kernel.test.RunAfterTestClassesCallback.evaluate(RunAfterTestClassesCallback.java:42)
      at com.liferay.portal.test.LiferayIntegrationJUnitTestRunner$1.evaluate(LiferayIntegrationJUnitTestRunner.java:74)
      Caused by: org.hibernate.exception.GenericJDBCException: could not update: com.liferay.portlet.documentlibrary.model.DLContentDataBlobModel#81526
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2613)
      at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2495)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2822)
      at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:113)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:185)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
      at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:144)
      Caused by: org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode.
      at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:241)
      at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:228)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.setBlob(AbstractJdbc2Statement.java:2901)
      at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setBlob(NewProxyPreparedStatement.java:225)
      at org.hibernate.type.descriptor.sql.BlobTypeDescriptor$3$1.doBind(BlobTypeDescriptor.java:88)
      at org.hibernate.type.descriptor.sql.BlobTypeDescriptor$1$1.doBind(BlobTypeDescriptor.java:61)
      at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:91)
      at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:283)
      at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:278)
      at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:89)
      at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2184)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2559)

      As we use spring's LocalDataSourceConnectionProvider (which is prepared for managing transactions) instead of hibernate's DriverManagerConnectionProvider (responsible of setting autoCommit value from hibernate properties), then the autoCommit value for the jdbc Connection is never set.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brian.chan Brian Chan
              Reporter:
              manuel.delapenya Manuel de la Peña (Inactive)
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 40 weeks, 6 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M1