-
Bug
-
Resolution: Done
-
Major
-
17.0.1.Final
-
None
The DatabaseTimerPersistence class' identifyDialect method [1] only recognizes the "microsoft" driver when it should also recognize the "mssql" driver, similar to how the code checks for both "hsql" and "hypersonic".
The result of this is that instead of the "create-table.mysql" property being loaded from timer-sql.properties [2], the default "create-table" property is used.
The repercussion of that is that the TIMESTAMP column type is used instead of the DATETIME2 column type when creating the table, which results in the error "WFLYEJB0163: Cannot create table for timer persistence: com.microsoft.sqlserver.jdbc.SQLServerException: A table can only have one timestamp column. Because table 'JBOSS_EJB_TIMER' already has one, the column 'NEXT_DATE' cannot be added." Similar reports can be found all over the internet, for example, here: [3]
We ran into this problem when trying to fix RHPAM-2002. Please read the comments from this point forward: [4]
I think the fix would be as simple as changing this line:
}else if (name.toLowerCase().contains("microsoft")) {
to this:
}else if (name.toLowerCase().contains("mssql") || name.toLowerCase().contains("microsoft")) {
[3] https://stackoverflow.com/questions/12063850/multiple-timestamp-columns-in-sql-server-2000/12063938
- blocks
-
RHPAM-2260 Remove MSSQL externaldb ejb3 timer SQL workaround
- Closed
- causes
-
RHPAM-2002 Some external databases fail when using externaldb template
- Closed
- is cloned by
-
JBEAP-17172 (7.2.z) DatabaseTimerPersistence does not detect mssql driver type
- Closed