[seasar-dotnet:1843] 【DBFlute】外だしSQLのカーソル検索でInsert
Sumio Mori
[E-MAIL ADDRESS DELETED]
2010年 10月 8日 (金) 18:37:29 JST
はじめまして。
森と申します。
現在、DBFlute.NETを利用して開発しておりますが、
外だしSQLのカーソル検索を利用した部分で、
エラーが発生し、足踏みしております。
以下がサンプルです。
何か分かりましたら教えて頂けると助かります。
よろしくお願い致します。
※他にも必要な情報がありましたらご指摘ください
■サンプルコード
※_HogeBhvはQuill管理
// 抽出レコードごとの処理を定義
HogeCursorHandler handler = new HogeCursorHandler(
delegate(HogeCursor cursor){
while (cursor.Next()){
var entity = new Hoge();
:
:
_HogeBhv.InsertOrUpdate(entity);
}
return null;
});
// レコード抽出
var sql = HogeBhv.PATH_SQL;
_HogeBhv.OutsideSql().CursorHandling()
.SelectCursor(sql, null, handler);
■エラー情報
※ContextStackのGetContextStackOnThreadで例外発生!
Look! Read the message below.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
The SQL failed to execute!
[Advice]
Please confirm the Exception message.
[Exception]
System.InvalidCastException
型
'System.Collections.Generic.List`1[Kariage.Dao.DBFlute.AllCommon.S2Dao.df_ContextStack]'
のオブジェクトを型
'System.Collections.Generic.Stack`1[Kariage.Dao.DBFlute.AllCommon.S2Dao.df_ContextStack]'
にキャストできません。
■実行環境
.NET Framefork 3.5
SQL Server 2000(MSDE)
VisualStudio 2010
---
以上
seasar-dotnet メーリングリストの案内