Discussion:
XML functions
(too old to reply)
f***@gmail.com
2014-12-09 13:13:15 UTC
Permalink
Hi community.

Do you have experience in using XML functionality? There are a sample .NET program and stored procedure later in this topic. The problem is - the program starts 100 parallel threads with test_existsnode functions. As a result existsnode function execution time grows till more than 30 seconds and the program receives {"ERROR [HY000] [Informix .NET provider][Informix]Function (existsnode) Exception received for ICU memory allocation."}. Perhaps I am doing something wrong. Another possible way for problem resolving is to use any alternative way - working datablade module (also commercial) or use any self-made module (but also working). Please comment.

Regards, L.
f***@gmail.com
2014-12-09 13:14:16 UTC
Permalink
Promised .NET program:

public static void test_existsnode()
{

try
{
var x = new List<int>();
for (var i = 0; i < 100; i++)
{
x.Add(i);
}

Parallel.ForEach(x, (i) =>
{
using (var db = new Db("test_existsnode", i))
{
var dr = db.Reader;
while (dr.Read())
{
}
}
});
}
catch (Exception ex)
{
throw ex;
}
}
f***@gmail.com
2014-12-09 13:15:34 UTC
Permalink
Promised stored procedure:

CREATE PROCEDURE test_existsnode(p_i INT) RETURNING INT;
DEFINE v_i INT;
FOR v_i IN (1 TO 1000)
RETURN p_i WITH RESUME;
RETURN v_i WITH RESUME;
RETURN existsnode('<decl_plan><row><id_nodoklmaks>990969903</id_nodoklmaks></row></decl_plan>','/decl_plan') WITH RESUME;
RETURN existsnode('<decl_plan><row><id_nodoklmaks>990969903</id_nodoklmaks></row></decl_plan>','/decl_plan/row[1]/id_nodoklmaks') WITH RESUME;
RETURN existsnode('<decl_plan><row><id_nodoklmaks>990969903</id_nodoklmaks></row></decl_plan>','/decl_plan/row[2]/id_nodoklmaks') WITH RESUME;
RETURN extractvalue('<decl_plan><row><id_nodoklmaks>990969903</id_nodoklmaks></row></decl_plan>','/decl_plan/row[1]/id_nodoklmaks') WITH RESUME;
RETURN extractvalue('<decl_plan><row><id_nodoklmaks>990969903</id_nodoklmaks></row></decl_plan>','/decl_plan/row[2]/id_nodoklmaks') WITH RESUME; -- nav vērtība
END FOR;
END PROCEDURE;

Loading...