MSSQL Issue with datetime2

We are using Flowable 6.3.1 with MSSQL Server 2016 / mssql-jdbc driver 6.5.2.jre8-preview and are running into an issue with date/time fields. See: stack trace below. This looks like an entity/data type mismatch. I tried registering a dialect and setting all date/time types to datetime2 or datetime with no luck. The SQL DDL for the table is:

USE [Workflow]
GO

/****** Object: Table [dbo].[ACT_RU_TIMER_JOB] Script Date: 7/2/2018 5:19:12 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ACT_RU_TIMER_JOB](
[ID_] nvarchar NOT NULL,
[REV_] [int] NULL,
[TYPE_] nvarchar NOT NULL,
[LOCK_EXP_TIME_] NULL,
[LOCK_OWNER_] nvarchar NULL,
[EXCLUSIVE_] [bit] NULL,
[EXECUTION_ID_] nvarchar NULL,
[PROCESS_INSTANCE_ID_] nvarchar NULL,
[PROC_DEF_ID_] nvarchar NULL,
[SCOPE_ID_] nvarchar NULL,
[SUB_SCOPE_ID_] nvarchar NULL,
[SCOPE_TYPE_] nvarchar NULL,
[SCOPE_DEFINITION_ID_] nvarchar NULL,
[RETRIES_] [int] NULL,
[EXCEPTION_STACK_ID_] nvarchar NULL,
[EXCEPTION_MSG_] nvarchar NULL,
[DUEDATE_] NULL,
[REPEAT_] nvarchar NULL,
[HANDLER_TYPE_] nvarchar NULL,
[HANDLER_CFG_] nvarchar NULL,
[CUSTOM_VALUES_ID_] nvarchar NULL,
[CREATE_TIME_] datetime2 NULL,
[TENANT_ID_] nvarchar NULL,
PRIMARY KEY CLUSTERED
(
[ID_] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] ADD DEFAULT (’’) FOR [TENANT_ID_]
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] WITH CHECK ADD CONSTRAINT [ACT_FK_TIMER_JOB_CUSTOM_VALUES] FOREIGN KEY([CUSTOM_VALUES_ID_])
REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_])
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] CHECK CONSTRAINT [ACT_FK_TIMER_JOB_CUSTOM_VALUES]
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] WITH CHECK ADD CONSTRAINT [ACT_FK_TIMER_JOB_EXCEPTION] FOREIGN KEY([EXCEPTION_STACK_ID_])
REFERENCES [dbo].[ACT_GE_BYTEARRAY] ([ID_])
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] CHECK CONSTRAINT [ACT_FK_TIMER_JOB_EXCEPTION]
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] WITH CHECK ADD CONSTRAINT [ACT_FK_TIMER_JOB_EXECUTION] FOREIGN KEY([EXECUTION_ID_])
REFERENCES [dbo].[ACT_RU_EXECUTION] ([ID_])
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] CHECK CONSTRAINT [ACT_FK_TIMER_JOB_EXECUTION]
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] WITH CHECK ADD CONSTRAINT [ACT_FK_TIMER_JOB_PROC_DEF] FOREIGN KEY([PROC_DEF_ID_])
REFERENCES [dbo].[ACT_RE_PROCDEF] ([ID_])
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] CHECK CONSTRAINT [ACT_FK_TIMER_JOB_PROC_DEF]
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] WITH CHECK ADD CONSTRAINT [ACT_FK_TIMER_JOB_PROCESS_INSTANCE] FOREIGN KEY([PROCESS_INSTANCE_ID_])
REFERENCES [dbo].[ACT_RU_EXECUTION] ([ID_])
GO

ALTER TABLE [dbo].[ACT_RU_TIMER_JOB] CHECK CONSTRAINT [ACT_FK_TIMER_JOB_PROCESS_INSTANCE]
GO

Note the different column definitions for:
[LOCK_EXP_TIME_] NULL,
[CREATE_TIME_] datetime2 NULL

Is this a Flowable, Liquibase or Hibernate issue?

Thanks

Chris

######################## Error report ####################################################

Cause: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.

SQL: INSERT INTO ACT_RU_TIMER_JOB ( ID_, REV_, TYPE_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_, PROC_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_, RETRIES_, EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, CUSTOM_VALUES_ID_, CREATE_TIME_, TENANT_ID_) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) , (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Cause: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
at org.flowable.common.engine.impl.db.DbSqlSession.flushBulkInsert(DbSqlSession.java:470)
at org.flowable.common.engine.impl.db.DbSqlSession.flushInsertEntities(DbSqlSession.java:426)
at org.flowable.common.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:403)
at org.flowable.common.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:288)
at org.flowable.common.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:191)
at org.flowable.common.engine.impl.interceptor.CommandContext.close(CommandContext.java:61)
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:80)
at org.flowable.idm.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:49)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.flowable.idm.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:46)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
at org.flowable.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:97)
at org.flowable.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:209)
at org.flowable.spring.configurator.DefaultAutoDeploymentStrategy.deployResources(DefaultAutoDeploymentStrategy.java:61)
at org.flowable.spring.SpringProcessEngineConfiguration.autoDeployResources(SpringProcessEngineConfiguration.java:125)
at org.flowable.spring.SpringProcessEngineConfiguration.lambda$start$0(SpringProcessEngineConfiguration.java:213)
at java.util.ArrayList.forEach(Unknown Source)
at org.flowable.spring.SpringProcessEngineConfiguration.start(SpringProcessEngineConfiguration.java:213)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181)

This is a major blocker for use on a SQL Server database later than 2012 using the native MSSQL JDBC Driver.

Please help - anyone.

Thanks

Here is some more detail:
'### Error updating database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.
’ ### The error may involve org.flowable.job.service.impl.persistence.entity.TimerJobEntityImpl.bulkInsertTimerJob-Inline
'### The error occurred while setting parameters
'### SQL: INSERT INTO ACT_RU_TIMER_JOB ( ID_, REV_, TYPE_, EXCLUSIVE_, EXECUTION_ID_, PROCESS_INSTANCE_ID_, PROC_DEF_ID_, SCOPE_ID_, SUB_SCOPE_ID_, SCOPE_TYPE_, SCOPE_DEFINITION_ID_, RETRIES_, EXCEPTION_STACK_ID_, EXCEPTION_MSG_, DUEDATE_, REPEAT_, HANDLER_TYPE_, HANDLER_CFG_, CUSTOM_VALUES_ID_, CREATE_TIME_, TENANT_ID_) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) , (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
'### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.

We’re running SQL server 2016 in our QA environment and all tests run okay there.
I’m not sure if we use the same jdbc driver though.

Does the exception happens every time when a timer is created? Or is it a specific use case, anything that can help us to reproduce more easily?

The issue occurs when there is an incorrect or missing cron time definition. Resolved by putting a parsable cron time