Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MartinHe

Pages: [1]
1
Yes, that is a really good advice. And we do that already.

We did not query all tagged values in the beginning, because for the task at hand not all tagged values are needed. But almost. So we filtered the tagged values in a WHERE clause first. The problem is that at some point the SQL query becomes to complex to be executed by JET. So multiple SQL queries were needed. The performance was simply too bad. Even with one SQL query, it is much faster to filter the results in memory instead of asking the JET database to do it for you.

I have the impression, that the size of the database causes the problem. In the past it was half the size and everything worked well. How big are your JET databases? For me 150 MB after a compact feels impressive for Enterprise Architect models.

Yes, you cannot give up working with EA objects completely. Sometimes you need them when changes should be recognized by Enterprise Architect to update the user interface efficiently. But sadly, Repository.GetElementByID(int) does not scale. The response time depends on the number of children of the requested element.

2
Yes, restarting Enterprise Architect helps. But it is unsatisfying and nothing I can expect from end users of the add-in I'm developing. I just figured out that it also happens with a really simple query:

SELECT PropertyID, ea_guid, Object_ID, Property, Value, Notes FROM t_objectproperties

The database was freshly compacted and repaired. Executing the query via Repository.SQLQuery(string) results in an empty string. But when I executed the query via the UI of Enterprise Architect, the records were shown, 99292 in total. I had to restart EA in order to get the results via Repository.SQLQuery(string).

I really would like to understand the problem in order to adjust my add-in to avoid it. Is the JET 3 database corrupt? Would JET 4 avoid the problem? But why does Enterprise Architect show results in the UI? Is there a defect in Enterprise Architect? But why does this happen only sporadically. But so often that end users got annoyed and asked me to fix it. Would upgrading to a newer Version of Enterprise Architect help?

PS: I gave up working with EA objects for performance reasons.

3
Hello together,

I have the problem that the method Repository.SQLQuery(string) returns an empty string instead of a string with XML content. This happens sporadically with Enterprise Architect 13.5.1354. The EAP file (JET 3) is quite large, about 160 MB after compact. I also tried to repair the database and to update the indices. Replication is used. The SQL query contains an inner SQL query, the rest seems to be standard for me.

I could not figure out when this happens. It happens sporadically on some computers. If it happens, executing the same query three times in a row produces always the empty string as result. But once the file is reopened, the problem is usually gone and a xml string is returned?

Can anybody please explain me when this happens and if a workaround exist?

Thank you very much!

Best regards!

4
Indeed, add-in searches are not supported in the model views window according to the support.

5
Hello together,

I would like to use an add-in search in the model views window. When I execute the search in the "Find in Project" window, the expected results are shown. But the model views window shows "Search Found No Items".

I specified the following simple SQL query as search where the editor type is "SQL Editor":

        SELECT ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name, Package_ID FROM t_object WHERE Object_Type = 'Interface'

I deployed the search together with the model views search folder as part of a MDG technology. It works as expected.

Now I implemented the search in C# as part of an add-in:

        public virtual bool SearchInterfaces(Repository repository, string searchText, ref string xmlResults)
        {
            string sql = "SELECT ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name, Package_ID FROM t_object WHERE Object_Type = 'Interface'";
            string xml = repository.SQLQuery(sql);
            XDocument document = XDocument.Parse(xml);
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("<ReportViewData UID=\"{6F9943C6-44A4-4150-B1CF-16EE74E3F04D}\">");
            sb.AppendLine("<Fields>");
            sb.AppendLine("<Field name=\"CLASSGUID\" />");
            sb.AppendLine("<Field name=\"CLASSTYPE\" />");
            sb.AppendLine("<Field name=\"Name\" />");
            sb.AppendLine("</Fields>");
            sb.AppendLine("<Rows>");
            foreach (XElement row in document.Descendants("Row"))
            {
                sb.AppendLine("<Row>");
                sb.AppendLine("<Field name=\"CLASSGUID\" value=\"" + row.Element("CLASSGUID").Value + "\" />");
                sb.AppendLine("<Field name=\"CLASSTYPE\" value=\"" + row.Element("CLASSTYPE").Value + "\" />");
                sb.AppendLine("<Field name=\"Name\" value=\"" + row.Element("Name").Value + "\" />");
                sb.AppendLine("</Row>");
            }
            sb.AppendLine("</Rows>");
            sb.AppendLine("</ReportViewData>");
            xmlResults = sb.ToString();
            return true;
        }

The UID "{6F9943C6-44A4-4150-B1CF-16EE74E3F04D}" is the UID of the search (with Editor Type "Add-In Search") as specified in the MDG technology.

As mentioned above, the search shows the expected results in the "Find in Project" window, but not int the "Model Views" window. I tried EA 14.1 (1427) and EA 13.5 (1354).

Can anybody tell me where the defect is?

Thank you very much!

Best regards,

Martin

Pages: [1]