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

Kathey Marsden commented on DERBY-1227:
---------------------------------------

Mike asked me to post what I know about this issue, which isn't alot but 
perhaps might be a starting point.

THE IMPACT:
Dan had mentioned that this might cause the wrong statement to be returned and 
so could be potentially serious and hard to diagnose in the field.

THE PROBLEM:
I think there are reflection calls for prepared statements for methods that are 
not avable in BrokeredPreparedStatements: e.g. 

Method sh =
                                
getPreparedStatement().getClass().getMethod("getEmbedParameterSetMetaData", 
getParameterMetaDataParam);


THE FIX:
One possible fix might be to implement an 
org.apache.derby.iapi.jdbc.EnginePreparedStatement interface similar to 
EngineConnection that will allow exposure of these methods and allow  
consistant  interaction between EmbedPreparedStatements and 
BrokeredPreparedStatements.
See  org.apache.derby.iapi.jdbc.EngineConnection for a more information.





> Network Server should not use the underlying embedded prepared statement when 
> accessing a BrokeredPreparedStatement
> -------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1227
>          URL: http://issues.apache.org/jira/browse/DERBY-1227
>      Project: Derby
>         Type: Bug

>   Components: Network Server
>     Reporter: Kathey Marsden
>     Priority: Minor
>      Fix For: 10.2.0.0

>
> Network Server should not use the underlying embedded 
> Prepared statement when accessing a BrokeredPreparedStatement.
> In DERBY-1025 Dan pointed out this code which while not related to DERBY-1025 
> does appear to be a problem. Here is his comment regarding this code in 
> DRDAStatement:
>  /**
> * Get prepared statement
> *
> * @return prepared statement
> */
> protected PreparedStatement getPreparedStatement() throws SQLException
> {
> if (ps instanceof BrokeredPreparedStatement)
> return (PreparedStatement)(
> ((BrokeredPreparedStatement) ps).getStatement());
> else
> return ps;
> }
> This code, for some unknown reason due to lack of comments, is getting the 
> underlying embedded statement
> from a BrokeredPreparedStatement. This should not be allowed, the 
> BrokeredStatement wrappers are there to
> hide the embedded statement object as it can change under the covers of the 
> wrapper.

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