3 Replies Latest reply on Feb 19, 2006 6:39 PM by aguizar

    JBPM byte array constraint violation

    rslayer

      Does anyone know as to why this error will occur in JBPM?

      org.hibernate.exception.ConstraintViolationException: could not insert collection: [org.jbpm.bytes.ByteArray.byteBlocks#262]

      INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_BYTEBLOCK_FILE'. The conflict occurred in database 'DEVUTIL', table 'JBPM_BYTEARRAY', column 'ID_'.
      



      I never touch any of the JBPM tables in the code. Why would the jbpm byte array table give this problem? any help will be appreciated in this matter.

      thanks!

        • 1. Re: JBPM byte array constraint violation
          aguizar

          It could be an issue specific to the database you use. Please describe the jBPM version, database and driver you are using, and post the full stack trace. A small test case showing the kind of data you are trying to save would also help a lot.

          • 2. Re: JBPM byte array constraint violation
            rslayer

            Here is the information:

            JBPM Vesion 3.0.2
            DataBase SQL Server 8

            And here is the stack trace

            <Caused by: org.hibernate.exception.ConstraintViolationException: could not insert collection: [org.jbpm.bytes.ByteArray.byteBlocks#238]
            < at org.hibernate.exception.SQLStateConverter.convert(Ljava/sql/SQLException;Ljava/lang/String;Ljava/lang/String;)Lorg/hibernate/JDBCException;(SQLStateConverter.java:63)
            < at org.hibernate.exception.JDBCExceptionHelper.convert(Lorg/hibernate/exception/SQLExceptionConverter;Ljava/sql/SQLException;Ljava/lang/String;Ljava/lang/String;)Lorg/hibernate/JDBCException;(JDBCExceptionHelper.java:43)
            < at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(Lorg/hibernate/collection/PersistentCollection;Ljava/io/Serializable;Lorg/hibernate/engine/SessionImplementor;)V(AbstractCollectionPersister.java:935)
            < at org.hibernate.action.CollectionRecreateAction.execute()V(CollectionRecreateAction.java:23)
            < at org.hibernate.engine.ActionQueue.execute(Lorg/hibernate/action/Executable;)V(ActionQueue.java:239)
            < at org.hibernate.engine.ActionQueue.executeActions(Ljava/util/List;)V(ActionQueue.java:223)
            < at org.hibernate.engine.ActionQueue.executeActions()V(ActionQueue.java:140)
            < at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(Lorg/hibernate/engine/SessionImplementor;)V(AbstractFlushingEventListener.java:274)
            < at org.hibernate.event.def.DefaultFlushEventListener.onFlush(Lorg/hibernate/event/FlushEvent;)V(DefaultFlushEventListener.java:27)
            < at org.hibernate.impl.SessionImpl.flush()V(SessionImpl.java:730)
            < at org.jbpm.db.JbpmSession.commitTransaction()V(JbpmSession.java:102)
            < ... 7 more
            <Caused by: java.sql.SQLException: [DataDirect][SQLServer JDBC Driver][SQLServer]INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_BYTEBLOCK_FILE'. The conflict occurred in database 'R21DEVUTIL', table 'JBPM_BYTEARRAY', column 'ID_'.
            < at com.ddtek.jdbc.base.BaseExceptions.createException(Ljava/lang/String;Ljava/lang/String;I)Ljava/sql/SQLException;(Unknown Source)
            < at com.ddtek.jdbc.base.BaseExceptions.getException(Ljava/sql/SQLException;II[Ljava/lang/String;Ljava/lang/String;I)Ljava/sql/SQLException;(Unknown Source)
            < at com.ddtek.jdbc.sqlserver.tds.TDSRequest.processErrorToken()V(Unknown Source)
            < at com.ddtek.jdbc.sqlserver.tds.TDSRequest.processReplyToken(BLcom/ddtek/jdbc/base/BaseWarnings;)Z(Unknown Source)
            < at com.ddtek.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(BLcom/ddtek/jdbc/base/BaseWarnings;)Z(Unknown Source)
            < at com.ddtek.jdbc.sqlserver.tds.TDSRequest.processReply(ILcom/ddtek/jdbc/base/BaseWarnings;)V(Unknown Source)
            < at com.ddtek.jdbc.sqlserver.SQLServerImplStatement.getNextResultType()I(Unknown Source)
            < at com.ddtek.jdbc.base.BaseStatement.commonTransitionToState(I)V(Unknown Source)
            < at com.ddtek.jdbc.base.BaseStatement.postImplExecute(Z)V(Unknown Source)
            < at com.ddtek.jdbc.base.BasePreparedStatement.postImplExecute(Z)V(Unknown Source)
            < at com.ddtek.jdbc.base.BaseStatement.commonExecute()V(Optimized Method)
            < at com.ddtek.jdbc.base.BaseStatement.executeUpdateInternal()I(Unknown Source)
            < at com.ddtek.jdbc.base.BasePreparedStatement.executeUpdate()I(Unknown Source)
            < at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate()I(PreparedStatement.java:147)
            < at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(I)V(NonBatchingBatcher.java:22)
            < at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(Lorg/hibernate/collection/PersistentCollection;Ljava/io/Serializable;Lorg/hibernate/engine/SessionImplementor;)V(AbstractCollectionPersister.java:916)


            Thanks for the help!

            • 3. Re: JBPM byte array constraint violation
              aguizar

              What about the data you are trying to save?