1 Reply Latest reply on Aug 24, 2012 1:20 AM by Maciej Swiderski

    "Large Objects may not be used in auto-commit mode" when using Postresql DB

    wqe wqe Newbie

      I just follow the instruction in the official documtation  of using gwt-console :

       

      1. Login as krisv and create an evaluation instance

      2. Click the task section --> Personal Tasks to check if the process instance created in the previous step can be  assigned to krisv (current account ) . However ,  " Large Objects may not be used in auto-commit mode"  exception occurs . Belows show the details information of this errors:

       

      15:03:00,963 INFO  [stdout] (Thread-68) Hibernate: select task0_.id as col_0_0_, task0_.processInstanceId as col_1_0_, names4_.text as col_2_0_, subjects2_.text as col_3_0_, descriptio3_.text as col_4_0_, task0_.status as col_5_0_, task0_.priority as col_6_0_, task0_.skipable as col_7_0_, task0_.actualOwner_id as col_8_0_, user1_.id as col_9_0_, task0_.createdOn as col_10_0_, task0_.activationTime as col_11_0_, task0_.expirationTime as col_12_0_, task0_.processId as col_13_0_, task0_.processSessionId as col_14_0_ from Task task0_ left outer join OrganizationalEntity user1_ on task0_.createdBy_id=user1_.id left outer join I18NText subjects2_ on task0_.id=subjects2_.Task_Subjects_Id left outer join I18NText descriptio3_ on task0_.id=descriptio3_.Task_Descriptions_Id left outer join I18NText names4_ on task0_.id=names4_.Task_Names_Id inner join OrganizationalEntity user5_ on task0_.actualOwner_id=user5_.id where task0_.actualOwner_id=? and (task0_.status in (?)) and (names4_.language=? or (select count(names6_.Task_Names_Id) from I18NText names6_ where task0_.id=names6_.Task_Names_Id)=0) and (subjects2_.language=? or (select count(subjects7_.Task_Subjects_Id) from I18NText subjects7_ where task0_.id=subjects7_.Task_Subjects_Id)=0) and (descriptio3_.language=? or (select count(descriptio8_.Task_Descriptions_Id) from I18NText descriptio8_ where task0_.id=descriptio8_.Task_Descriptions_Id)=0) and (task0_.expirationTime is null)

       

       

      [11:17:04,031 ERROR [org.jbpm.task.service.TaskServerHandler] (Thread-70) org.hibernate.exception.GenericJDBCException: Large Objects may not be used in auto-commit mode.: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Large Objects may not be used in auto-commit mode.

      ]

      11:17:04,015 ERROR [stderr] (Thread-70)     at org.jbpm.task.service.persistence.TaskPersistenceManager.queryTasksWithUserIdStatusAndLanguage(TaskPersistenceManager.java:225)

      11:17:04,015 ERROR [stderr] (Thread-70)     at org.jbpm.task.service.TaskServiceSession.getTasksOwned(TaskServiceSession.java:653)

      11:17:04,015 ERROR [stderr] (Thread-70)     at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:289)

       

      Google and found that handling the "large object" in postresql is required to be enclosed with a transaction block. As my transaction is managed by the AS ,  I want to ask how to force the AS to disable the  auto-commit transaction ? Do jbpm 5.3.0 Final really works with Postresql 9.1 ? Anyone who have successfully config  jbpm 5.3.0 Final  with Postresql 9.1 using AS 7.1.X please share the idea .(PS. I am using JPA 2.0 already)

       

      Here is my configuration :

       

      persistence.xml of the jbpm-human-task-war.war :

       

      <persistence-unit name="org.jbpm.task" transaction-type="JTA"> 
          <provider>org.hibernate.ejb.HibernatePersistence</provider>
          <jta-data-source>java:jboss/datasources/task</jta-data-source>       
          <mapping-file>META-INF/Taskorm.xml</mapping-file>
          <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>          
            <property name="hibernate.max_fetch_depth" value="3"/>
            <property name="hibernate.hbm2ddl.auto" value="update" />
            <property name="hibernate.show_sql" value="true" />  
            <class>XXXXXXXX</class>
      
              <property name="hibernate.connection.autocommit" value="false" />      
              <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> 
          </properties>
        </persistence-unit>
      

       

        datasource setting in the standalone.xml:

       

           <subsystem xmlns="urn:jboss:domain:datasources:1.0">
                  <datasources>
                      <datasource jta="true" jndi-name="java:jboss/datasources/jbpm5" pool-name="jbpmDS" enabled="true" use-java-context="true">
                          <connection-url>jdbc:postgresql://127.0.0.1:5432/jbpm5</connection-url>
                          <driver>postgresql-9.1</driver>
                          <security>
                              <user-name>xxxx</user-name>
                              <password>xxxx</password>
                          </security>
                      </datasource>
                      <datasource jta="true" jndi-name="java:jboss/datasources/task" pool-name="taskDS" enabled="true" use-java-context="true">
                          <connection-url>jdbc:postgresql://127.0.0.1:5432/task</connection-url>
                          <driver>postgresql-9.1</driver>
                          <security>
                              <user-name>xxxx</user-name>
                              <password>xxxxx</password>
                          </security>
                      </datasource>
                      <drivers>
                          <driver name="postgresql-9.1" module="org.postgresql">
                              <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
                          </driver>
                      </drivers>
                  </datasources>
              </subsystem>