Good morning.
We are having problems when trying to save a serialized object as xml in a blob
field.
The definition of the table is as follows:
CREATE TABLE TPROPIEDADESPERSONA
(
Integer IDENTITY NOT NULL,
RespondentID Integer NOT NULL,
IDPROPIEDAD Integer NOT NULL,
ID Integer NOT NULL,
DATE NOT NULL Timestamp,
DESCRIPTION VARCHAR255NULL,
IDPRESTADOR Integer NOT NULL,
POSITION Integer,
MASCARA Integer NOT NULL,
Blob INFOADICIONAL sub_type 1
Timestamp FechaAlta NOT NULL,
IDLOGINALTA Integer NOT NULL,
ULTIMAMODIF Timestamp,
IDLOGINULTIMAMODIF Integer,
PRIMARY KEY (IDENTITY, RespondentID, IDPROPIEDAD, ID)
);
Everything is with firebird 3 and the latest version of FirebirdClient.dll
(5.1.1)
The multiturnos.xml file contains an example of serialized object and it is
only the effects you see that's what we're keeping (basically a string of about
32KB). This object contains the reference to the file list (the definition of
the location and then go for them and get the bytes and so to download). This
according to the logic of the system in question.
However, when the object to serialize is small (the information of 3 or 4 files
for example) everything works fine. but when it grows you get the error:
"Arithmetic exception, numeric overflow, or string truncation \ r \ nSTRING
right truncation"
The portion of code is as follows:
// aux
public override DbCommand crearComandoConConexion (stmt string, bool
abreConexion, DbConnection Connection, DbTransaction transaction)
{
var result = new FbCommand (stmt, as FbConnection connection, as
FbTransaction transaction);
result.CommandTimeout = 0;
if (abreConexion conexion.State &&! = ConnectionState.Open)
result.Connection.Open ();
return result;
}
// aux
FbParameter private agregarInfoAdicional (FbCommand cmd, string string, string
nombreParam = "@infoAdicional")
{
var cmd.CreateParameter p = ();
p.ParameterName = nombreParam;
p.FbDbType = FbDbType.Text;
p.Value = string;
return p;
}
// aux
private void armarParametrosPropiedadesPersona (PropiedadPersona property, id
int, int idLogin, FbCommand / * DbCommand * / cmd)
{
cmd.agregar ( "@ identity" propiedad.idEntidad);
cmd.agregar ( "@ RespondentID" propiedad.idPersona);
cmd.agregar ( "@ idPropiedad" propiedad.idPropiedad);
cmd.agregar ( "@ id", id);
cmd.agregar ( "@ date" propiedad.fecha);
if (! string.IsNullOrEmpty (propiedad.descripcion))
cmd.agregar ( "@ description" propiedad.descripcion);
else
cmd.agregar ( "@ description", null);
cmd.agregar ( "@ idPrestador" propiedad.idPrestador);
if (propiedad.posicion> 0)
cmd.agregar ( "@ position" propiedad.posicion);
else
cmd.agregar ( "@ position", null);
cmd.agregar ( "@ mask" propiedad.mascara);
cmd.Parameters.Add (agregarInfoAdicional (cmd,
propiedad.infoAdicional.ToString ()));
cmd.agregar ( "@ idLogin" idLogin);
}
// ------------------
// ------------------
This is the method Where the mistake OCCURS
FbConnection connection ....
......
using (FbTransaction tr = conexion.BeginTransaction ()) {
....
....
using (var cmd = crearComando (stmt, true, connection, tr) as FbCommand) //
defined above for your understanding
{
armarParametrosPropiedadesPersona (property, result,
idLogin, cmd); // defined above for your understanding
cmd.ExecuteNonQuery (); // Exception !!!
}
------------------------------------------------------------------------------
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider