简体   繁体   中英

FF4j + MS SQL : Getting "operand type clash datetime2 is incompatible with timestamp" Exception

My Project Structure: Spring Boot + DB : MS SQL + FF4j (FeatureStoreSpringJdbc)

Created the table schema as below url https://github.com/ff4j/ff4j/blob/master/ff4j-core/src/main/resources/schema-ddl.sql

Getting "operand type clash datetime2 is incompatible with timestamp" Exception when accessing "/api/ff4j" rest api Is there any way to resolve this issue

Exception StackTrace: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT count(EVT_UUID) as NB, EVT_NAME FROM FF4J_AUDIT WHERE (EVT_TYPE LIKE 'feature') AND (EVT_ACTION LIKE 'checkOn') AND (EVT_TIME> ?) AND (EVT_TIME< ?) GROUP BY EVT_NAME]; SQL state [S0002]; error code [206]; Operand type clash: datetime2 is incompatible with timestamp; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Operand type clash: datetime2 is incompatible with timestamp

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)

at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1443)

at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:669)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:700)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:768)

at org.ff4j.springjdbc.store.EventRepositorySpringJdbc.computeHitCount(EventRepositorySpringJdbc.java:151)

at org.ff4j.springjdbc.store.EventRepositorySpringJdbc.getFeatureUsageHitCount(EventRepositorySpringJdbc.java:119)

at org.ff4j.audit.repository.AbstractEventRepository.getFeatureUsagePieChart(AbstractEventRepository.java:58)

at org.ff4j.services.domain.EventRepositoryApiBean.initialize(EventRepositoryApiBean.kt:55)

at org.ff4j.services.domain.EventRepositoryApiBean.(EventRepositoryApiBean.kt:46)

at org.ff4j.services.domain.FF4jStatusApiBean.(FF4jStatusApiBean.kt:66)

at org.ff4j.services.FF4jServices.getStatus(FF4jServices.kt:40)

at org.ff4j.spring.boot.web.api.resources.FF4jResource.getStatus(FF4jResource.kt:55)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

It is fixed by changing the query for MsSql and new script also added.

Please refer : https://github.com/ff4j/ff4j/issues/456

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM