Book a Demo

Author Topic: Repositoy.Exit() not response  (Read 3003 times)

cristo

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Repositoy.Exit() not response
« on: September 10, 2010, 01:35:20 pm »
Environment: windows server 2003
coding language: java 5
EA version: 8

Hi ,
I am using project.RunHTMLReport to generate html page and close repository after finish gen page.But I got problem , sometimes it had no response after calling Repository.Exit(). I wait about 5 min, and all tasks plug.
At mean time, I close windows process and all process start running.
I have no idea how this happen, I mean it happened occasionally.

below are code:
Code: [Select]
if (repository != null) {
        try {
            // Clean up
            logger.info("Clean up.");
            repository.CloseFile();
            logger.info("repository.CloseFile() success.");
            repository.Exit();
            logger.info("repository.Exit() success.");
            repository.destroy();
            logger.info("repository.destroy() success.");
            repository = null;
      } catch (Exception e) {
            logger.error("clean up faile," + e.getMessage(), e);
      }
} else {
      logger.info("repository is null");
      }

Thanks for help.
« Last Edit: September 10, 2010, 01:36:16 pm by indulgence »

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Repositoy.Exit() not response
« Reply #1 on: September 10, 2010, 02:30:49 pm »
On the offchance that EA is displaying a UI prompt when it shouldn't, is it possible to put in the following code before the call to repository.Exit()

Code: [Select]
Project projectInterface = repository.GetProjectInterface();
projectInterface.ShowWindow(1);

If a prompt is being raised by EA, then it should be visible to you if the UI itself is visible.

You can also put in a call to repository.Compact() to force a garbage collection before exit. The rationale for forcing garbage collection in our COM over Java automation interface is explained in the supporting documentation.

**NB: I didn't actually test the above code sorry, so make sure you double check it to see if everything is named correctly  ;D
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8