We are currently performing maintenance on Appian Community. As a result, discussions posts and replies are temporarily unavailable. We appreciate your patience.

Cannot Insert NULL Into DB Table Error

Certified Senior Developer

While trying to import a patch on 7.10 oracle I get the following error:
An error occurred while updating content [id=3477 uuid=_a-0000d925-a467-8000-4594-010000010000_13518]: org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update (APNX-1-4071-008)
com.appiancorp.ix.ConsumerException: type=content, srcId=_a-0000d925-a467-8000-4594-010000010000_13518, dstId=3477, cause=org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update; nested exception is javax.persistence.PersistenceException:

The patch was created on the same version and yet fails to import back in. Any inputs?
Thanks

OriginalPostID-206606

OriginalPostID-206606

  Discussion posts and replies are publicly visible

  • Can you attach the complete stack trace, including any 'caused by' clauses?
  • 0
    Certified Senior Developer
    Caused by: org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
              at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:321)
              at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
              at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:516)
              at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
              at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
              at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:387)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
              at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
              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 com.sun.proxy.$Proxy263.saveTestData(Unknown Source)
              at com.appiancorp.object.test.TestDataService.saveTestData(TestDataService.java:69)
              at com.appiancorp.object.test.SecuredTestDataService.saveTestData(SecuredTestDataService.java:67)
              at com.appiancorp.object.test.SecuredTestDataService.saveTestData(SecuredTestDataService.java:56)
              at com.appiancorp.ix.data.SupportsTestData.saveTestData(SupportsTestData.java:56)
              at com.appiancorp.ix.data.ContentHaul.saveTestData(ContentHaul.java:428)
              at com.appiancorp.ix.data.ContentHaul.update(ContentHaul.java:296)
              at com.appiancorp.ix.data.ContentHaul.update(ContentHaul.java:73)
              at com.appiancorp.ix.HaulImportConsumer.update(HaulImportConsumer.java:53)
              at com.appiancorp.ix.HaulImportConsumer.update(HaulImportConsumer.java:21)
              at com.appiancorp.ix.ImportConsumer.consume(ImportConsumer.java:42)
              ... 413 more
    Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
              at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1214)
              at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147)
              at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:81)
              at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:512)
              ... 434 more
    Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
  • 0
    Certified Senior Developer
    --------------------------------------------------------
    -- DDL for Table TEST_DATA
    --------------------------------------------------------

    CREATE TABLE "APPIANDEV"."TEST_DATA"
    (\t"ID" NUMBER(19,0),
    \t"UUID" VARCHAR2(255 CHAR),
    \t"OBJ_TYPE" VARCHAR2(255 CHAR),
    \t"OBJ_UUID" VARCHAR2(255 CHAR),
    \t"OBJ_VERSION_ID" NUMBER(19,0),
    \t"DATA_TYPE" VARCHAR2(255 CHAR),
    \t"DATA" CLOB
    ) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "APPIANDEV_USER_DATA"
    LOB ("DATA") STORE AS BASICFILE (
    TABLESPACE "APPIANDEV_USER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
    NOCACHE LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
    --------------------------------------------------------
    -- DDL for Index PK_TEST_DATA
    --------------------------------------------------------

    CREATE UNIQUE INDEX "APPIANDEV"."PK_TEST_DATA" ON "APPIANDEV"."TEST_DATA" ("ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "APPIANDEV_USER_DATA" ;
    --------------------------------------------------------
    -- DDL for Index SYS_C0011479
    --------------------------------------------------------

    CREATE UNIQUE INDEX "APPIANDEV"."SYS_C0011479" ON "APPIANDEV"."TEST_DATA" ("OBJ_UUID", "OBJ_VERSION_ID", "OBJ_TYPE")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "APPIANDEV_USER_DATA" ;
    --------------------------------------------------------
    -- Constraints for Table TEST_DATA
    --------------------------------------------------------

    ALTER TABLE "APPIANDEV"."TEST_DATA" ADD CONSTRAINT "PK_TEST_DATA" PRIMARY KEY ("ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "APPIANDEV_USER_DATA" ENABLE;

    ALTER TABLE "APPIANDEV"."TEST_DATA" MODIFY ("ID" NOT NULL ENABLE);

    ALTER TABLE "APPIANDEV"."TEST_DATA" MODIFY ("UUID" NOT NULL ENABLE);

    ALTER TABLE "APPIANDEV"."TEST_DATA" MODIFY ("OBJ_TYPE" NOT NULL ENABLE);

    ALTER TABLE "APPIANDEV"."TEST_DATA" MODIFY ("OBJ_UUID" NOT NULL ENABLE);

    ALTER TABLE "APPIANDEV"."TEST_DATA" MODIFY ("OBJ_VERSION_ID" NOT NULL ENABLE);

    ALTER TABLE "APPIANDEV"."TEST_DATA" MODIFY ("DATA_TYPE" NOT NULL ENABLE);

    ALTER TABLE "APPIANDEV"."TEST_DATA" MODIFY ("DATA" NOT NULL ENABLE);

    ALTER TABLE "APPIANDEV"."TEST_DATA" ADD UNIQUE ("OBJ_UUID", "OBJ_VERSION_ID", "OBJ_TYPE")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "APPIANDEV_USER_DATA" ENABLE;

  • 0
    Certified Senior Developer
    sorry, please ignore the above message.. I wanted to paste this one :
    Caused by: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("APPIANDEV"."TEST_DATA"."DATA")

              at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10070)
              at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:213)
              at org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1077)
              at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
              at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
              ... 443 more
  • The relevant line appears to be:

    Caused by: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("APPIANDEV"."TEST_DATA"."DATA")

    This is an error thrown by the Oracle database when you try to insert a null value into a column that does not allow nulls. The resolution is to either not use a null value or to update your table definition to allow it.