mybatipse icon indicating copy to clipboard operation
mybatipse copied to clipboard

When the file is too big, it often takes 5 seconds or more

Open Shiaming opened this issue 3 years ago • 20 comments

Such as userMapper.java include 100 statement links to userMapper.xml are always stuck It may also cause the eclipse to become unresponsive

Shiaming avatar Mar 21 '23 05:03 Shiaming

The mybatipse version is the latest

Shiaming avatar Mar 21 '23 05:03 Shiaming

The mybatipse version is the latest

MyBatipse 1.3.0.202210300418

Shiaming avatar Mar 21 '23 05:03 Shiaming

It takes 5 seconds to do "what" exactly?

harawata avatar Mar 21 '23 07:03 harawata

It takes 5 seconds to do "what" exactly?

Take 5 seconds to open the userMapper.xml that matches the sql statement and then the eclipse is not responding during this time

Shiaming avatar Mar 21 '23 08:03 Shiaming

If you open the "userMapper.xml" from the "Package Explorer" or "Project Explorer", it does not take 5 seconds?

harawata avatar Mar 21 '23 08:03 harawata

If you open the "userMapper.xml" from the "Package Explorer" or "Project Explorer", it does not take 5 seconds?

The same as above If I uninstall the plug-in and use Package Explorer open the userMapper.xml is quick

Shiaming avatar Mar 21 '23 08:03 Shiaming

@Shiaming ,

I added 100 statements to a XML mapper, but it does not reproduce the issue, so there may be another reason. I would be happy to investigate, but I need to reproduce the issue to do that. Please create a project with minimum setup to reproduce the problem. And share the project on your GitHub repository.

Thank you!

harawata avatar Mar 21 '23 19:03 harawata

@Shiaming ,

I added 100 statements to a XML mapper, but it does not reproduce the issue, so there may be another reason. I would be happy to investigate, but I need to reproduce the issue to do that. Please create a project with minimum setup to reproduce the problem. And share the project on your GitHub repository.

Thank you!

Because my project is complex and not very good to simulate the scene Can I enable the plugin log printing function? I found the following configuration file The location of the configuration file is here net.harawata.mybatipse_1.3.0.202210300418.jar .options Enable verbose logging. net.harawata.mybatipse/debug=true Bean property cache activities. net.harawata.mybatipse/debug/beanPropertyCache=false But I don't know how to configure in the eclipse

Shiaming avatar Mar 22 '23 03:03 Shiaming

Then you may have to debug the plugin yourself. Logging in this plugin is mainly for errors, so it probably is not helpful very much.

p.s. I must say that 100 statements in a single mapper is quite unusual. The best practice is to create one mapper for one DB table. See this Q&A : https://stackoverflow.com/a/75603479/1261766

harawata avatar Mar 25 '23 21:03 harawata

Could you try disabling validation?

  • From the menu, open "Project" > "Properties"
  • Select "Validation" and check "Enable project specific settings"
  • Check-off "Manual" and "Build" of "MyBatis XML Mapper Validator"

Validation does not run just by opening the file, usually. But if another tool triggers the build, it might run.

harawata avatar Mar 26 '23 16:03 harawata

The above method still does not solve it well. I had to disable this feature to do so. Select "General->Editors->Text Editors Hyperlinking" and disable "Mybatis Java Mapper Hyperlink Detector" That's the best compromise I can think of. Search mapper stattements can replace it with Quick Search.

Shiaming avatar Mar 28 '23 07:03 Shiaming

Thank you for your attention to this issue

Shiaming avatar Mar 28 '23 07:03 Shiaming

Thank you for the info!

I think that hyperlink detection is activated only when you press control key (or command key on macOS) and move the mouse pointer on the editor. In other words, it is not activated just by opening the XML editor, with the default settings at least.

Do you have any custom configuration or a plugin that somehow triggers hyperlink detection automatically?

harawata avatar Mar 29 '23 01:03 harawata

You may misunderstand my meaning. what I meant was that opening this hyperlink led to unresponsive

Shiaming avatar Mar 29 '23 01:03 Shiaming

The development tools I use are "Spring Tool Suite 4 Version: 4.10.0.RELEASE" .

Shiaming avatar Mar 29 '23 01:03 Shiaming

Oh, OK. Just to clarify, it happens when you click a hyperlink ...

  1. in a Java mapper to open XML mapper
  2. in a XML mapper to open Java mapper

Which is it? Or, is it both?

harawata avatar Mar 29 '23 02:03 harawata

Both are slow, but "in a Java mapper to open XML mapper" is even slower.

Shiaming avatar Mar 29 '23 02:03 Shiaming

Seems like you are using really old spring. Can you upgrade to 4.18? Maybe newer eclipse possible as well as likely pretty old given spring revision? A lot has changed with Eclipse in last year...

hazendaz avatar Mar 29 '23 23:03 hazendaz

Seems like you are using really old spring. Can you upgrade to 4.18? Maybe newer eclipse possible as well as likely pretty old given spring revision? A lot has changed with Eclipse in last year...

I can try it.

Shiaming avatar Mar 30 '23 09:03 Shiaming

Seems like you are using really old spring. Can you upgrade to 4.18? Maybe newer eclipse possible as well as likely pretty old given spring revision? A lot has changed with Eclipse in last year...

Thank you!

Shiaming avatar Mar 30 '23 09:03 Shiaming