[ 
http://issues.apache.org/jira/browse/DERBY-1191?page=comments#action_12373669 ] 

Kathey Marsden commented on DERBY-1191:
---------------------------------------

I disagree.

The description of  derby.stream.error.logSeverityLevel the property says:
Specifies which errors are logged to the Derby error log (typically the 
derby.log file). In test environments, use the setting 
derby.stream.error.logSeverityLevel=0 so that *all*  problems are reported.

http://db.apache.org/derby/docs/dev/tuning/rtunproper26985.html

Only printing some of the exceptions causes support issues. When users get 
unexpected exceptions, we usually ask them to set 
derby.stream.error.logSeverityLevel=0  and send the derby.log.  It is very 
useful to have the exception there, complete with the full exception chain,  
regardless of where it came from and not have to worry about getting traces 
output from the application.


Here is one current support case example:  

Issue: Create database fails with "Database not found" exception after creating 
the database.

There have been multiple round trips so far:

1) Initial issue:
"We are seeing this error  creating the database but the database actually gets 
created ok"
ij> connect 'jdbc:derby:databases/TopDown1;create=true';
ERROR XJ004: Database 'databases/TopDown1' not found.
SQL Exception: Database 'databases/TopDown1' not found.

2) Asked for derby.log with derby.stream.error.logSeverityLevel=0
"Here is the log file  <derby.log>
However, it does not contain any useful info :-("

3) Asked for  ij stack trace with ij.exceptionTrace=true
[java] ij> connect 'jdbc:derby:databases/TopDown1;create=true';
     [java] ERROR XJ004: Database 'databases/TopDown1' not found.
     [java] SQL Exception: Database 'databases/TopDown1' not found.
     [java]     at java.lang.Throwable.<init>(Throwable.java:196)
     [java]     at java.lang.Exception.<init>(Exception.java:41)
     [java]     at java.sql.SQLException.<init>(SQLException.java:40)
     [java]     at org.apache.derby.impl.jdbc.EmbedSQLException.<init>(Unknown 
Source)
     [java]     at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
     [java]     at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
     [java]     at 
org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
     [java]     at 
org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
     [java]     at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown 
Source)
     [java]     at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown 
Source)
     [java]     at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown 
Source)
     [java]     at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
     [java]     at java.sql.DriverManager.getConnection(DriverManager.java:525)
     [java]     at java.sql.DriverManager.getConnection(DriverManager.java:140)
     [java]     at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown 
Source)
     [java]     at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown 
Source)
     [java]     at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
     [java]     at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
     [java]     at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
     [java]     at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
     [java]     at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
     [java]     at org.apache.derby.tools.ij.main(Unknown Source)

Many other cases regarding errors thrown from the JDBC API occur  because we 
have a bug or  user expectations are different (ala DERBY-1158).  Regardless of 
whether this issue is a bug or not,  when communicating with  users it is 
really good for the derby.log to be a one stop shop for exceptions.



> Some SQLExceptions, for example those generated from BrokeredStatements,  do 
> not print to derby.log even  when  derby.stream.error.logSeverityLevel=0
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1191
>          URL: http://issues.apache.org/jira/browse/DERBY-1191
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Versions: 10.1.2.3, 10.2.0.0, 10.1.3.0
>     Reporter: Kathey Marsden
>     Priority: Minor

>
> I found this when working on DERBY-1047.   Exceptions thrown  using 
> org.apache.derby.impl.jdbc.Util.generateCsSQLException()
> do not print to derby.log even when derby.stream.error.logSeverityLevel=0
> For example the attached repro  generates an expected exception but does not  
> print the error to the log.
> java -Dderby.stream.error.logSeverityLevel=0 Derby1047
> This causes an expected exception to be thrown but it does not print to the 
> derby.log
> 10.2.0.0 alpha
> Apache Derby
> Apache Derby Embedded JDBC Driver
> done creating  table
> COL1
> -----------
> 1
> 2
> PASS: Expected Exception can'tholdable cusror in global xact:Cannot set 
> holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
> COL1
> -----------
> 1
> 2
> 3
> The code generating the exception is in 
> org.apache.derby.iapi.jdbc.BrokeredStatement
>   final void checkHoldability() throws SQLException {
>         int holdability = 
> controlCheck().checkHoldCursors(resultSetHoldability);
>         if (holdability != resultSetHoldability)
>             throw Util.generateCsSQLException(SQLState.CANNOT_HOLD_CURSOR_XA);
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to