[teiid-commits] teiid SVN: r2599 - in branches/7.1.x/engine/src/main: resources/org/teiid/query and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Sep 23 17:09:52 EDT 2010


Author: rareddy
Date: 2010-09-23 17:09:51 -0400 (Thu, 23 Sep 2010)
New Revision: 2599

Modified:
   branches/7.1.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
   branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
Log:
TEIID-1274: Throw exception when the connection factory defined is not found. This will report error correctly when user fat fingers the cf name

Modified: branches/7.1.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java	2010-09-22 21:58:32 UTC (rev 2598)
+++ branches/7.1.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java	2010-09-23 21:09:51 UTC (rev 2599)
@@ -88,7 +88,14 @@
 		
     	if(ef != null) {
     		if (ef.isSourceRequired()) {
-    			Object conn = getConnectionFactory();
+    			
+    			Object conn = null;
+				try {
+					conn = getConnectionFactory();
+				} catch (TranslatorException e) {
+					// treat this as connection not found. 
+				}
+				
     			if (conn == null) {
     				sb.append(QueryPlugin.Util.getString("datasource_not_found", this.connectionName)); //$NON-NLS-1$
     			}
@@ -232,7 +239,7 @@
      * Get the ConnectionFactory object required by this manager
      * @return
      */
-    protected Object getConnectionFactory() {
+    protected Object getConnectionFactory() throws TranslatorException {
     	if (this.connectionName != null) {
     		String jndiName = this.connectionName;
     		if (!this.connectionName.startsWith(JAVA_CONTEXT)) {
@@ -249,7 +256,8 @@
 					}
 				}
 			} catch (NamingException e) {
-			}    		
+				throw new TranslatorException(e, QueryPlugin.Util.getString("connection_factory_not_found", this.connectionName)); //$NON-NLS-1$
+			}   			
     	}
     	return null;
     }

Modified: branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties	2010-09-22 21:58:32 UTC (rev 2598)
+++ branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties	2010-09-23 21:09:51 UTC (rev 2599)
@@ -859,4 +859,5 @@
 
 RequestWorkItem.cache_nondeterministic=Caching command '{0}'' at a session level, but less deterministic functions were evaluated. 
 not_found_cache=Results not found in cache
-failed_to_unwrap_connection=Failed to unwrap the source connection.
\ No newline at end of file
+failed_to_unwrap_connection=Failed to unwrap the source connection.
+connection_factory_not_found=Failed to the Connection Factory with JNDI name {0}. Please check the name for spelling or deploy the Connection Factory with specified name. 
\ No newline at end of file



More information about the teiid-commits mailing list