Subject Re: PrepardStatement field truncation
Author Roman Rokytskyy

> I think I've discovered a bug with PreparedStatement and the attempt
> to insert content below the maximal field length. This seems to
> waste the PreparedStatement.

Thanks for the bug report. Comments follow...

> What happens: The first Record is propperly inserted. The next
> insert fails with exception
> org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544794.
> operation was cancelled
> because FIELD3's max. length is exceeded.

Till now we checked length of the content in JayBird. However this did
not work for RDB$* tables for which you can pass max 10 chars in a
query instead of 31 (I would call this bug in metadata definition on
the server, but seems that engine developers are satisfied with the
situation). Therefore in 1.5 (probably in beta 3, maybe beta 2) I
removed client-side checking and we send all data to the server.
However, in case of exceeding max. length server should return
"Arithmetic or data truncation exception. Data truncated" (or
something similar), but not "operation was cancelled". This message
points on some internal problem within the server.

> All other inserts are surprisingly failing too: The next one (i==2)
> with exception

Seems that "operation was cancelled" belongs to so called "fatal"
exceptions, after which FBManagedConnectionFactory sees no sense to
continue. I will try to have a look, but currently I'm very busy, so
cannot promise any timeframe.