0 Replies Latest reply on Apr 25, 2017 6:44 AM by imphilippesimo

    How to solve postgresql "large objects should not be use in autocommit mode" problem with jBPM 6.4

    imphilippesimo Newbie

      HI everyone,

      i've been working for the last year with jBPM 6.4 API coupled with Mysql without major problem. Since some days im trying to use a postresql database but i am facing a problem during operations on processes.

       

      Postgrsql is complqining qbout the fqct that  :

      large objects are used in auto commit mode

      ;

       

       

      2017-04-25 11:08:38,961 [main] ERROR org.springframework.transaction.support.TransactionSynchronizationUtils - TransactionSynchronization.beforeCompletion threw exception

      javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not insert: [org.jbpm.services.task.impl.model.I18NTextImpl]

        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)

        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)

        at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1316)

        at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:999)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:483)

        at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:366)

        at com.sun.proxy.$Proxy36.flush(Unknown Source)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:483)

        at org.kie.spring.persistence.AbstractKieSpringJpaManager$EmHolderDelegateInvocationHandler.invoke(AbstractKieSpringJpaManager.java:141)

        at com.sun.proxy.$Proxy37.flush(Unknown Source)

        at org.drools.persistence.TriggerUpdateTransactionSynchronization.beforeCompletion(TriggerUpdateTransactionSynchronization.java:76)

        at org.kie.spring.persistence.SpringTransactionSynchronizationAdapter.beforeCompletion(SpringTransactionSynchronizationAdapter.java:54)

        at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCompletion(TransactionSynchronizationUtils.java:106)

        at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCompletion(AbstractPlatformTransactionManager.java:938)

        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:835)

        at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:823)

        at org.kie.spring.persistence.KieSpringTransactionManager.rollback(KieSpringTransactionManager.java:84)

        at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:401)

        at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:389)

        at org.drools.persistence.SingleSessionCommandService.access$1100(SingleSessionCommandService.java:56)

        at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:600)

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

        at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82)

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41)

        at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73)

        at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:385)

        at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:256)

        at com.maroua.services.JBPMService.startCircuit(JBPMService.java:242)

        at com.maroua.services.Main.main(Main.java:36)

      Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [org.jbpm.services.task.impl.model.I18NTextImpl]

        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)

        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)

        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3099)

        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3521)

        at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)

        at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)

        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)

        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:303)

        at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)

        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)

        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1195)

        at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:996)

        ... 31 more

      Caused by: org.postgresql.util.PSQLException: Les Large Objects ne devraient pas être utilisés en mode auto-commit.

        at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:241)

        at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:228)

        at org.postgresql.jdbc2.AbstractJdbc2Statement.setClob(AbstractJdbc2Statement.java:3012)

        at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$3$1.doBind(ClobTypeDescriptor.java:99)

        at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:93)

        at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:284)

        at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:279)

        at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:57)

        at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2798)

        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3076)

        ... 40 more

       

      I saw that the problem was about writing the table corresponding to the `[org.jbpm.services.task.impl.model.I18NTextImpl]`

      which is `I18NText` in the database. I also notice that the annoying attribute was `text` of datatype `text`

       

      I did already solve such issue with tables  SessionInfo, ProcessInstanceInfo, WorkItemInfo, concerning their respective attributes

      rulesbytearray

      processInstanceByteArray

      workitembytearay

      By overriding mapping definitions in orm.xml as defined in the associated file.

       

      I am in a project where i am forced to use a PostgreSQL database and i dont know what to do.