Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dtp-connect-dev] DataTypeMapping synchronization issue

Hi,
I have a strange issue with an ODA plugin.
Basically, it looks like a synchronization issue as it works well when I have only one query at a time.
When my project starts with two queries, I have an exception:
<Dec 10, 2007 01:47:46 PM> <SEVERE> <Joe>  Cannot process the net.appl.jrisk.report.oda.multiplepntmarketdata driver's configurations.
The ODA driver plugin.xml has an invalid odaScalarDataType value (String) in the <dataTypeMapping> (String).
org.eclipse.birt.data.engine.core.DataException: Cannot process the net.appl.jrisk.report.oda.multiplepntmarketdata driver's configurations.
The ODA driver plugin.xml has an invalid odaScalarDataType value (String) in the <dataTypeMapping> (String).
    at org.eclipse.birt.data.engine.odaconsumer.Driver.throwConfigException(Driver.java:176)
    at org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverManifest(Driver.java:165)
    at org.eclipse.birt.data.engine.odaconsumer.Driver.findDataSourceExtensionConfig (Driver.java:123)
    at org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverExtensionConfig(Driver.java:78)
    at org.eclipse.birt.data.engine.odaconsumer.Driver.getExtensionConfig(Driver.java:60)
    at org.eclipse.birt.data.engine.odaconsumer.Driver.getDriverHelper (Driver.java:93)
    at org.eclipse.birt.data.engine.odaconsumer.DriverManager.getDriverHelper(DriverManager.java:87)
    at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnection(ConnectionManager.java :132)
    at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSource.java:134)
    at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java:121)
    at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiDataSource (DataSourceRuntime.java:214)
    at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryExecutor.java:265)
    at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:210)
    at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:500)
    at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:161)
    at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute (PreparedOdaDSQuery.java:142)
    at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:141)
    at org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.populatePreparedQuery (PreparedJointDataSourceQuery.java:512)
    at org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.populatePreparedQuery(PreparedJointDataSourceQuery.java:472)
    at org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.access$2 (PreparedJointDataSourceQuery.java:469)
    at org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery$JointDataSetQueryExecutor.createOdiQuery(PreparedJointDataSourceQuery.java:555)
    at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution (QueryExecutor.java:217)
    at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:500)
    at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java :161)
    at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:141)
    at net.appl.jrisk.report.extractor.AbstractBIRTReportExtractor.createReport(AbstractBIRTReportExtractor.java :112)
    at net.appl.jrisk.rtblotter.model.dataextractor.AbstractRTBlotterDataExtractor.processBIRTRequest(AbstractRTBlotterDataExtractor.java:216)
    at net.appl.jrisk.rtblotter.model.dataextractor.AbstractRTBlotterDataExtractor.processBatch (AbstractRTBlotterDataExtractor.java:171)
    at net.appl.jrisk.rtblotter.model.dataextractor.AbstractRTBlotterDataExtractor.fastQASLoad(AbstractRTBlotterDataExtractor.java:164)
    at net.appl.jrisk.rtblotter.model.dataextractor.AbstractRTBlotterDataExtractor.extractReportData (AbstractRTBlotterDataExtractor.java:296)
    at net.appl.jrisk.report.extractor.AbstractReportDataExtractor$DataExtractor.run(AbstractReportDataExtractor.java:156)
Caused by: org.eclipse.datatools.connectivity.oda.OdaException : The ODA driver plugin.xml has an invalid odaScalarDataType value (String) in the <dataTypeMapping> (String).
    at org.eclipse.datatools.connectivity.oda.util.manifest.DataTypeMapping.sanityCheckOdaScalarType( DataTypeMapping.java:100)
    at org.eclipse.datatools.connectivity.oda.util.manifest.DataTypeMapping.<init>(DataTypeMapping.java:66)
    at org.eclipse.datatools.connectivity.oda.util.manifest.DataSetType.init (DataSetType.java:71)
    at org.eclipse.datatools.connectivity.oda.util.manifest.DataSetType.<init>(DataSetType.java:45)
    at org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.getDataSetElements (ManifestExplorer.java:520)
    at org.eclipse.datatools.connectivity.oda.util.manifest.ExtensionManifest.init(ExtensionManifest.java:106)
    at org.eclipse.datatools.connectivity.oda.util.manifest.ExtensionManifest .<init>(ExtensionManifest.java:55)
    at org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.getExtensionManifest(ManifestExplorer.java:239)
    at org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.getExtensionManifest (ManifestExplorer.java:205)
    at org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.getExtensionManifest(ManifestExplorer.java:157)
    at org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverManifest (Driver.java:147)
    ... 29 more

I looked into the code and I suspect that class org.eclipse.datatools.connectivity.oda.util.manifest.DataTypeMapping  to be the source of my issue, in the static private method:

    /**
     * Returns the cached table that maps each ODA data type name
     * to its corresponding data type code.
     * The data type name serves as the key in the cached table.
     */
    private static Hashtable getOdaTypeCodes()
    {
        if( sm_odaTypeCodes == null )
        {
            sm_odaTypeCodes = new Hashtable( 10 );
           
            sm_odaTypeCodes.put( toOdaTypeKey( "String" ), //$NON-NLS-1$
                                new Integer( Types.CHAR ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Integer" ), //$NON-NLS-1$
                                new Integer( Types.INTEGER ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Double" ), //$NON-NLS-1$ 
                                new Integer( Types.DOUBLE ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Decimal" ), //$NON-NLS-1$
                                new Integer( Types.DECIMAL ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Date" ), //$NON-NLS-1$
                                new Integer( Types.DATE ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Time" ), //$NON-NLS-1$
                                new Integer( Types.TIME ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Timestamp" ), //$NON-NLS-1$
                                new Integer( Types.TIMESTAMP ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Blob" ), //$NON-NLS-1$
                                new Integer( Types.BLOB ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Clob" ), //$NON-NLS-1$
                                new Integer( Types.CLOB ));
            sm_odaTypeCodes.put( toOdaTypeKey( "Boolean" ), //$NON-NLS-1$
                                new Integer( Types.BOOLEAN ));
        }
       
        return sm_odaTypeCodes;       
    }

I suspect that it may happen that two thread are going to access that static method at the same time.
The first one is going to instantiate an empty hashmap that the second will get  before the first thread starts popluating it.
The second thread will not see any entry for the String datatype and I have my exception.
Does that make sense or am I missing something?
Eric


Back to the top