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
* When the method <code>openConnection</code> is called, the 
 * <code>ConnectionManager</code> will attempt to open and return a 
 * <code>Connection</code> instance of the data source extension 
 * supported by that driver.
 */
public class ConnectionManager
{
	/** 
	 * volatile modifier is used here to ensure the ConnectionManager, when being constructed by JVM, will be locked
	 * by current thread until the finish of construction.
	 */
	private static volatile ConnectionManager sm_instance = null;
    
    private static final String DTP_CONN_PROFILE_APPL_ID = Constants.CONN_PROFILE_APPL_ID;
	
    
	private static final String sm_className = ConnectionManager.class.getName();
	static final String sm_packageName = ExceptionHandler.sm_packageName;
	private static LogHelper sm_logger = null;
	
	protected ConnectionManager( )
	{
	}
	
	/**
	 * Returns a <code>ConnectionManager</code> instance for getting opened 
	 * <code>Connections</code>.
	 * @return	a <code>ConnectionManager</code> instance.
	 */
	public static ConnectionManager getInstance( )