ClassCastExceptions and unsupported class type errors thrown on SQL server upgrade
Description
is related to
relates
Activity
Show:

Matthew LeeAugust 17, 2012 at 5:02 PM
Committed on:
Portal 6.1.x CE GIT ID: 7a3340462525b9923f71dc10267c3c4d1c7d4217.
Portal 6.2.x GIT ID: 1a0dd31b6954da3b104c2539937d839f9f18b5c2.
Fixed
Details
Assignee
Michael SaechangMichael Saechang(Deactivated)Reporter
Minhchau DangMinhchau DangBranch Version/s
6.1.xBackported to Branch
CommittedGit Pull Request
Components
Fix versions
Affects versions
Priority
Medium
Details
Details
Assignee

Reporter

Branch Version/s
6.1.x
Backported to Branch
Committed
Git Pull Request
Components
Fix versions
Affects versions
Priority
Zendesk Support
Linked Tickets
Zendesk Support
Linked Tickets
Zendesk Support

Linked Tickets
Created July 23, 2012 at 10:05 AM
Updated June 24, 2023 at 3:51 PM
Resolved October 4, 2012 at 3:18 PM
When document library entries are added to the database, DLFileEntryVersionUpgradeColumnImpl in the 6.0.0 upgrade throws an exception because the default type is NULL, which causes it to retrieve a STRING even though it can sometimes be a DOUBLE. While this is not a problem on most servers, the new code to handle SQL Server upgrades is sensitive to the actual type. Should update this code to be less sensitive to the actual database type to avoid making upgrades too brittle.
If a date is null, StringPool.NULL will be passed to DateUpgradeColumnImpl.getNewValue(), resulting in a ClassCastException because it assumes that all values passed to the method will be dates.
Some SQL Server databases throw an "Upgrade code using unsupported class type 2" exception, which corresponds to the NUMERIC type. Need to add support for NUMERIC type for upgrade process. Only instance of this so far was the for a BIGINT column, so using that as the assumption for what it usually means.