[ 
https://issues.apache.org/jira/browse/TUSCANY-1872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538094
 ] 

Ron Gavlin commented on TUSCANY-1872:
-------------------------------------

Here is the patch with imports organized.

Thanks,

- Ron


Index: 
C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
===================================================================
--- 
C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
 (revision 584191)
+++ 
C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
 (working copy)
@@ -18,16 +18,12 @@
  */
 package org.apache.tuscany.das.rdb.impl;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
 
 import org.apache.tuscany.das.rdb.Command;
 
 import commonj.sdo.DataObject;
-import commonj.sdo.helper.XSDHelper;
 
 public abstract class CommandImpl extends BaseCommandImpl implements Command {
     
@@ -39,20 +35,6 @@
     
     public CommandImpl(String sqlString) {
         statement = new Statement(sqlString);
-
-        try {
-            URL url = getClass().getResource("/xml/sdoJava.xsd");
-            if (url == null) {
-                throw new RuntimeException("Could not find resource: 
xml/sdoJava.xsd");
-            }
-
-            InputStream inputStream = url.openStream();
-            XSDHelper.INSTANCE.define(inputStream, url.toString());
-            inputStream.close();
-        } catch (IOException ex) {
-            throw new RuntimeException(ex);
-        }
-
     }
 
     public CommandImpl(org.apache.tuscany.das.rdb.config.Command command) {


> DAS CommandImpl(String) leaks EMF/XSD XSDImportImpl objects for sdoModel.xsd
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-1872
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1872
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-Next
>            Reporter: Ron Gavlin
>            Priority: Critical
>             Fix For: Java-DAS-Next
>
>
> Whenever a DAS rdb.impl.CommandImpl is constructed, it attempts to re-load 
> the schema definition for the "commonj.sdo/java" namespace which imports the 
> "commonj.sdo" namespace. For each XSDHelper.define() invocation, an new 
> XSDImportImpl is allocated which contains its own XSDSchemaImpl object for 
> the "commonj.sdo" namespace which is 25K in size. Many constructions of the 
> DAS rdb.impl.CommandImpl will eventually cause an OutOfMemoryException.
> Tuscany SDO already pre-defines the "commonj.sdo/java" namespace as part of 
> its initialization. According to JIRA issue TUSCANY-20, this used to not be 
> the case. Now that TUSCANY-20 is fixed, the DAS should no longer be 
> attempting to define the "commonj.sdo/java" types.
> The patch below removes these lines of code which are causing the memory 
> leak. Please apply ASAP.
> Thanks,
> - Ron
> Index: 
> C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
> ===================================================================
> --- 
> C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
>        (revision 584191)
> +++ 
> C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
>        (working copy)
> @@ -39,20 +39,6 @@
>      
>      public CommandImpl(String sqlString) {
>          statement = new Statement(sqlString);
> -
> -        try {
> -            URL url = getClass().getResource("/xml/sdoJava.xsd");
> -            if (url == null) {
> -                throw new RuntimeException("Could not find resource: 
> xml/sdoJava.xsd");
> -            }
> -
> -            InputStream inputStream = url.openStream();
> -            XSDHelper.INSTANCE.define(inputStream, url.toString());
> -            inputStream.close();
> -        } catch (IOException ex) {
> -            throw new RuntimeException(ex);
> -        }
> -
>      }
>  
>      public CommandImpl(org.apache.tuscany.das.rdb.config.Command command) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to