db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: Method check Platform.isCallableStatement is not sufficient
Date Fri, 13 May 2005 18:44:02 GMT
Hi all,

I patched PlatformSapdbImpl to support #isCallableStatement in a correct
manner. But it's crap, because the patch have to access two non-public
fields in two sap-driver classes, thus I don't know if older or future
versions of the jdbc-driver will work with this patch.

So I recommend to introduce an contract between StatementManagerIF and
JdbcAccessImpl to specify what kind of statement is used (as Vadim point
out currently there is none) by changing StatementsForClassIF and 
StatementManagerIF. To support OJB-31 and OJB-6 these pluggable 
components are already changed (compare with OJB 1.0.3).

To decide if a CallableStatement is needed or not in JdbcAccessImpl the 
sql-query String will be evaluated (this isn't a smart solution, but it 
won't be costly).

With these changes Platform#isCallableStatement is no longer needed (and 
all problems with maxDB/sapDB are solved).

regards,
Armin


Vadim Gritsenko wrote:
> Armin Waibel wrote:
> 
>> Hi all,
>>
>> after the changes made to support stored procedures returning 
>> ResultSets, all MaxDB/SapDB tests fail, because the check for 
>> CallableStatements made in Platform.isCallableStatement is not 
>> sufficient.
>>
>> The MaxDB driver always retrun a Statement object which is instance of 
>> CallableStatement, so OJB always assume a stored procedure was used. I 
>> think this check is wrong:
>> If instance of statement object is CallableStatement ==> a stored 
>> procedure is used - is wrong!
>>
>> Any suggestions how to fix this?
> 
> 
> Armin,
> 
> DefaultPlatform.isCallableStatement is just an "intelligent guess" on 
> whether the statement is callable or not.
> 
> Please override this method in the concrete platform implementations 
> which can do more precise, platform specific check. For example, it is 
> already overridden in HsqldbPlatform (it does not support calls at all).
> 
> 
> As for necessity of this call, there is no contract between 
> StatementManager and JdbcAccessImpl which would pass the knowledge 
> whether this is a call or not.
> 
> Thanks,
> Vadim
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message