[teiid-commits] teiid SVN: r3610 - in trunk/runtime/src/main: resources/org/teiid/runtime and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Nov 3 22:53:59 EDT 2011


Author: shawkins
Date: 2011-11-03 22:53:58 -0400 (Thu, 03 Nov 2011)
New Revision: 3610

Modified:
   trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
   trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
Log:
TEIID-1812 adding logging for odbc errors

Modified: trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java	2011-11-03 20:25:32 UTC (rev 3609)
+++ trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java	2011-11-04 02:53:58 UTC (rev 3610)
@@ -61,6 +61,7 @@
 import org.teiid.jdbc.TeiidSQLException;
 import org.teiid.logging.LogConstants;
 import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
 import org.teiid.net.socket.ServiceInvocationStruct;
 import org.teiid.odbc.ODBCClientRemote;
 import org.teiid.odbc.PGUtil.PgColInfo;
@@ -233,11 +234,7 @@
 	
 	@Override
 	public void useClearTextAuthentication() {
-		try {
-			sendAuthenticationCleartextPassword();
-		} catch (IOException e) {
-			terminate(e);
-		}
+		sendAuthenticationCleartextPassword();
 	}
 	
 	@Override
@@ -609,7 +606,15 @@
 	}
 	
 	private void sendErrorResponse(Throwable t) {
-		trace(t.getMessage());
+		if (t instanceof SQLException) {
+			//we are just re-logging an exception raised by the engine
+			if (LogManager.isMessageToBeRecorded(LogConstants.CTX_ODBC, MessageLevel.DETAIL)) {
+				LogManager.logWarning(LogConstants.CTX_ODBC, t, "Error occurred"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+		} else {
+			//should be in the odbc layer
+			LogManager.logError(LogConstants.CTX_ODBC, t, RuntimePlugin.Util.getString("PgBackendProtocol.unexpected_error")); //$NON-NLS-1$
+		}
 		SQLException e = TeiidSQLException.create(t);
 		startMessage('E');
 		write('S');
@@ -661,7 +666,7 @@
 	}
 
 	private void sendErrorResponse(String message) {
-		trace("Exception:", message);
+		LogManager.logWarning(LogConstants.CTX_ODBC, message); //$NON-NLS-1$
 		startMessage('E');
 		write('S');
 		writeString("ERROR");
@@ -699,7 +704,7 @@
 		sendMessage();
 	}	
 
-	private void sendAuthenticationCleartextPassword() throws IOException {
+	private void sendAuthenticationCleartextPassword() {
 		startMessage('R');
 		writeInt(3);
 		sendMessage();

Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties	2011-11-03 20:25:32 UTC (rev 3609)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties	2011-11-04 02:53:58 UTC (rev 3610)
@@ -93,6 +93,7 @@
 SSLConfiguration.no_anonymous=The anonymous cipher suite TLS_DH_anon_WITH_AES_128_CBC_SHA is not available.  Please change the transport to be non-SSL or use non-anonymous SSL.
 
 PgBackendProtocol.ssl_error=Could not initialize ODBC SSL.  non-SSL connections will still be allowed.
+PgBackendProtocol.unexpected_error=Unexpected error occurred
 wrong_logon_type_jaas = Wrong logon method is being used. Server is not set up for JAAS based authentication. Correct your client's 'AuthenticationType' property.
 wrong_logon_type_krb5 = Wrong logon method is being used. Server is not set up for Kerberos based authentication. Correct your client's 'AuthenticationType' property.
 krb5_login_failed=Kerberos context login failed



More information about the teiid-commits mailing list