Class FBWorkaroundStringField

java.lang.Object
org.firebirdsql.jdbc.field.FBField
org.firebirdsql.jdbc.field.FBWorkaroundStringField

public final class FBWorkaroundStringField extends FBField
Class implementing workaround for "operation was cancelled" bug in server. When we send some string data exceeding maximum length of the corresponding field causes "operation was cancelled" in remote module of the server instead of "arithmetic exception..." error. This makes code debugging harder, since error message is not very informative.

However we cannot simply check length locally. Maximum allowed length in bytes is connected with the character set of the field as defined lengh * maximum number of bytes per character in that encoding. However this does not work for system tables which have defined length 31, character set UNICODE_FSS and maximum allowed length of 31 (instead of 31 * 3 = 63).

Until this bug is fixed in the engine we will simply check if field belongs to the system table and do not throw data truncation error locally.

Author:
Roman Rokytskyy, Mark Rotteveel