Skip to main content
atuls
February 28, 2023
Question

Oracle Sequence in CDT

  • February 28, 2023
  • 1 reply
  • 0 views

Hi,

There is a CDT which is calling a Sequence in Oracle as a primary key. Below is the extract from CDT.

<xsd:element name="recordId" nillable="true" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@Column(name="RECORD_ID") @Id @GeneratedValue @SequenceGenerator(name="sequence", sequenceName="A_RECORD_ID", allocationSize=1)</xsd:appinfo>
</xsd:annotation>
</xsd:element>

For some reason, when we are trying to insert data in the table some other sequence is being called and we are getting "Unique key Violation". We are able to identify that sequence but not able to figure how this is happening. We could not find any trigger in the table.

Any pointers would be highly appreciated.

    1 reply

    March 1, 2023

    Try...

    @Column(name="RECORD_ID") @Id @SequenceGenerator(name="aseq", sequenceName="A_RECORD_ID") 
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="aseq")