This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[#200503061900, jdk1.4.2, Oracle 8.1.7] to reproduce: ------------- 1) connect to xtest-db 2) expand 'Tables > UNITTESTCASE' table ERROR: - Please Wait node appers and blocks all DB actions. - Cannot disconnect such session. The connection hungs in the Oracle Driver, It can be caused by a problem in this table or by error in the DB module. But there should be possibility to kill session like this.
I don't understand the steps to reproduce. How do I connect to xtest-db? What is the URL/driver/username/password?
If I understood it correctly, the database is extensively used by another clients. Can we analyse other sessions for database? We need to investigate all the locks in database. Seems to me, that another session locked a table and never released the lock. Our thread is waiting, but as the table is forever locked, it does not have any chance to finish its query. (As a solution, we can try to timeout waiting thread, but IMO it is very difficult to setup the timeout and there is impact to UI. I'm not sure, if we can do this for 4.1.) Bear in mind, that this is only my guess, we have to analyse it more precisely.
Q: Did you try to restart Oracle server?
You can connect to the DB using DBA Studio and expand table tree there, so it does not look loked. A notes about DBA Studio on xtest-db you can find here: http://beetle.czech/twiki/bin/view/Main/XTestDB The server was restarted several times since I saw it first, but I did not try it immediately after restart.
I remeber that you saw it works from DBA Studio. But I'm not sure that thin JDBC driver works in the same way as a native client (i.e. DBA Studio, which uses Oracle native protocol). There is simple code which reproduces the problem. It is obvious that it hangs in driver and never ends: public static void main(String[] args) { Connection c = null; try { Class.forName("oracle.jdbc.OracleDriver"); c = DriverManager.getConnection("jdbc:oracle:thin:@xtest-db.czech:1521:xtest", "xtest", "xtest"); c.getMetaData().getIndexInfo(null, "XTEST", "UNITTESTCASE", false, true); } catch (Exception e) { e.printStackTrace(); } finally { try { if (c != null) c.close(); } catch (Exception e) { } } }
The IDE is not frozen, as we both (Radko and me) tried. It has finished after serveral hours. My guess that table is locked was wrong. This seems we aren't able to fix this problem in db explorer. Seems like big problem with Oracle JDBC driver (type 4). We should try it with Type 2, which should work correctly as native client tools work correctly. (as Martin described.)
I spent some time investigating this issue. As it was told above, the problematic method is getIndexInfo(). This method consumes plenty of time for huge tables on Oracle database. In case of mentionened UNITTESTCASE table, which contains nearly 9 million rows, it takes about 3 hours. Originally I thought it was Oracle driver issue but I was able to reproduce it using a driver by independent vendor too. So the problem is probably somewhere between Java driver and Oracle database. I don't see any reasonable way how to fix it. Once we call getIndexInfo() method there is no way how to stop its execution. Maybe we could kill the thread in which it is running if we don't get the result in acceptable time but the problem is how to specify that time because it can depend on several circumstances. Closing as WONTFIX.