[seasar-dotnet:512] 自動生成 Insert、Update、Delete文のトランザクションが効かない

KIYOSUE Minoru [E-MAIL ADDRESS DELETED]
2007年 6月 16日 (土) 11:26:13 JST


藤井様、久保様、早々のご回答他変ありがとうございます。


以下は、サービス実装側のコードです。
表現がつたなく申し訳ございません。

> s2daotestサービス 側での実行
>
>             For Each objEntity In list
>
>                                  ~~~~ *1
>                 Dim intCount As Integer
>
>                 intCount = _Nttb09ConstantDao.Insert(objEntity)
>        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *2
>
>                 If intCount <> 1 Then
>                     'エラー
>                     strMsgID = "EEE"
>                 End If
>                 intRtnCount += intCount
>             Next

-------- IS2daotestService Interface の定義 -------

    Public Interface IS2daotestService

        'コンスタントマスタ登録処理
        Function GetServiceinsConstant(ByVal list As ArrayList, ByRef 
strMsgID As String) As Integer

    End Interface


一方、サービスを呼び出す側は、

    's2Container
    Private Shared PATH As String = "dicon/conf/winapp/s2daotest.dicon"
    Private Shared IContainer As IS2Container = 
S2ContainerFactory.Create(PATH)
    Private Shared Service As Is2daotestService

    '画面新規作成時の処理
    Public Sub New()

        ' この呼び出しは、Windows フォーム デザイナで必要です。
        InitializeComponent()

        ' InitializeComponent() 呼び出しの後で初期化を追加します。
        IContainer.Init()
        Service = DirectCast(IContainer.GetComponent("IS2daotestService"), 
Is2daotestService)
        log4net.Config.XmlConfigurator.Configure( _
           log4net.LogManager.GetRepository(), info)
        logger.Info("処理を開始します")

    End Sub

    Private Sub Btn_更新_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles Btn_更新.Click

        Dim strMsgID As String = ""

        '***トランザクションのテスト中(常に同じKeyを入れてエラーにさせる)***start***
        Service.GetServiceinsConstant(objaryList, strMsgID)
                        ~~~~~~~~~~~

        MessageBox.Show("更新を終了しました")
        '***トランザクションのテスト中(常に同じKeyを入れてエラーにさせる)***end***

    End Sub


objaryListは、前回のメールで説明申し上げました通り、同じデータを複数件設定しています。


お手数をおかけしますが、よろしくお願い申し上げます。

追伸
 返信の件名設定がよくわからずに、階層化した回答になるよう設定できていないことをお詫び
 申し上げます。









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