Book a Demo

Author Topic: COMException (RPC_E_SERVERFAULT)  (Read 4725 times)

Bob Girard

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
COMException (RPC_E_SERVERFAULT)
« on: June 24, 2010, 04:41:56 am »
I've written a standalone C# application that uses the Automation Interface to scan the Project Browser tree hierarchy and extract test information from EA UseCase and Requirement elements.  I'm getting intermittent COMExceptions with the error type of RPC_E_SERVERFAULT when attempting to read various Element properties such as Name or Status.  The exceptions do not arise with every execution pass, but occur frequently enough to make use of the application problematical and unreliable for end-users.

General web commentary on this problem in other contexts suggests memory leaks in the COM objects.  The version of Interop.EA.dll being used is 2.10.238.1.  Has anyone else encountered this particular issue?  If so, would I need to be adopting solutions offered elsewhere, such as calling Marshal.FinalReleaseComObject() or ReleaseComObject() on these Element instances, or manually invoking GC.Collect() periodically?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: COMException (RPC_E_SERVERFAULT)
« Reply #1 on: June 24, 2010, 06:11:37 pm »
Bob,

Do you have the same issue when running the application as an addin?
I've created a lot of C# addins lately (which are used by a lot of users), and I never used any of the COM cleanup methods, but I've never seen such an exception.

Geert

jeanfrancois

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: COMException (RPC_E_SERVERFAULT)
« Reply #2 on: June 24, 2010, 08:04:28 pm »
I have received this exception in my console app when I cannot connect to the database repository (openfile) (connection to the sql server hosting my database) or after I am connected and lose the connection and try to access elements.

The latter case happened when I left debugger on for while, and came back and continued where it seemingly disconnected.
« Last Edit: June 24, 2010, 08:05:43 pm by hdjjqj »

Bob Girard

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: COMException (RPC_E_SERVERFAULT)
« Reply #3 on: June 25, 2010, 04:25:01 am »
Geert,

No, this code is currently deployed only as an external application, and I haven't actually done any addin work at all yet.  If, just for the sake of discussion, we accept the notion that an RPC_E_SERVERFAULT exception can be the symptom of a COM object memory leak, is there anything more favorable about the EA addin environment that might tend to minimize this issue?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: COMException (RPC_E_SERVERFAULT)
« Reply #4 on: June 26, 2010, 05:27:19 am »
I'm not sure, but at the moment that seems to be the most obvious difference between your programs and mine.
Maybe the fact that it runs as a child of EA somehow avoids these types of errors?

Geert

alesliehughes

  • EA Administrator
  • EA User
  • *****
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: COMException (RPC_E_SERVERFAULT)
« Reply #5 on: July 01, 2010, 10:18:46 am »
Hi Bob,

Calling Marshal.FinalReleaseComObject() or ReleaseComObject() is dangerous since it can cause objects to be destoryed before they have been finished with.

GC.Collect() can be called safely, but I would only do so if
1. Your application appears to use alot of memory.
2. Your application seems to stall at random intervals. (This could be the garage collection working overtime).


Please send in a bug report for us to investigate further.
http://www.sparxsystems.com/support/index.html

Best Regards
 Alistair Leslie-Hughes