Unknown parameter direction.

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
t3marcin
Posts: 2
Joined: Mon 21 Jul 2014 15:59

Unknown parameter direction.

Post by t3marcin » Mon 21 Jul 2014 16:09

I have problem with PgSqlCommandBuilder.DeriveParameters function. Sometimes it throws an exception 'Unknown parameter direction.'.

Problem occurs quite rarely. When I get a first exception it throws always for all subsequent calls until I restart my application. After restart it works properly. I use version 6.8.322.

full stack trace

System.Exception: Unknown parameter direction.
at Devart.Data.PostgreSql.l.a (System.Data.Common.DbConnection A_0, System.String[] A_1) [0x00000] in <filename unknown>:0
at Devart.Data.PostgreSql.l.a (System.Data.Common.DbConnection A_0, Devart.Common.DbConnectionInternal A_1, System.String A_2, System.String[] A_3) [0x00000] in <filename unknown>:0
at Devart.Common.DbConnectionInternal.a (Devart.Common.DbConnectionBase A_0, System.String A_1, System.String[] A_2) [0x00000] in <filename unknown>:0
at Devart.Common.DbConnectionBase.GetSchema (System.String collectionName, System.String[] restrictionValues) [0x00000] in <filename unknown>:0
at Devart.Data.PostgreSql.PgSqlCommand.DescribeProcedure (System.String name) [0x00000] in <filename unknown>:0
at Devart.Common.DbCommandBase.CreateParameters () [0x00000] in <filename unknown>:0
at Devart.Data.PostgreSql.PgSqlCommand.c () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Devart.Data.PostgreSql.PgSqlCommand:c ()
at Devart.Data.PostgreSql.PgSqlCommandBuilder.DeriveParameters (Devart.Data.PostgreSql.PgSqlCommand command) [0x00000] in <filename unknown>:0
at #Zs.#Ys.#Us (Devart.Data.PostgreSql.PgSqlCommand #Vs, System.Object[] #Ws) [0x00000] in <filename unknown>:0
at #Zs.#Ys.#Xs (System.String #Ms, #Ns #Ns, System.Object[] #Ac) [0x00000] in <filename unknown>:0 at Devart.Data.PostgreSql.l.a (System.Data.Common.DbConnection A_0, System.String[] A_1) [0x00000] in <filename unknown>:0
at Devart.Data.PostgreSql.l.a (System.Data.Common.DbConnection A_0, Devart.Common.DbConnectionInternal A_1, System.String A_2, System.String[] A_3) [0x00000] in <filename unknown>:0
at Devart.Common.DbConnectionInternal.a (Devart.Common.DbConnectionBase A_0, System.String A_1, System.String[] A_2) [0x00000] in <filename unknown>:0
at Devart.Common.DbConnectionBase.GetSchema (System.String collectionName, System.String[] restrictionValues) [0x00000] in <filename unknown>:0
at Devart.Data.PostgreSql.PgSqlCommand.DescribeProcedure (System.String name) [0x00000] in <filename unknown>:0
at Devart.Common.DbCommandBase.CreateParameters () [0x00000] in <filename unknown>:0
at Devart.Data.PostgreSql.PgSqlCommand.c () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Devart.Data.PostgreSql.PgSqlCommand:c ()
at Devart.Data.PostgreSql.PgSqlCommandBuilder.DeriveParameters (Devart.Data.PostgreSql.PgSqlCommand command) [0x00000] in <filename unknown>:0
at #Zs.#Ys.#Us (Devart.Data.PostgreSql.PgSqlCommand #Vs, System.Object[] #Ws) [0x00000] in <filename unknown>:0
at #Zs.#Ys.#Xs (System.String #Ms, #Ns #Ns, System.Object[] #Ac) [0x00000] in <filename unknown>:0



SQL
SELECT pr.proname as name,
TYPNS.nspname AS Schema,
TYP.typname as ReturnType,
proargtypes as InParams,
pr.oid as FunctionOID,
proallargtypes as OutParams,
proargmodes as ArgumentModes,
proargnames as ArgumentNames
FROM pg_proc pr
JOIN pg_namespace TYPNS ON TYPNS.oid = pr.pronamespace
LEFT OUTER JOIN pg_type TYP ON TYP.oid = prorettype
WHERE proisagg = FALSE
AND TYPNS.nspname like E'%'
AND pr.proname like E'gethostslimit'
AND pg_get_userbyid(proowner)::varchar like E'%'
AND TYP.typname like E'%'
AND pr.oid = E'28444'
ORDER BY proname, FunctionOID;
RETURN

"name";"schema";"returntype";"inparams";"functionoid";"outparams";"argumentmodes";"argumentnames"
"gethostslimit";"public";"record";"2950";28444;"{2950,23,23}";"{i,o,o}";"{sessionuidparam,exitcode,hostslimit}"

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Unknown parameter direction.

Post by Pinturiccio » Tue 29 Jul 2014 09:57

Please provide us the following information for reproducing the issue:
1. PostgreSQL server version;
2. Region and language settings on the server and on the computer that runs the application;
3. The script of the stored procedure and all the objects that are used by the stored procedure.

t3marcin
Posts: 2
Joined: Mon 21 Jul 2014 15:59

Re: Unknown parameter direction.

Post by t3marcin » Tue 29 Jul 2014 10:41

1) PostgreSQL 9.2

2)
Data Base Linux
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
Connect String ;Charset=utf8;
Windows 2012
EN_US
Regional POLAND

3)
The problem with DeriveParameters occurs in different functions around every few hundred aplication starts and after restart of the application, works correctly. Script of all objects required to make a script of large database with many objects initiating content. Problem occurs with attempt of downloading a description of the procedure, not the same call.
Sample of the definition below.
CREATE OR REPLACE FUNCTION gethostslimit(IN sessionuidparam uuid, OUT exitcode integer, OUT hostslimit integer)
RETURNS SETOF record AS
$BODY$
DECLARE
...

BEGIN
......

END;$BODY$
LANGUAGE plpgsql VOLATILE
COST 100
ROWS 1000;
ALTER FUNCTION gethostslimit(uuid)
OWNER TO postgres;

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Unknown parameter direction.

Post by Pinturiccio » Tue 29 Jul 2014 15:13

Thank you for the provided information. We have made some changes in dotConnect for PostgreSQL that should fix the issue. These changes will be available in the next build of dotConnect for PostgreSQL, which we plan to release this week. We will post here when the corresponding build is available for download.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Unknown parameter direction.

Post by Pinturiccio » Thu 31 Jul 2014 15:25

New build of dotConnect for PostgreSQL 7.3.215 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=30076

Please notify us whether the issue is fixed in this build.

Post Reply