Code Completion - SQuirreL hangs
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
Hi, I should add: CPU Usage is 100% (one Core) at this time...
Last edit: Gerd Wagner 2019-10-12
Hi Gerd,
I have the same problen Claus reported in DB2 for iSeries v7R2m0. I'm using the JTOpen 9.1.
In prior versions of Squirrel the plugin worked as a charm with same driver and database version.
Thanks in advance,
Sergio
The time consuming part is column loading during Code completion. There are two things you may try:
Go to menu File -> New Session Properties -> tab SQL -> Section "Column loading" and check "Load columns in background".
By calling
", "%")con.getMetaData().getColumns("<catalog>", "<schema>", "</schema></catalog>
(where con denotes a JDBC connection)
and iterating over the ResultSet returned by this call the performance problem should be reproduceable. If so you may consult your JDBC / RDBMS vendor.
Gerd
Hello Gerd,
Setting "Load columns in background" option solved the problem and I can see now the proposed columns but if I use an alias for the tables the plugin does not show any column. It seems the '.' after the alias is causing the problem.
Thanks,
Sergio
That was a bug: Column completion didn't work for aliases of schema/catalog qualified tables. It is fixed in our GIT repository and will be available in future snapshots and versions.
Hello,
I'm running version 3.9.1 and the auto-complete is working. I tried to update to 4.1.0 and even the most recent snapshot and it seems to still have this issue. Has the bugfix above been pushed yet?
Thanks
Kevin
The only program change done for this issue was making code completion work for aliases of schema/catalog qualified tables.
No changes concerning hangs where done for this issue.
None the less there is a new function that may help with hangs. The according excerpt from our change log reads:
Option to keep Sessions from hanging or delaying when JDBC driver and/or database connection hangs or delays occur. See menu File --> New Session Properties --> tab SQL --> section "Meta data loading".
Please note: Hangs, as you describe, to my knowledge are due to database, JDBC driver or network related issues. When you use the above option and afterwards SQuirreL issues time out errors it is even more probable that the problems are database, JDBC driver or network related.
Gerd,
I did not see a "Meta Data Loading" section. I did check "Load Columns in background" and "Show SQL Results MetaData". When I did that, I went back to SQL and did the CTRL SPACE and I get a message that says "Encountered unexpected token: "." "." at line 3, column 8. Was expecting on of: "&" "&&" "::" ";" "<<" ">>" "AND" "COLLATE" "CONNECT" "EXCEPT" "FOR" "GROUP" "HAVING" "INTERSECT" "MINUS" "ORDER" "START" "UNION" "^" "|" "<eof>"</eof>
This is a JDBC connection. If I open V3.9.1 it works instantly - no issues.
If I put a coma instead of a period, it will let me get the columns but obviously doesnt execute
The SQL is
select *
from dba.HLCT_ACCOUNT a
where a.
The "Meta Data Loading" section is a very recently added feature. That's why it is available in the latest snapshot only. But judging from your example and error message I do not believe anymore the feature would help.
Still I can't reproduce your problem. What database and JDBC driver are you using?
BTW the hint it worked in 3.9.1 can become helpful when I'm able to reproduce it.
I am having the same issue as Kevin, and get the same "Encountered unexpected token" error. Auto-complete works when the table is not aliased, but does not work when aliased. Everything works correctly on version 3.9.1.
Squirrel SQL Version: 4.2.0
Driver: HP Vertica (vertica-jdbc-9.1.1-0.jar)
Sam,
I just fixed the following bug (excerpt from change log):
The fix is available in this snapshot:
https://sourceforge.net/projects/squirrel-sql/files/3-snapshots/snapshot-20210701_2344/
Please give it a try. If it doesn't solve your problem could you please post an example SQL including the DDLs for tables/catalogs/schemas used in the example.
Thanks
Gerd
Hi Gerd,
Thanks for the reply, and sorry for the delay in responding. I have tested the shapshot and auto-complete works as desired. I also tested auto-complete when using proper schema case in the stable version (4.2.0), and auto-complete works there as well. Thank you for your help with this!
Thanks,
Sam