You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Maxim Solodovnik <so...@gmail.com> on 2021/06/30 06:38:38 UTC

Weird error with Oracle DB

Hello All

recently we got Oracle related JIRA, so I've set up dockerized
`oracle/database:18.4.0-xe`
and got

Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-32795:
cannot insert into a generated always identity column
 {stmnt 1575460247 CREATE OR REPLACE TRIGGER address_id_TRG BEFORE INSERT
ON address FOR EACH ROW BEGIN SELECT address_id_SEQ.nextval INTO :new.id
FROM DUAL; END address_id_TRG;} [code=32795, state=99999]
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:203)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:58)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingStatement.executeUpdate(LoggingConnectionDecorator.java:955)
at
org.apache.openjpa.lib.jdbc.DelegatingStatement.executeUpdate(DelegatingStatement.java:123)
at
org.apache.openjpa.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:1383)
at
org.apache.openjpa.jdbc.schema.SchemaTool.createTable(SchemaTool.java:1122)
at
org.apache.openjpa.jdbc.schema.SchemaTool.buildSchema(SchemaTool.java:664)
at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:565)
at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:400)
at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:372)
at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:571)

The issue is reproducible with openjpa 3.2.0 latest
Everything works as expected with 3.1.2

Entity definition:
https://github.com/apache/openmeetings/blob/master/openmeetings-db/src/main/java/org/apache/openmeetings/db/entity/user/Address.java#L37

seems to be a regression :(


-- 
Best regards,
Maxim