EDML designer class code analysis violation

EDML designer class code analysis violation

Postby sniperpon » Tue 09 Oct 2012 18:40

The EDML designer class generated from an Oracle 11g database doesn't dispose of EntityCommand instances. Every time I regenerate the model, I have to manually wrap the generated code in every single method with "Using" statements, otherwise the class fails a rule in Microsoft's static code analysis tool.

The designer class gets generated with lines like this:
Code: Select all
Dim command As EntityCommand = New EntityCommand()


And I need to change them to something like this:
Code: Select all
Using command As EntityCommand = New EntityCommand()


The code analysis rule that is violated is:
Microsoft.Reliability, CA2000: Dispose objects before losing scope
"call System.IDisposable.Dispose on object 'command' before all references to it are out of scope."

I tested this with the following versions of Devart dotConnect for Oracle:
-6.10.121
-6.80.350
-7.2.96

The problem is easy to reproduce; just drag a PL/SQL procedure on to the model, and take a look at the generated method in the designer class.

It would be fantastic if this deficiency was remedied in a future version of dotConnect. 8)
sniperpon
 
Posts: 1
Joined: Tue 09 Oct 2012 18:02

Re: EDML designer class code analysis violation

Postby Shalex » Mon 15 Oct 2012 15:03

Thank you for your report. We will post here when the issue is fixed.
Shalex
Devart Team
 
Posts: 7533
Joined: Thu 14 Aug 2008 12:44

Re: EDML designer class code analysis violation

Postby Shalex » Wed 17 Oct 2012 09:26

The bug with disposing EntityCommand in the code generated for calling stored procedure is fixed. We will post here when the corresponding build of dotConnect for Oracle is available for download.
Shalex
Devart Team
 
Posts: 7533
Joined: Thu 14 Aug 2008 12:44

Re: EDML designer class code analysis violation

Postby Shalex » Thu 18 Oct 2012 16:24

New build of dotConnect for Oracle 7.2.104 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=25100.
Shalex
Devart Team
 
Posts: 7533
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle