cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: DB2 V7 strange bug I think
Date Fri, 13 May 2011 15:12:36 GMT
I think it should be CapsStrategy.LOWER. 

Andrus

On May 13, 2011, at 6:02 PM, Andrew Willerding wrote:

> I inserted the select.setColumnNamesCapitalization(CapsStrategy.UPPER); into the code
and now both MySQL and DB2 return the null data items.
> 
> 
> 
> On 05/13/2011 10:26 AM, Andrew Willerding wrote:
>> I am a very casual but committed user of Cayenne so my knowledge of Cayenne is not
very deep ;-)  I was drawn to its use because I disliked the XML configurations necessary
in other ORM frameworks.  I hope I'm helping and not hindering it's continued development.
>> 
>> Here's the trace with MySQL.  The columns are definitely lower case in this situation.
 I will try the setColumnNameCapitalization method to see if it makes the improvement to DB2
without jeopardizing MySQL.
>> 
>> 
>> 
>> 2011-05-13 08:40:53,311 [http-8084-1] INFO  org.apache.cayenne.access.QueryLogger
- Select * from SurveyResultDetails where survey_id = 1 and question in (Select question from
SurveyQuestions, SurveyQuestionTypes where SurveyQuestionTypes.id = 5 and SurveyQuestions.question_type_id
= 5) order by result, survey_dts
>> 2011-05-13 08:40:53,317 [http-8084-1] INFO  org.apache.cayenne.access.QueryLogger
- === returned 3 rows. - took 6 ms.
>> 2011-05-13 08:40:53,318 [http-8084-1] INFO  org.apache.cayenne.access.QueryLogger
- +++ transaction committed.
>> SurveyResultDetails item=org.apache.cayenne.DataRow@3b1674f0[values={id=50, result=0,
caller_id=5001110410145147, survey_dts=Sun Apr 10 14:53:17 EDT 2011, rec_msg=101453001, question=12,
lang=EN, survey_id=1, note=}, version=-9223372036854775804, replaces=-9223372036854775808]
>> SurveyResultDetails item=org.apache.cayenne.DataRow@3f5756de[values={id=60, result=0,
caller_id=5001110410151543, survey_dts=Sun Apr 10 15:17:11 EDT 2011, rec_msg=101517001, question=12,
lang=EN, survey_id=1, note=}, version=-9223372036854775803, replaces=-9223372036854775808]
>> SurveyResultDetails item=org.apache.cayenne.DataRow@7f08294e[values={id=88, result=0,
caller_id=5001110410161501, survey_dts=Sun Apr 10 16:16:46 EDT 2011, rec_msg=101616001, question=12,
lang=EN, survey_id=1, note=}, version=-9223372036854775802, replaces=-9223372036854775808]
>> 
>> 
>> 
>> 
>> On 05/13/2011 10:14 AM, Andrus Adamchik wrote:
>>> Sorry I may have not made it clear, but the point of this exercise was not to
produce data rows, but to uncover and debug the differences between MySQL and DB2. So could
you print out the data rows (like you did below) for BOTH databases and check the differences.
>>> 
>>> More specifically I am trying to determine whether you need to use 'setColumnNamesCapitalization'
per
>>> 
>>> http://cayenne.apache.org/doc30/advanced-sqltemplate.html
>>> 
>>> Andrus
>>> 
>>> 
>>> On May 13, 2011, at 4:21 PM, Andrew Willerding wrote:
>>> 
>>>> That worked to retrieve a DataRow object.  The data is there now.  Is there
some way to convert this now into a usable cayenne data object without pulling the columns
out of the HashMap one column at a time?  Or is there an underlying bug that is at the root
why this is works for MySQL but not for DB2 V7?
>>>> 
>>>> 2011-05-13 08:43:45,595 [http-8080-1] INFO  org.apache.cayenne.access.QueryLogge
>>>> r - Select * from SurveyResultDetails where survey_id = 1 and question in
(Selec
>>>> t question from SurveyQuestions, SurveyQuestionTypes where SurveyQuestionTypes.i
>>>> d = 5 and SurveyQuestions.question_type_id = 5) order by result, survey_dts
>>>> 2011-05-13 08:43:45,796 [http-8080-1] INFO  org.apache.cayenne.access.QueryLogge
>>>> r - === returned 10 rows. - took 201 ms.
>>>> 2011-05-13 08:43:45,796 [http-8080-1] INFO  org.apache.cayenne.access.QueryLogge
>>>> r - +++ transaction committed.
>>>> SurveyResultDetails item=org.apache.cayenne.DataRow@1533c8[values={SURVEY_DTS=Su
>>>> n Apr 10 14:53:17 EDT 2011, REC_MSG=101453001, RESULT=0, QUESTION=12, ID=50,
NOT
>>>> E=null, CALLER_ID=5001110410145147, LANG=EN, SURVEY_ID=1}, version=-922337203685
>>>> 4775804, replaces=-9223372036854775808]
>>>> SurveyResultDetails item=org.apache.cayenne.DataRow@1faa614[values={SURVEY_DTS=S
>>>> un Apr 10 15:17:11 EDT 2011, REC_MSG=101517001, RESULT=0, QUESTION=12, ID=60,
NO
>>>> TE=null, CALLER_ID=5001110410151543, LANG=EN, SURVEY_ID=1}, version=-92233720368
>>>> 54775803, replaces=-9223372036854775808]
>>>> 
>>>> On 05/13/2011 06:48 AM, Andrus Adamchik wrote:
>>>>> I can suggest a test:
>>>>> 
>>>>> select.setFetchingDataRows(true)
>>>>> 
>>>>> and then print and compare the results between 2 DB's.
>>>>> 
>>>>> Andrus
>>>>> 
>>>> 
>> 
>> 
> 
> 
> -- 
> Andrew Willerding
> Callista CTI
> 
> ph: 416 444-9702 x9455
> fx: 416 444-9732
> cell: 416 712-2323
> www: http://www.callistacti.com
> 
> 


Mime
View raw message