Exec store with xml param have error: XML parsing after upgrade to 5.7.0

After update from 5.5.0 to 5.7.0. We have error: XML parsing: line 126, character 12, unexpected end of input, source: Core .Net SqlClient Data Provider, data: , stackTrace: at ServiceStack.OrmLite.OrmLiteExecFilter.<>c__DisplayClass6_01.<Exec>b__0(Task1 t) in C:\BuildAgent\work\27e4cc16641be8c0\src\ServiceStack.OrmLite\OrmLiteExecFilter.cs:line 121

Here is our code:

public async Task UpdateBatch(XElement data)
{
var result = await Db.SqlScalarAsync(“EXEC Pr_Update_Inventory_Tracking @xmlData”, new { xmlData = data.ToString() });
return result == 1;
}

How can we resolve it ?

Thanks

This suggests the string value of xmlData is invalid, what is the XML value of data.ToString()

Hi mythz,

It’s normal xml string, you can preview it in this link: https://pastebin.com/Hg3sp5Dr
Please note that with this data, in v5.5.0, we don’t get error. Our storeprocedure have a xml parameter like that: PROCEDURE [dbo].[Pr_Update_Inventory_Tracking] @xmlData XML = NULL

Hi mythz,

I think we have same problem with this: https://stackoverflow.com/questions/58402824/servicestack-ormlite-using-xml-fields-in-postgresql

After update to 5.7.1 and using XmlValue, the error has gone.

Thanks.

Ok thx, was testing this with SQL Server and couldn’t repro the issue, please specify the RDBMS in future.

If you could use XML datatype without specifying DbType.Xml previously then it’s likely a change in the underlying Npgsql provider.