Title:
JDBC driver fails on updating entities with NULL bit fields in MSQL: specified SQL type is not supported by this driver.
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/Duplicate
Reporter/Name(from Bugbase): Samuel Knowlton / Samuel Knowlton (Samuel Knowlton)
Created: 05/14/2014
Components: Database
Versions: 11.0
Failure Type: Crash
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Critical / All users will encounter
Locale/System: ALL / Win 2012 Server x64
Vote Count: 0
Duplicate ID: CF-3518916
Problem Description: When trying to update an entity inside a transaction, if the entity contains a
Steps to Reproduce:
Create an MS-SQL table as follows:
testID (uniqueidentifier, not null, default newID(), primary key)
bitfield (nullable, no default)
bitFieldNotNull (not nullable, default 0)
label (varchar (50), nullable)
counter (int, nullable)
Add two records: one with bitfield NULL and the label noBitField and one with bitfield 1 and the label hasBitField. Let bitFieldNotNull default to 0 and leave counter null.
Create a persistent CFC called Testme as follows:
component table="testme" output="false" extends="inleague.model.ORM.Entity" schema="dbo" persistent="true" {
property name="testID" column="testID" fieldtype="id" generator="guid" type="string" ormtype="string";
property name="bitField" column="bitfield" type="boolean" ormtype="boolean";
property name="bitFieldNotNull" column="bitFieldNotNull" ormtype="boolean" type="boolean";
property name="label" column="label" ormtype="string" type="string";
property name="counter" column="counter" ormtype="int" type="numeric";
}
("label" doesn't do anything but help me keep track of what's going on).
Run the following code:
<cfscript>
tests = EntityLoad("testme");
counter = 1;
transaction {
for (x in tests) {
writedump(x);
x.setCounter(1);
EntitySave(x);
counter++;
}
}
</cfscript>
Actual Result: Error: An exception occurred when committing the transaction. The root cause of this exception was: coldfusion.orm.hibernate.HibernateSessionException: [macromedia][SQLServer JDBC Driver]The specified SQL type is not supported by this driver..
Expected Result: Counter should be updated on the entity. A bit field that is nullable and whose value is NULL should not impact anything.
Any Workarounds: Stop using bit fields with NULL values? This works fine in CF9 and CF10.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3760484
External Customer Info:
External Company:
External Customer Name: Aquitaine
External Customer Email:
External Test Config: My Hardware and Environment details: CF 11 Standard (developer edition currently running in enterprise/trial mode) on Windows x64 and Microsoft SQL Server v11.0.3128 Standard
Attachments:
Comments: