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

David Van Couvering commented on DERBY-1061:
--------------------------------------------

OK, I see the issue, and I see what you're trying to do to solve it.  

However, I think the better approach is to change the declaration of 
exceptionThrownOnStoredProcInvocation_ to be of type SqlException instead of 
type java.sql.SQLException.  Then you can just assign it to 'e' rather than 
calling 'e.getSQLException()' or doing your information-lossy conversion to a 
SQLException.

In my analysis using NetBeans' "findUsages", the only place where 
exceptionThrownOnStoredProcInvocation_ is used is in the printTrace() routine, 
where all it does is look at the error code.  This can be done with 
SqlException just as well as with SQLException.

So I think the only change you need to make is from

    java.sql.SQLException exceptionThrownOnStoredProcInvocation_;

to

    SqlException exceptionThrownOnStoredProcInvocation_;

David



> SqlException while fetching message results in recursive calls between 
> SqlException.getSQLException and Sqlca.getJDBCMessage
> ----------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1061
>          URL: http://issues.apache.org/jira/browse/DERBY-1061
>      Project: Derby
>         Type: Sub-task
>     Reporter: Anurag Shekhar
>     Assignee: Anurag Shekhar
>  Attachments: derby-1061.diff, derby-1061_2.diff, derbyall_report.txt
>
> stored procedure is used to fetch localised message in net work client
> because of issue 1059 the call to the stored prcedures fails resulting in 
> SqlException. When  SqlException.getSQLException, to set 
> exceptionThrownOnStoredProcInvocation_, is called it again results in a call 
> to SqlException.getMessage which call Sqlca.getJDBCMessage. 
> The cycle repeats and finally ends up with StackOverfilowError
> fixing 1059 will solve this problem temporarily but some other situaltion may 
> cause it again.
> Isuggest seting SqlException itself to exceptionThrownOnStoredProcInvocation_ 
> to break this loop.

-- 
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