Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix o.s.d.DataIntegrityViolationException in /api/offenders/ #943

Open
boydingham opened this issue Jun 10, 2021 · 0 comments
Open

Fix o.s.d.DataIntegrityViolationException in /api/offenders/ #943

boydingham opened this issue Jun 10, 2021 · 0 comments

Comments

@boydingham
Copy link

Expected Behavior

When the /api/offenders/ endpoint is called, an OFFENDERS record should be created in persistent storage.

Current Behavior

The system fails to create the OFFENDERS record...

...

Hibernate: insert into offenders (create_datetime, create_user_id, modify_datetime, modify_user_id, audit_additional_info, audit_client_ip_address, audit_client_user_id, audit_client_workstation_name, audit_module_name, audit_timestamp, audit_user_id, birth_date, caseload_type, create_date, race_code, first_name, sex_code, id_source_code, last_name, last_name_alpha_key, last_name_key, last_name_soundex, middle_name, middle_name_2, name_sequence, offender_id_display, root_offender_id, suffix, title, offender_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

...

org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:276)
...

Caused by: org.hsqldb.HsqlException: integrity constraint violation: NOT NULL check constraint; SYS_CT_10479 table: OFFENDERS column: CREATE_USER_ID
        at org.hsqldb.error.Error.error(Unknown Source)
        at org.hsqldb.Table.enforceRowConstraints(Unknown Source)
        at org.hsqldb.Table.generateAndCheckData(Unknown Source)
        at org.hsqldb.Table.insertSingleRow(Unknown Source)
        at org.hsqldb.StatementDML.insertSingleRow(Unknown Source)
        at org.hsqldb.StatementInsert.getResult(Unknown Source)
        at org.hsqldb.StatementDMQL.execute(Unknown Source)
        at org.hsqldb.Session.executeCompiledStatement(Unknown Source)
        at org.hsqldb.Session.execute(Unknown Source)
        ... 175 common frames omitted

Context

The DDL for the CREATE_USER_ID column is...

...
CREATE_USER_ID                VARCHAR2(40) DEFAULT USER         NOT NULL
...

Steps to Reproduce

  1. Call the /api/offenders/ endpoint (see also OffenderResource#createPrisoner).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant