Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » SQL Results error when removing results
SQL Results error when removing results [message #1121383] Mon, 30 September 2013 15:10 Go to next message
d jailer is currently offline d jailerFriend
Messages: 4
Registered: August 2013
Junior Member
I am using Kepler Release Build id: 20130606-0932 straight from the download site. The only mods I did involve the creation of my database connection. I used the same values which did not cause errors in Ganymede -> Juno. I used a new blank workspace.

When I try to either remove a single line or all ines I see this message in the Error Log - along with the stacktrace.

java.lang.UnsupportedOperationException: This IndexReader cannot make any changes to the index (it was opened with readOnly = true)
at org.apache.lucene.index.ReadOnlySegmentReader.noWrite(ReadOnlySegmentReader.java:23)
at org.apache.lucene.index.ReadOnlyDirectoryReader.acquireWriteLock(ReadOnlyDirectoryReader.java:43)
at org.apache.lucene.index.IndexReader.deleteDocument(IndexReader.java:1339)
at org.apache.lucene.index.IndexReader.deleteDocuments(IndexReader.java:1375)
at org.eclipse.datatools.sqltools.result.internal.index.ResultHistoryLuceneIndex.removeResults(ResultHistoryLuceneIndex.java:184)
at org.eclipse.datatools.sqltools.result.internal.index.ResultHistoryLuceneIndex.removeResult(ResultHistoryLuceneIndex.java:155)
at org.eclipse.datatools.sqltools.result.internal.index.HistoryIndexListener.resultInstanceRemoved(HistoryIndexListener.java:34)
at org.eclipse.datatools.sqltools.result.ResultManager.fireRemoved(ResultManager.java:117)
at org.eclipse.datatools.sqltools.result.ResultManager.removeResultInstance(ResultManager.java:200)
at org.eclipse.datatools.sqltools.result.internal.ui.actions.RemoveResultAction.run(RemoveResultAction.java:100)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)

Session Data:
eclipse.buildId=4.3.0.I20130530-1430
java.version=1.7.0_11
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.reporting.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.reporting.product


I am not able to remove any lines normally. If I want to remove a row I need to choose one of the Remove options, which results in the above Error Log entry but seems to have no visible effect. I then enter any character in the filter. I use a space. The Results will disappear - I assume since the search for " " doesn't match any result. Then I backspace and the Result is now gone.

I haven't been able to find anything like this error anywhere so far, except in some bug reports - which since I am not using the command line and not calling any connection objects via java code doesn't help me much.

[Updated on: Mon, 30 September 2013 15:11]

Report message to a moderator

Re: SQL Results error when removing results [message #1234876 is a reply to message #1121383] Thu, 23 January 2014 02:42 Go to previous messageGo to next message
Listen Xu is currently offline Listen XuFriend
Messages: 2
Registered: July 2009
Junior Member
I have the same problem as yours and I couldn't believe that this bug is existing for such a long time and no one try to fix it?! Sad
Re: SQL Results error when removing results [message #1240872 is a reply to message #1234876] Fri, 07 February 2014 06:54 Go to previous messageGo to next message
Listen Xu is currently offline Listen XuFriend
Messages: 2
Registered: July 2009
Junior Member
Click "Remove Result" or "Remove All Visiable Results" in the SQL Results view, but there is no effect, this issue happens in eclipse 4.x. (but good in eclipse 3.x)

It's caused by the there is an uglily change in the apache lucene api: the "open(Directory)" method in the org.apache.lucene.index.IndexReader created a non-read-only indexreader before but now it creates a read-only indexreader(eclipse 4.x is using apache lucene api 3.x).

This change causes "removeResults(IResultInstance[] instances)" method in the "org.eclipse.datatools.sqltools.result.internal.index.ResultHistoryLuceneIndex" tries to delete document from a read-only index reader when removing result and throws UnsupportedOperationException:

java.lang.UnsupportedOperationException: This IndexReader cannot make any changes to the index (it was opened with readOnly = true)
at org.apache.lucene.index.ReadOnlySegmentReader.noWrite(ReadOnlySegmentReader.java:23)
at org.apache.lucene.index.ReadOnlyDirectoryReader.acquireWriteLock(ReadOnlyDirectoryReader.java:43)
at org.apache.lucene.index.IndexReader.deleteDocument(IndexReader.java:1339)
at org.apache.lucene.index.IndexReader.deleteDocuments(IndexReader.java:1375)
at org.eclipse.datatools.sqltools.result.internal.index.ResultHistoryLuceneIndex.removeResults(ResultHistoryLuceneIndex.java:184)


I believe the fix is easy, just assign the second parameter (readonly = false) when creating index reader in ResultHistoryLuceneIndex::removeResults(IResultInstance[] instances)

e.g. I'm using org.eclipse.datatools.sqltools.result_1.1.6.v201302050842.jar:

ResultHistoryLuceneIndex line 167,

before: IndexReader reader = IndexReader.open(this._ramDir);
after: IndexReader reader = IndexReader.open(this._ramDir, false);

Please fix this issue and thanks.
Re: SQL Results error when removing results [message #1252162 is a reply to message #1240872] Fri, 21 February 2014 01:09 Go to previous messageGo to next message
Brian Payton is currently offline Brian PaytonFriend
Messages: 152
Registered: July 2009
Senior Member
This problem has been fixed in DTP 1.10.2 RC4 (using the suggested fix from Listen Xu). See bug 427621 for more information.
Re: SQL Results error when removing results [message #1252173 is a reply to message #1252162] Fri, 21 February 2014 01:23 Go to previous message
Brian Payton is currently offline Brian PaytonFriend
Messages: 152
Registered: July 2009
Senior Member
Sorry, I meant DTP 1.11.2 RC4.
Previous Topic:DTP to EMF
Next Topic:DB2 10.1 FP 0 or DB2 10.5 not show schema in Data Explorer
Goto Forum:
  


Current Time: Thu Dec 18 07:28:10 GMT 2014

Powered by FUDForum. Page generated in 0.20274 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software