[teiid-issues] [JBoss JIRA] (TEIID-2786) ModeShape ExecutionFactory.getMetadata fails with java.sql.SQLFeatureNotSupportedException

Van Halbert (JIRA) issues at jboss.org
Tue Jan 7 13:34:32 EST 2014


    [ https://issues.jboss.org/browse/TEIID-2786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934257#comment-12934257 ] 

Van Halbert commented on TEIID-2786:
------------------------------------

The following will be implemented:

-  Extend the JDBCMetadataProcessor class to provide ModeShape specific behavior
-  Will add the JCR Procedures to the metadata factory (TEIID-2785)
-  Will make the following settings, based on MODE-2125

The following boolean flags should be set to "false" to prevent calling methods in ModeShape's DatabaseMetaData implementation that are not implemented.
	•	widenUnsingedTypes - ModeShape has no unsigned types anyway (e.g., no short, unsigned short, unsigned int, etc., just LONG and DOUBLE)
	•	importProcedures - ModeShape has no procedures, so this should always be false.
	•	useProcedureSpecificName - this is used only when importProcedures is true, which is never the case.
	•	importKeys - this defaults to true, and if that's the case it attempts to call getPrimaryKeys(...), getIndexInfo(...)}, and {{getImportedKeys(...). ModeShape implements the first two, but not the second. Therefore, *we need to implement getImportedKeys(...) and return an empty result set.
	•	importIndexes - this defaults to false, but ModeShape does implement getIndexInfo(...), so this could be changed to true.
	•	importApproximateIndexes - this defaults to true, but it is only used as the final approximate parameter to getIndexInfo(...), and ModeShape ignores this attribute.
	•	quoteNameInSource - this defaults to true, which is perfect since with ModeShape nearly all names will need to be quoted.
	•	useQualifiedName - this defaults to true, but I think this should be false since ModeShape never needs the identifier names to be qualified with the catalog or schema
	•	useCatalogName - this defaults to true, but I think this should be false since ModeShape sets this to the repository name, and such names should never be used in fully-qualified identifier names in queries.
	•	autoCreateUniqueConstraints - this shouldn't matter, since ModeShape has no foreign keys and thus this flag should never come into play

Notes:
will wrap the new metadata calls to catch  java.sql.SQLFeatureNotSupportedException so that Teiid can make the change independent of ModeShape adding support for the methods.


                
> ModeShape ExecutionFactory.getMetadata fails with java.sql.SQLFeatureNotSupportedException
> ------------------------------------------------------------------------------------------
>
>                 Key: TEIID-2786
>                 URL: https://issues.jboss.org/browse/TEIID-2786
>             Project: Teiid
>          Issue Type: Bug
>          Components: Misc. Connectors
>    Affects Versions: 7.7
>            Reporter: Van Halbert
>            Assignee: Van Halbert
>             Fix For: 8.7
>
>
> When trying to use the Teiid Designer feature of importing using a Teiid Connection fails when the connection is to ModeShape.  The following exception:
> 08:33:44,914 ERROR [stderr] (teiid-async-threads - 2) java.sql.SQLFeatureNotSupportedException
> 08:33:44,915 ERROR [stderr] (teiid-async-threads - 2) 	at org.modeshape.jdbc.JcrMetaData.getTypeInfo(JcrMetaData.java:1656)
> 08:33:44,915 ERROR [stderr] (teiid-async-threads - 2) 	at org.teiid.translator.jdbc.JDBCMetdataProcessor.getConnectorMetadata(JDBCMetdataProcessor.java:107)
> 08:33:44,915 INFO  [org.jboss.as.server] (management-handler-thread - 4) JBAS018559: Deployed "importVDB-vdb.xml" (runtime-name : "importVDB-vdb.xml")
> 08:33:44,916 ERROR [stderr] (teiid-async-threads - 2) 	at org.teiid.translator.jdbc.modeshape.ModeShapeExecutionFactory.getMetadata(ModeShapeExecutionFactory.java:280)
> 08:33:44,916 ERROR [stderr] (teiid-async-threads - 2) 	at org.teiid.translator.jdbc.modeshape.ModeShapeExecutionFactory.getMetadata(ModeShapeExecutionFactory.java:62)
> 08:33:44,916 ERROR [stderr] (teiid-async-threads - 2) 	at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:61)
> 08:33:44,917 ERROR [stderr] (teiid-async-threads - 2) 	at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
> 08:33:44,917 ERROR [stderr] (teiid-async-threads - 2) 	at org.teiid.jboss.VDBService$6.run(VDBService.java:397)
> 08:33:44,917 ERROR [stderr] (teiid-async-threads - 2) 	at org.teiid.jboss.VDBService$7.run(VDBService.java:444)
> 08:33:44,918 ERROR [stderr] (teiid-async-threads - 2) 	at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
> My guess is the local modeshape jdbc driver hasn't been fully vetted in this area, as the remote JDBC version has been the one used when using the Modeshape eclipse plugin for importing the metadata.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the teiid-issues mailing list