Author Topic: EA process remains after Repository.CloseFile()  (Read 5271 times)

Knut Paulsen

  • EA User
  • **
  • Posts: 82
  • Karma: +1/-0
    • View Profile
EA process remains after Repository.CloseFile()
« on: March 14, 2012, 06:05:08 pm »
Hi Guys,

I have a problem getting rid of the EA.exe process after using the repository via the automation api. The following test code will open two different DBMS repositories, one using OpenFile2 and one using OpenFile and then close them again. After the two calls to CloseFile, both EA.exe processes appear in the task manager, but after my program exits, only one of them disappears, hard to tell which of the two processes that refuses to go away. Using C#, Win XP and MySql.

Any ideas?

try
            {
                m_RepositorySource = new Repository();
                m_RepositorySource.OpenFile2(c_SourceConnection, "user", "password");

                m_RepositoryTarget = new Repository();
                m_RepositoryTarget.OpenFile(c_TargetConnection);

                m_RepositorySource.CloseFile();
                m_RepositoryTarget.CloseFile();

                Environment.Exit(0);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Something failed", MessageBoxButtons.OK);
            }

Knut Paulsen

  • EA User
  • **
  • Posts: 82
  • Karma: +1/-0
    • View Profile
Re: EA process remains after Repository.CloseFile(
« Reply #1 on: March 14, 2012, 07:40:45 pm »
Actually, it turns out that the second process also disappears, but it just took forever. Maybe 5-10 minutes.

It is the Repository opened with OpenFile that disappear when my process exits, the one opened with OpenFile2 remains.

I'm still interested if anybody has ideas to why it takes so long before the process goes away.

Knut Paulsen

  • EA User
  • **
  • Posts: 82
  • Karma: +1/-0
    • View Profile
Re: EA process remains after Repository.CloseFile(
« Reply #2 on: March 14, 2012, 07:59:04 pm »
I have not been doing my homework :-)

Just discovered the Exit() method of Repository ...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA process remains after Repository.CloseFile(
« Reply #3 on: March 14, 2012, 08:36:33 pm »
Hmm, glad we could help ;)

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: EA process remains after Repository.CloseFile(
« Reply #4 on: March 15, 2012, 12:17:45 pm »
Quote
Hmm, glad we could help ;)

Geert
Don't underestimate the discipline of reporting a problem in a coherent way...

I often formulate a question on various fora only to find that the formulation process actually leads me to the solution!  8-)


Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA process remains after Repository.CloseFile(
« Reply #5 on: March 16, 2012, 12:06:57 am »
I often find that after writing down my problem and submitting it a flash strikes me with a solution some minutes later. So I often deleted my post shortly after creating it.

q.