On 04/24/10 17:18, Doug McGavin wrote: > I am using the latest version of Derby with Hibernate and getting the > following error when trying to save an image (the exact same code works > with MySQL) : > > [7613...@qtp0-8] ERROR util.JDBCExceptionReporter - > > A truncation error was encountered trying to shrink VARCHARTA > 'XX-RESOLVE-XX' to length 255. > > I have read that this is a known bug but I don't seem to be able to find > how it was resolved or how to work around it in my code.
Hi Doug, I think this error means you're trying to insert a string that's longer than 255 characters into a VARCHAR(255) column. Derby will try to truncate the string if it has trailing spaces, but the above exception will be thrown if that's not enough to make it fit in the column. In Derby 10.5 and later, the error message should show the string you're trying to insert instead of the rather cryptic string 'XX-RESOLVE-XX'. (The error message was changed in DERBY-961.) -- Knut Anders
