//***************************************************************************************//
An unhandled exception of type 'System.Exception' occurred in system.data.oracleclient.dll

Additional information: Internal Pooler Error: 2

//***************************************************************************************//


  ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' Do All Insert/update data in can RollBack Persistence
    ''' </summary>
    ''' 2007/6/26 Created
    ''' </history>
    Public Sub SetInsertUpdateDataInPersistence(ByVal dt As DataTable)
        log.Info("CALL")
        Try
            persistence = New PersistenceFactory().CreateInstance()
            ' persistence = factory.CreateInstance
            '事務の初め
            persistence.BeginTrans()
            For Each dr As DataRow In dt.Rows
                ' 更新設定(1/7)
                Me.SetUpdateData_NO1(dr)
                ' 更新設定(2/7)
                Me.SetUpdateData_NO2(dr)
                ' 更新設定(3 / 4/ 7)
                Me.SetUpdateData_NO3AndNO4(dr)
                ' 更新設定(5 / 6/ 7)
                Me.SetUpdateData_NO5AndNO6(dr)
                ' 更新設定(7 / 7)
                Me.SetUpdateData_NO7(dr)
            Next
            persistence.Commit()
        Catch ex As Exception
            persistence.RollBack()
            log.Fatal(ex.ToString)
            Throw (ex)
            'Finally
            '    If Not (persistence Is Nothing) Then
            '        persistence.Close()
            '    End If
        End Try
        log.Info("End")
    End Sub

         上面是一个做,批处理的,操作, 如果有错误,必须执行回滚操作.
   上面加上引号的部分, 是解决这个错误的代码.   
         也就是说, 执行完数据库操作后,  必须把执行这个事物的操作源,关闭.
    否则就出现了,上面的奇怪的错误.
        

posted on 2007-08-02 14:54  刀魂  阅读(7170)  评论(0编辑  收藏  举报