6 Replies Latest reply on Jun 25, 2011 11:26 AM by Nick Tan

    [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.

    Nick Tan Newbie

      hi, folks

       

      i'm getting an error about "[JDBCExceptionReporter] Large Objects may not be used in auto-commit mode."

      when i use postgresql instead of h2

       

      i modified the source code, and configure it with postgresql

      things works fine, but when i open http://localhost:8080/jbpm-console, and click "process -> process overview", no process at all (but in fact, i have uploaded 2 process into guvnor, and build the package, can run with the API)

      i went to the terminal and find there is exception: [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.

      (see attached log file for more detail, line: 171)

       

      I googled, and people said “BLOB must be accessed in a transaction when using postgresql”, I’m not really sure how to fix this in jBPM/Drools.

       

      can anyone help? thanks

        • 1. [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.
          Chris Melas Apprentice

          Hello,

          Have you tried setting autocommit to false in the corresponding persistence files (persistence.xml, hibernate.cfg.xml)?

          • 2. [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.
            Nick Tan Newbie

            Thanks, Chris

             

            i modified the file:

            • jbpm\jbpm-gwt\jbpm-gwt-server-war\src\main\resources\META-INF\persistence.xml
            • jbpm\jbpm-human-task\src\main\resources\META-INF\persistence.xml

            to set the "hibernate.connection.autocommit" as false

                <property name="hibernate.connection.autocommit" value="false" />

             

            but not work

             

            i'm using jbpm 5.0.0, drools 5.2.0.m1

             

            did i miss any thing? thanks

             

            --

            Nick

            • 3. [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.
              Chris Melas Apprentice

              No prob nick.

               

              Well, without certainty i would advice, if not switching, to at least try to use jbpm5.1.xxxx  .

               

              Now regarding the autocommit i've noticed that in my installation (jbpm5.1.0M1) i dont have any autocommit - true , they are all false.

               

              The places where will find the persistence.xml and hibernate.cfg.xml files are

              1. jbpm-gwt-console-server-5.1.0.M1.war WEB-INF\classes\META-INF

              2. jbpm-bam-5.1.0.M1.jar inside the war above as well as in your runtime

              3. jbpm-human-task-5.1.0.M1.jar (META-INF ), tha jar is also located in the war above and your runtime (i think.....maybe not )

               

              After you make those changes and place them in your runtime if you use the human task service and the deploy folder of jboss, restart them (jboss and human task) and try again.

              • 4. Re: [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.
                Nick Tan Newbie

                Hi, Chris

                 

                i tried what you suggested

                as you said there no "autocommit" porperty in the original source code, i put them just to make sure they are false

                 

                also, i'm now using jbpm 5.1.0.M1

                 

                still not working

                 

                BTW, i notice that, next to the Exception: [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.

                 

                there is another Exception, i'm not sure if this the cause of the previous exception, as it said, "no such transaction", and people just said that

                “BLOB must be accessed in a transaction when using postgresql”,

                what do you think? thanks:)

                 

                {code}

                03:29:25,267 ERROR [AbstractEntityManagerImpl] Unable to mark for rollback on PersistenceException:

                java.lang.IllegalStateException: [com.arjuna.ats.internal.jta.transaction.arjunacore.nosuchtx] [com.arjuna.ats.internal.jta.transaction.arjunacore.nosuchtx] No such transaction!

                        at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.setRollbackOnly(BaseTransaction.java:191)

                        at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.setRollbackOnly(BaseTransactionManagerDelegate.java:123)

                        at org.hibernate.ejb.AbstractEntityManagerImpl.markAsRollback(AbstractEntityManagerImpl.java:421)

                        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:576)

                        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)

                        at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:202)

                        at org.drools.persistence.jpa.JpaPersistenceContext.findSessionInfo(JpaPersistenceContext.java:21)

                        at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:176)

                        at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:160)

                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method

                {code}

                 

                --

                Nick

                • 5. Re: [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.
                  José Luis Granda Newbie

                  Hi, I had the same problem. Fix it overwriting org.drools.persistence.info.WorkItemInfo, change

                   

                  private @Lob

                      byte[] workItemByteArray;

                   

                  by

                   

                  @Basic(fetch = FetchType.LAZY)

                      byte[] workItemByteArray;

                   

                  Hibernate change the column defitnition to workitembytearray bytea, and works for me

                  • 6. Re: [JDBCExceptionReporter] Large Objects may not be used in auto-commit mode.
                    Nick Tan Newbie

                    Thanks,

                     

                    this change bypass the "Large Objects' Error

                     

                    but I currently encounter another issue about "JPA, @Lob and PostgreSQL oid", I mean with the JPA, what the 'workItemByteArray' returned actually is the oid bytearray, but not the raw content data bytearray, i'm still investigate on it..

                     

                    some reference:

                    [1] http://virgo47.wordpress.com/2008/06/13/jpa-postgresql-and-bytea-vs-oid-type/

                    [2] http://jdbc.postgresql.org/documentation/publicapi/org/postgresql/largeobject/LargeObjectManager.html

                    [3] http://snipplr.com/view/53917/postgres-how-to-read-oid-value-using-jdbc-api/

                     

                    the bottom line is, use the PostgreSQL JDBC driver to access the real data bytearray with oid, i think