Open oldshensheep opened 3 months ago
Thanks for reporting this issue.
Can you provide more context? For instance, what type of activity leads to all the connections? Are you using IntelliJ Ultimate SQL features? Are you running tests, or just using the editors? Which version of IJ are you using? Etc. Thanks.
I did some testing.
I restarted IJ. This time, [.sql/] some sql
doesn't have syntax highlighting but has code completion.
When I open the project for the first time, it opens 10 connections. If I open a code file containing [.sql/] some SQL, it opens another 10 connections. When I run my project, it opens another 20 connections.
Oh, I ran gradlew clean
and ran my project again. It opened another 10 connections (total: 50).
Oh, I ran gradlew clean
, which opened another 20 connections. When I ran my project again, it opened another 10 connections (total: 80).
Oh, while writing this comment, it opened another 20 connections (total: 100).
It can't open any more connections.
for your questions:
I found a way to reproduce this issue.
Can you disable your IJ SQL postgresql connection to ensure that is not the issue? Thanks
I removed IJ postgresql configuration and tried again, still the same issue.
Ok thanks, just needed to eliminate that from the deck.
You can try manifold release 2024.1.17, there was a statement leak in DDL execution.
I have tried, and yesterday I had this issue once. Now it's hard to reproduce. I will close it if I can't reproduce it anymore.
I found another issue. When your code contains a SQL statement that uses a table that doesn't exist in the database, and you keep opening the file, you will find that IJ's CPU usage is extremely high. I looked at the database log and found it executes a lot of SQL every second. The SQL is the same as I provided below.
"[.sql/] insert into table_doesnt_exists(data) values(?) ".execute(ctx, data);
This issue still exists, so I created a reproducer. For another issue, it's harder to reproduce and may be related to this issue, so let's fix this issue first.
My program startup failed.
IntelliJ opened 90 connections, and my program opened 10 connections. The maximum allowed connection limit is 100.
Lots of connections are waiting for connect, green means new connection
If I disable the plugin, it will be normal.