[seasar-dotnet:2006] DBFlute.net PostgressqlでReturn値の受け取りでエラーが発生

samurai_bouzu [E-MAIL ADDRESS DELETED]
2011年 3月 29日 (火) 18:53:34 JST


お世話になります。清水と申します。

PostgreSQL(.8.4.4)のストアドファンクションのオブジェクトをDBFlute.NETから呼び出して利用しようとしておりますが、実行時にエラーが発生し実行できません。

ストアドファンクションは
CREATE OR REPLACE FUNCTION usp_createwk_correspondence_history(IN
"MailFlg" boolean, IN "PhoneFlg" boolean, IN "OfferFlg" boolean, IN
"FanMailFlg" boolean, IN "ReceiveDtFr" timestamp with time zone, IN
"ReceiveDtTo" timestamp with time zone, IN "InquiryCategoryCd" text,
IN "CustomerCd" text, IN "CustomerNm" text, IN "Phone" text, IN
"ProductCategoryACd" text, IN "ProductCategoryBCd" text, IN
"ProductCd" text, IN "PersonCd" text, IN "OfferCategoryACd" text, IN
"OfferCategoryBCd" text, IN "KeyWord1" text, IN "KeyWord2" text, IN
"KeyWord3" text, IN "KeyWord4" text, IN "KeyWord5" text, IN "KeyWord6"
text, IN "KeyWord7" text, IN "KeyWord8" text, IN "KeyWord9" text, IN
"KeyWord10" text, IN "KeyWord11" text, IN "KeyWord12" text, IN
"KeyWord13" text, IN "KeyWord14" text, IN "KeyWord15" text, IN
"KeyWord16" text, IN "KeyWord17" text, IN "KeyWord18" text, IN
"KeyWord19" text, IN "KeyWord20" text, IN "Address" text, IN
"HabitatCd" text)
RETURNS integer
  AS ....

return 1;

というものです。

C#側の呼び出しは以下です。
UspCreatewkCorrespondenceHistoryPmb pmb = new
UspCreatewkCorrespondenceHistoryPmb();
...

// Timeoutを無制限に設定
StatementConfig config = new StatementConfig();
config.QueryTimeout(0);

inquiryInfoBhv.OutsideSql().Configure(config).Call(pmb);


実行した際の例外は
XXX.DBFlute.AllCommon.Exp.SQLFailureException がキャッチされました
  Message="Look! Read the message below.\n/* * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * *\nThe SQL failed to
execute!\n\n[Advice]\nPlease confirm the Exception
message.\n\n[Exception]\nSystem.ArgumentException\n型 'System.DBNull'
のオブジェクトを型 'System.Nullable`1[System.Int32]'
に変換できません。\n\n[OutsideSqlPath]\nusp_createwk_correspondence_history\n\n[ParameterBean]\nXXX.DBFlute.ExDao.PmBean.UspCreatewkCorrespondenceHistoryPmb\nUspCreatewkCorrespondenceHistoryPmb:{,
True, True, False, False, 2010/03/30 0:00:00, 2011/03/29 0:00:00, , ,
, , 00, , , , , , , , , , , , , , , , , , , , , , , , , , , ,
}\n\n[Statement]\nNpgsql.NpgsqlCommand\n* * * * * * * * * */"
  Source="XXX.DBFlute"
  StackTrace:
       場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlHandler.DbExceptionHandler.ThrowSQLFailureException(Exception
e, IDbCommand cmd, String displaySql)
       場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlHandler.DbExceptionHandler.HandleDbException(Exception
e, IDbCommand cmd, Boolean uniqueConstraintValid, String displaySql)
       場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlHandler.InternalBasicHandler.HandleDbException(Exception
e, IDbCommand cmd, Boolean uniqueConstraintValid)
       場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlHandler.InternalProcedureHandler.Execute(IDbConnection
conn, Object[] args, Type[] argTypes)
       場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlHandler.InternalBasicSelectHandler.Execute(Object[]
args, Type[] argTypes)
       場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlHandler.InternalBasicSelectHandler.Execute(Object[]
args)
       場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlCommand.InternalProcedureCommand.Execute(Object[]
args)
       場所 XXX.DBFlute.AllCommon.S2Dao.S2DaoInterceptor.DispatchInvoking(IMethodInvocation
invocation)
       場所 XXX.DBFlute.AllCommon.S2Dao.S2DaoInterceptor.Invoke(IMethodInvocation
invocation)
       場所 Seasar.Framework.Aop.Proxy.DynamicAopProxy.Intercept(IInvocation
invocation, Object[] args)
       場所 ProxyInterfaceSystemSystemObject_XXX_DBFlute_AllCommon_CBean_OutsideSqlOutsideSqlDao_System_Runtime_SerializationISerializable.Call(String
path, Object pmb, OutsideSqlOption option)
       場所 XXX.DBFlute.AllCommon.CBean.OutsideSql.Executor.OutsideSqlBasicExecutor.Call(ProcedurePmb
pmb)
       場所 MsiApp.CustomerCenter.XXX.Appli.DHM1010.Service.DHM1010Service.GetHistoryInfoListDataTable()
場所 D:\XXX\PROG\CustomerCenter\XXX\Appli\Source\DH0101001_対応履歴検索\DHM1010\Service\DHM1010Service.cs:行
452
  InnerException: System.ArgumentException
       Message="型 'System.DBNull' のオブジェクトを型
'System.Nullable`1[System.Int32]' に変換できません。"
       Source="mscorlib"
       StackTrace:
            場所 System.RuntimeType.CheckValue(Object value, Binder
binder, CultureInfo culture, BindingFlags invokeAttr)
            場所 System.Reflection.MethodBase.CheckArguments(Object[]
parameters, Binder binder, BindingFlags invokeAttr, CultureInfo
culture, Signature sig)
            場所 System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean skipVisibilityChecks)
            場所 System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture)
            場所 System.Reflection.RuntimePropertyInfo.SetValue(Object
obj, Object value, BindingFlags invokeAttr, Binder binder, Object[]
index, CultureInfo culture)
            場所 System.Reflection.RuntimePropertyInfo.SetValue(Object
obj, Object value, Object[] index)
            場所 XXX.DBFlute.AllCommon.S2Dao.InternalProcedureParameterType.SetValue(Object
dto, Object value)
            場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlHandler.InternalProcedureHandler.HandleOutParameters(IDbCommand
dbCommand, Object dto, Object returnValue)
            場所 XXX.DBFlute.AllCommon.S2Dao.Internal.SqlHandler.InternalProcedureHandler.Execute(IDbConnection
conn, Object[] args, Type[] argTypes)
       InnerException:

なにか、ファンクションの作成方法、または、DBFluteでの呼び出し方法に誤りがあるのでしょうか。
よろしくお願いいたします。


seasar-dotnet メーリングリストの案内