[Bug 57] New: Problems getting autogenerated Keys in Oracle with Oracle JDBC 10.2.03

http://bugzilla.qos.ch/show_bug.cgi?id=57 Summary: Problems getting autogenerated Keys in Oracle with Oracle JDBC 10.2.03 Product: logback-core Version: unspecified Platform: PC OS/Version: Windows Status: NEW Severity: critical Priority: P1 Component: Appender AssignedTo: logback-dev@qos.ch ReportedBy: klaus@ungers-online.com I've encountered troubles logging StackTrace/MDC entries with die DBAppender on our plattform! We are using Oracle 9.2.0.6.0 on a Solaris Box with Oracle JDBC Driver 10.2.0.3! I've debugged the processing of LogMessages into DBAppenderBase.append()! There I found a call "con.prepareStatement(getInsertSQL())" which is followed by a call "subAppend(...)" As far as I understand Oracle Drivers return generatedKeys only, if you use the right prepareStatement() methods, which is in my understanding the following: PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException @see http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html#prepareStat...) which is available since JDK 1.4 -- Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.

http://bugzilla.qos.ch/show_bug.cgi?id=57 ------- Comment #1 from sebastien@qos.ch 2007-03-30 15:10 ------- Hello Klaus, I've checked your problem, I guess that we could change the call to the prepareStatement() method. But before we change it, We have to test it against other databases. Dev notes: The test case of DBAppender uses HSQLDB. That database's driver does not support the call to prepareStatement(String sqlQuery, int getGeneratedKeys)[1]. It looks like MySQL supports that call. [1]http://hsqldb.org/doc/src/org/hsqldb/jdbc/jdbcConnection.html#prepareStateme...) -- Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.

http://bugzilla.qos.ch/show_bug.cgi?id=57 klaus@ungers-online.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |klaus@ungers-online.com ------- Comment #2 from klaus@ungers-online.com 2007-06-26 16:42 ------- Hello Sébastien, any news on this topic, as we are desperately waiting for a fix/solution many thanks in advance. kind regards K:) -- Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.

http://bugzilla.qos.ch/show_bug.cgi?id=57 klaus@ungers-online.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |blocker -- Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.

http://bugzilla.qos.ch/show_bug.cgi?id=57 nojspam@losgibsons.us changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nojspam@losgibsons.us ------- Comment #3 from nojspam@losgibsons.us 2008-01-11 05:16 ------- I think that we can fix this problem by making different prepareStatement() calls in DBAppenderBase depending upon the value of cnxSupportsGetGeneratedKeys. For example, this seemed to fix the problem for me with Oracle 10: PreparedStatement insertStatement; if(cnxSupportsGetGeneratedKeys) { insertStatement = connection .prepareStatement(getInsertSQL(), new String[] { "EVENT_ID" } ); } else { insertStatement = connection .prepareStatement(getInsertSQL()); } -- Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
participants (1)
-
bugzilla-daemon@pixie.qos.ch