Bug 314645 XML Datasource is not Thread-Safe when passing data as InputStream
Build Identifier: Eclipse Build id: 20090920-1017 / BIRT Runtime 2.5.1 + 2.5.2 When passing XML-data to the IRunTask in a multi-threaded application, some of the resulting .rptdocument files will be corrupted. The error only occures when passing an InputStream using the setAppContext method: ctxMap.put("org.eclipse.birt.report.data.oda.xml.inputStream", new FileInputStream("data.xml")); ctxMap.put("org.eclipse.birt.report.data.oda.xml.closeInputStream", new Boolean(true)); task.setAppContext(ctxMap); This warning will be written to the log: "WARNUNG: Exceptions occur during xml parsing" (see attachments for stackstrace) Reproducible: Sometimes Steps to Reproduce: 1. Run the sample application in the attachments (use the -Xmx1024m VM-Argument to avoid our of memory errors 2. Wait till the log shows the this warning: WARNUNG: Exceptions occur during xml parsing 3. Kill the sample application process 4. Analyze the generated rptdocument files (sort by ascending file size to find corrupted files)
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/odaconsumer/ConnectionManager.java
* This will trigger the use of the DTP ODA framework service to apply 
     * the connection property values defined in an external connection profile store, 
     * for opening a connection.
     * @param appContext    application context object passed thru into the data engine
     * @return          updated application context object for passing thru
     *                  to the DTP oda.consumer 
     */
    static Map addProfileProviderService( Map appContext )
    {
        Map providerAppContext = appContext;
        if( providerAppContext == null )
            providerAppContext = new HashMap();
        
         
        
        if( ! providerAppContext.containsKey( IPropertyProvider.ODA_CONSUMER_ID ) )
        {
            providerAppContext.put( IPropertyProvider.ODA_CONSUMER_ID, 
                                    DTP_CONN_PROFILE_APPL_ID );
            if( getLogger().isLoggable( Level.FINE ) )
                getLogger().logp( Level.FINE, sm_className, "addProfileProviderService( Map )",  
                    "Added default property service: " + DTP_CONN_PROFILE_APPL_ID ); 
        }
        return providerAppContext;
    }
    
	/**
	 * Returns the maximum number of active connections that the driver can support.
	 * @return	the maximum number of connections that can be opened concurrently, 
	 * 			or 0 if there is no limit or the limit is unknown.