Author: vhalbert(a)redhat.com
Date: 2009-04-23 18:43:10 -0400 (Thu, 23 Apr 2009)
New Revision: 839
Modified:
trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java
Log:
JBEDSP-803 - this is related to the postgres issue, changed to determine the quote at the
initialization of the class instead on every call (getDatabaseMetadata() can be expensive
is called on every write)
Modified: trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java 2009-04-23
21:53:29 UTC (rev 838)
+++ trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java 2009-04-23
22:43:10 UTC (rev 839)
@@ -29,6 +29,7 @@
import java.util.Date;
import java.util.Properties;
+import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.CommonPlugin;
import com.metamatrix.common.config.CurrentConfiguration;
import com.metamatrix.common.config.JDBCConnectionPoolHelper;
@@ -164,6 +165,8 @@
private String insert;
private boolean shutdown = false;
+
+ private String quote = null;
public DbLogWriter(Properties properties) {
@@ -223,6 +226,22 @@
} catch(Exception e) {
// ignore and use default
}
+
+ Connection connection = null;
+ try {
+ connection = JDBCConnectionPoolHelper.getInstance().getConnection();
+ quote = JDBCPlatform.getIdentifierQuoteString(connection);
+
+ } catch (SQLException e) {
+ } finally {
+ if( connection != null ) {
+ try {
+ connection.close();
+ } catch (SQLException e) {
+
+ }
+ }
+ }
}
@@ -275,7 +294,6 @@
insertStr.append(COMMA);
insertStr.append( ColumnName.THREAD );
insertStr.append(COMMA);
- String quote = JDBCPlatform.getIdentifierQuoteString(c);
insertStr.append( quote+ ColumnName.EXCEPTION +quote );
insertStr.append(VALUES);
this.insert = insertStr.toString();
Show replies by date