[JIRA] (HHH-16554) UnsupportedOperationException: CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements
by Ahmet Tanakol (JIRA)
Ahmet Tanakol ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDcxY2I2YTUy... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-16554?atlOrigin=eyJpIjoiZDcxY2... ) HHH-16554 ( https://hibernate.atlassian.net/browse/HHH-16554?atlOrigin=eyJpIjoiZDcxY2... ) UnsupportedOperationException: CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements ( https://hibernate.atlassian.net/browse/HHH-16554?atlOrigin=eyJpIjoiZDcxY2... )
Change By: Ahmet Tanakol ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
Hello Hibernate Team,
I was updating our SpringBoot version from 2.x to 3.x, and I am having trouble with starting our app. I created the tables by using liquibase in the past. When I start my application I see the below exception.
{code:java} Suppressed: java.lang.UnsupportedOperationException: CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements as well
at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:123) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:107) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.dialect.PostgreSQLDialect.getFallbackSqmInsertStrategy(PostgreSQLDialect.java:828) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]{code}
One of my entites looks like the following (I created the sequence in liquibase changelog file) ;
{noformat}import com.fasterxml.jackson.annotation.JsonIgnore;
import java.time.OffsetDateTime;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.UpdateTimestamp;
import org.hibernate.envers.Audited;
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Audited
public class PaymentAccount {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "payment_account_seq")
@GenericGenerator(
name = "payment_account_seq",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {@Parameter(name = "sequence_name", value = "payment_account_seq")})
@JsonIgnore
private Long id;
private String ciamId;
private String providerName;
private String providerUserId;
@CreationTimestamp
@Column(updatable = false)
private OffsetDateTime createdAt;
@UpdateTimestamp private OffsetDateTime updatedAt;
}
{noformat}
I couldn’t be sure what is causing this issue. I would appreciate if you can help me solve it. You can find the configuration I use below.
* hibernate-envers: 6.1.7.Final
* hibernate-core: 6.1.7.Final
* hibernate-commons-annotations:6.0.6.Final
* spring-boot-starter-data-jpa:3.0.6
* postgresql jdbc driver:42.5.4
* postgres 14
{noformat} datasource:
url: jdbc:postgresql://localhost:8086/mydb
username: admin
password: admin
driver-class-name: org.postgresql.Driver
hikari:
maximum-pool-size: 12
idle-timeout: 60000
pool-name: BackendHikariPool
connection-timeout: 45000
minimum-idle: 1
connection-test-query: SELECT 1
type: com.zaxxer.hikari.HikariDataSource
jpa:
show-sql: false
open-in-view: false
hibernate:
ddl-auto: none
properties:
org.hibernate.envers.do_not_audit_optimistic_locking_field: false
hibernate:
namingStrategy: org.hibernate.cfg.ImprovedNamingStrategy
dialect: org.hibernate.dialect.PostgreSQLDialect
hbm2ddl:
auto: none
temp:
use_jdbc_metadata_defaults: false
sql:
init:
continue-on-error: true
platform: org.hibernate.dialect.PostgreSQLDialect{noformat}
( https://hibernate.atlassian.net/browse/HHH-16554#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16554#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:f83bc8f )
2 years, 11 months
[JIRA] (HHH-16554) UnsupportedOperationException: CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements
by Ahmet Tanakol (JIRA)
Ahmet Tanakol ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZmFkOWZjOTdm... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-16554?atlOrigin=eyJpIjoiZmFkOW... ) HHH-16554 ( https://hibernate.atlassian.net/browse/HHH-16554?atlOrigin=eyJpIjoiZmFkOW... ) UnsupportedOperationException: CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements ( https://hibernate.atlassian.net/browse/HHH-16554?atlOrigin=eyJpIjoiZmFkOW... )
Change By: Ahmet Tanakol ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
Hello Hibernate Team,
I was updating our SpringBoot version from 2.x to 3.x, and I am having trouble with starting our app. I created the tables by using liquibase in the past. When I start my application I see the below exception.
{code:java} Suppressed: java.lang.UnsupportedOperationException: CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements as well
at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:123) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:107) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]
at org.hibernate.dialect.PostgreSQLDialect.getFallbackSqmInsertStrategy(PostgreSQLDialect.java:828) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]{code}
One of my entites looks like the following;
{noformat}import com.fasterxml.jackson.annotation.JsonIgnore;
import java.time.OffsetDateTime;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.UpdateTimestamp;
import org.hibernate.envers.Audited;
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Audited
public class PaymentAccount {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "payment_account_seq")
@GenericGenerator(
name = "payment_account_seq",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {@Parameter(name = "sequence_name", value = "payment_account_seq")})
@JsonIgnore
private Long id;
private String ciamId;
private String providerName;
private String providerUserId;
@CreationTimestamp
@Column(updatable = false)
private OffsetDateTime createdAt;
@UpdateTimestamp private OffsetDateTime updatedAt;
}
{noformat}
I couldn’t be sure what is causing this issue. I would appreciate if you can help me solve it. You can find the configuration I use below.
* hibernate-envers: 6.1.7.Final
* hibernate-core: 6.1.7.Final
* hibernate-commons-annotations:6.0.6.Final
* spring-boot-starter-data-jpa:3.0.6
* postgresql jdbc driver:42.5.4
* postgres 14
{noformat} datasource:
url: jdbc:postgresql://localhost:8086/mydb
username: admin
password: admin
driver-class-name: org.postgresql.Driver
hikari:
maximum-pool-size: 12
idle-timeout: 60000
pool-name: BackendHikariPool
connection-timeout: 45000
minimum-idle: 1
connection-test-query: SELECT 1
type: com.zaxxer.hikari.HikariDataSource
jpa:
show-sql: false
open-in-view: false
hibernate:
ddl-auto: none
properties:
org.hibernate.envers.do_not_audit_optimistic_locking_field: false
hibernate:
namingStrategy: org.hibernate.cfg.ImprovedNamingStrategy
dialect: org.hibernate.dialect.PostgreSQLDialect
hbm2ddl:
auto: none
temp:
use_jdbc_metadata_defaults: false
sql:
init:
continue-on-error: true
platform: org.hibernate.dialect.PostgreSQLDialect{noformat}
( https://hibernate.atlassian.net/browse/HHH-16554#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16554#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:f83bc8f )
2 years, 11 months