1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| Public Function Sychonise_fic_inter( ByRef tmp_ficInter1 As OfficeElevage.FcovFicInter ) As Int32
Dim conn As Ofival.Designs.Connection.GenericConnection = Ofival.Designs.Connection.GenericConnection.Instance
Dim t2 As IDbTransaction
traitement.Connection = conn
tmp_ficInter1.Connection = conn
conn.Open()
t = conn.BeginTransaction(False)
Try
t2 = conn.BeginTransaction(False)
traitement.launchIntegrationInterSigal(id_traitement)
t2.Commit()
Return id_traitement
Catch ex As Exception
Try
If Not IsNothing(t2) Then
t2.Rollback()
End If
Catch
End Try
' Throw ex
Dim msg As String = String.Format("Erreur pendant {0} : {1}", "Erreur lors de Synchronisation des Interventions Sigal", ex.ToString)
Throw New Exception(msg, ex)
Finally
If Not IsNothing(conn) Then
conn.Close()
conn.Dispose()
conn = Nothing
GC.Collect()
End If
If Not IsNothing(tmp_ficInter1) Then
tmp_ficInter1.Dispose()
tmp_ficInter1 = Nothing
GC.Collect()
End If
End Try
End Function |
Partager