@@ -82,10 +82,16 @@ Namespace DataPortalClient
8282
8383 Dim cf As ChannelFactory( Of IWcfPortal) = GetChannelFactory()
8484 Dim svr As IWcfPortal = GetProxy(cf)
85- Dim response As WcfResponse = svr.Create( New CreateRequest(objectType, criteria, context))
86- If cf IsNot Nothing Then
87- cf.Close()
88- End If
85+ Dim response As WcfResponse = Nothing
86+ Try
87+ response = svr.Create( New CreateRequest(objectType, criteria, context))
88+ If cf IsNot Nothing Then
89+ cf.Close()
90+ End If
91+ Catch ex As Exception
92+ cf.Abort()
93+ Throw
94+ End Try
8995
9096 Dim result As Object = response.Result
9197 If TypeOf result Is Exception Then
@@ -108,10 +114,16 @@ Namespace DataPortalClient
108114
109115 Dim cf As ChannelFactory( Of IWcfPortal) = GetChannelFactory()
110116 Dim svr As IWcfPortal = GetProxy(cf)
111- Dim response As WcfResponse = svr.Fetch( New FetchRequest(objectType, criteria, context))
112- If cf IsNot Nothing Then
113- cf.Close()
114- End If
117+ Dim response As WcfResponse = Nothing
118+ Try
119+ response = svr.Fetch( New FetchRequest(objectType, criteria, context))
120+ If cf IsNot Nothing Then
121+ cf.Close()
122+ End If
123+ Catch ex As Exception
124+ cf.Abort()
125+ Throw
126+ End Try
115127
116128 Dim result As Object = response.Result
117129 If TypeOf result Is Exception Then
@@ -133,10 +145,17 @@ Namespace DataPortalClient
133145
134146 Dim cf As ChannelFactory( Of IWcfPortal) = GetChannelFactory()
135147 Dim svr As IWcfPortal = GetProxy(cf)
136- Dim response As WcfResponse = svr.Update( New UpdateRequest(obj, context))
137- If cf IsNot Nothing Then
138- cf.Close()
139- End If
148+ Dim response As WcfResponse = Nothing
149+ Try
150+ response = svr.Update( New UpdateRequest(obj, context))
151+ If cf IsNot Nothing Then
152+ cf.Close()
153+ End If
154+ Catch ex As Exception
155+ cf.Abort()
156+ Throw
157+ End Try
158+
140159
141160 Dim result As Object = response.Result
142161 If TypeOf result Is Exception Then
@@ -159,10 +178,17 @@ Namespace DataPortalClient
159178
160179 Dim cf As ChannelFactory( Of IWcfPortal) = GetChannelFactory()
161180 Dim svr As IWcfPortal = GetProxy(cf)
162- Dim response As WcfResponse = svr.Delete( New DeleteRequest(objectType, criteria, context))
163- If cf IsNot Nothing Then
164- cf.Close()
165- End If
181+ Dim response As WcfResponse = Nothing
182+ Try
183+ response = svr.Delete( New DeleteRequest(objectType, criteria, context))
184+ If cf IsNot Nothing Then
185+ cf.Close()
186+ End If
187+ Catch ex As Exception
188+ cf.Abort()
189+ Throw
190+ End Try
191+
166192
167193 Dim result As Object = response.Result
168194 If TypeOf result Is Exception Then
0 commit comments