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 Sat, 04 Jun 2005 15:12:16 GMT
Hi,

there was no response to my previous post, thus I checked in the changes
described in the previous post.

Vadim, if you have unit test using stored procedures please run these
tests against CVS OJB_1_0_RELEASE.

Is it correct that methods like PB.getByIdentity(Identity) never using 
stored procedure? In method JdbcAccessImpl#materializeObject I always 
use a "normal" query - is this correct?

To detect a stored procedure a sql-String based detection method was 
used - JdbcAccessImpl#isStoredProcedure(String sql). Did my best to 
implement it as efficient as possible to reduce the performance impact.

regards,
Armin


Armin Waibel wrote:
> 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
> 
> 
> 


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