@Modifying
@Query(value = """
INSERT INTO operational_day (
operday_date,
client_type,
is_active
)
VALUES (
:operdayDate,
:clientType,
NULL
)
ON CONFLICT (operday_date, client_type) DO NOTHING
""",
nativeQuery = true)
int insertIfNotExists(
@Param("operdayDate") LocalDate operdayDate,
@Param("clientType") String clientType
);
@Modifying
@Query(value = """
INSERT INTO operational_day (
operday_date,
client_type,
is_active
)
VALUES (
:operdayDate,
:clientType,
NULL
)
ON CONFLICT (operday_date, client_type, created_at) DO NOTHING
""",
nativeQuery = true)
int insertIfNotExists(
@Param("operdayDate") LocalDate operdayDate,
@Param("clientType") String clientType
);
org.springframework.transaction.UnexpectedRollbackException: Transaction silently rolled back because it has been marked as rollback-only