Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354522 - SQL Results View fails to open if previously stored result set is too large
Summary: SQL Results View fails to open if previously stored result set is too large
Status: RESOLVED WORKSFORME
Alias: None
Product: Data Tools
Classification: Tools
Component: SQL Results View (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dtp.sqldevtools-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-11 12:13 EDT by Lara Ziosi CLA
Modified: 2012-05-15 21:34 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lara Ziosi CLA 2011-08-11 12:13:30 EDT
Build Identifier: 3.6

With default options, the workspace stores Results of previous queries. 
Users of an adopting product find often that they cannot initialize the SQL Results View due to OutOfMemoryError.
The typical resolution is to either make them change Workspace, or to make them go into the workspace and delete the large result set from the workspace metadata directory, so that the Result Set View can open again.

This record is to request that the View instead shows a message to the user, before attempring to load any stored data.

In the message it should point out that there is old data to be loaded, ideally the date and size of that data, and it should ask the user if he wants to load the data or discard it.

Hopefully with such information a user could prevent OutOfmemoryErrors, or in case they encounter them, they could easily resolve them by reloading Eclipse and choosing to delete the old data.

Reproducible: Didn't try
Comment 1 Lara Ziosi CLA 2011-08-11 12:25:23 EDT
A typical .log frament would include:

Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.datatools.sqltools.result.internal.ResultsViewPlugin.start() of bundle org.eclipse.datatools.sqltools.result.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(Unknown Source)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(Unknown Source)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(Unknown Source)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(Unknown Source)
	at org.eclipse.osgi.framework.util.SecureAction.start(Unknown Source)
	... 64 more
Caused by: java.lang.OutOfMemoryError
	at java.io.ObjectInputStream$HandleTable$HandleList.<init>(Unknown Source)
	at java.io.ObjectInputStream$HandleTable.markDependency(Unknown Source)
	at java.io.ObjectInputStream.readArray(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	at java.util.ArrayList.readObject(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	at java.util.ArrayList.readObject(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
	at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
	at org.eclipse.datatools.sqltools.result.internal.model.ResultInstance.readObject(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	at java.util.HashMap.readObject(Unknown Source)
	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 java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
	at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
	at org.eclipse.datatools.sqltools.result.internal.core.ResultManager.readObject(Unknown Source)
	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 java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
	at java.io.ObjectInputStream.readSerialData(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	at org.eclipse.datatools.sqltools.result.internal.ResultsViewPlugin.start(Unknown Source)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Unknown Source)
	... 69 more
Comment 2 Marek Chodorowski CLA 2012-02-06 06:38:20 EST
This problem has been already resolved in the version 1.8.2 of org.eclipse.datatools.sqltools.result plugin. The problem was that in the old (1.6.2) version, file with SQL results from SQL Results View was read at once. That is why after restarting Eclipse when user had a lot of entries in the SQL Results View, OutOfMemoryError could be thrown.
In the new version of plugin, file with SQL results is divided into parts. Each part is a separate file with results from particular SQL query. These files are not read at once. Appropriate file is read only when user selects particular entry in the SQL Results View.

(View with message which is showed to the user was not necessary solution for this problem because it is difficult to predict how much memory should be allocated to read file with SQL Results. Also user does not have to be aware how much available memory he/she has)
Comment 3 Brian Payton CLA 2012-05-15 21:34:22 EDT
As per Marek Choderowski's comment, I am resolving this bug as already fixed as of DTP 1.8.2.

Thanks Marek!