Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 58866 invoked from network); 3 Dec 2010 16:00:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Dec 2010 16:00:11 -0000 Received: (qmail 59433 invoked by uid 500); 3 Dec 2010 16:00:11 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 59385 invoked by uid 500); 3 Dec 2010 16:00:10 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 59376 invoked by uid 99); 3 Dec 2010 16:00:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Dec 2010 16:00:09 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of greg.monroe@dukece.com designates 152.3.166.24 as permitted sender) Received: from [152.3.166.24] (HELO dukece.com) (152.3.166.24) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Dec 2010 16:00:01 +0000 Received: from ([10.123.20.180]) by smtpgw1.dukece.com with ESMTP with TLS id 4440076.20504919; Fri, 03 Dec 2010 10:58:29 -0500 Received: from durham-e2k7mb1.dukece.com ([10.123.20.181]) by durham-e2k7ca1.dukece.com ([10.123.20.180]) with mapi; Fri, 3 Dec 2010 10:58:36 -0500 From: Greg Monroe To: 'Apache Torque Developers List' Date: Fri, 3 Dec 2010 10:58:35 -0500 Subject: RE: svn commit: r1038355 - /db/torque/village/trunk/src/java/com/workingdogs/village/Schema.java Thread-Topic: svn commit: r1038355 - /db/torque/village/trunk/src/java/com/workingdogs/village/Schema.java Thread-Index: AcuSZ8aL5BnJTGCMSVW9tDP925D4fQABEbewACT2cwA= Message-ID: <55B8568AFA5F144F886F18186BAD5B2C06A8A929A2@durham-e2k7mb1.dukece.com> References: <20101123215625.D118E238897D@eris.apache.org> <4CEC3A22.1050101@apache.org> <4CF80F2F.4070902@apache.org> <55B8568AFA5F144F886F18186BAD5B2C06A8A929A0@durham-e2k7mb1.dukece.com> In-Reply-To: <55B8568AFA5F144F886F18186BAD5B2C06A8A929A0@durham-e2k7mb1.dukece.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org The SummaryHelper class has been refactored to use a new ListOrderedMapCI=20 class that converts all String keys to lowercase. Also, some changes where made to the SummaryHelperTest class to better allow for DB's that might add an UPPER column (Oracle) to the record. The fix that was in place broke wi= th MS SQL. The new code now checks if there's an extra column and adjusts=20 accordingly. Note that if anyone is using this in their code (with a runtime jar built=20 from CVS), they may have to make sure that their code uses the new class to ensure column names are case insensitive. Alternatively, you can still use the OrderMap interface if you make sure your keys are lowercased. I have tested this against MySQL and MS SQL. Testing with Oracle and=20 Postgres would be nice if someone has access/time. TIA > -----Original Message----- > From: Greg Monroe > Sent: Thursday, December 02, 2010 5:34 PM > To: 'Apache Torque Developers List' > Subject: RE: svn commit: r1038355 - > /db/torque/village/trunk/src/java/com/workingdogs/village/Schema.java >=20 > OK, catching up after a week and a bit off... >=20 > FYI - SummaryHelper did not make it into the last Torque release, so it's > only in the repository. The Village release probably should not be held > up by this. >=20 > As pointed out, the underlying problem is that column names in the > metadata > may have different cases depending on the DB server. This means that > results > can be stored under a different name that was defined. >=20 > FWIW - I used ListOrderedMap for the results since it was close to what > you > get in a normal JDBC ResultSet. E.g, access info by index or name. >=20 > Unfortunately, there doesn't seem to be a case insensitive version of > this > in commons. >=20 > I think the quick fix would be to create a subclass of ListOrderedMap > that > added a case insensitive methods like get( String key ), > put( String key, Object value ), indexOf(String key), remove( String > key), > and containsKey ( String key ). Then use this instead of ListOrderedMap > in > the SummaryHelper code. >=20 > Greg >=20 > > -----Original Message----- > > From: Thomas Vandahl [mailto:tv@apache.org] > > Sent: Thursday, December 02, 2010 4:27 PM > > To: Apache Torque Developers List > > Subject: Re: svn commit: r1038355 - > > /db/torque/village/trunk/src/java/com/workingdogs/village/Schema.java > > > > On 28.11.10 21:42, Thomas Fox wrote: > > >> Could you please re-run your test project against Oracle with this > > >> version and tell me the findings? > > > > > > Looks good. The test project runs ok against oracle using the current > > > village 3.3.1 trunk. > > > I did not run the test project for other databases. > > > > Ok. I tested against MySQL and PostgreSQL and the test project worked > > fine. Both consistently fail on SummaryHelperTest, however. > > > > By looking at the code of SummaryHelper I guess this is based on the > > fact that the results are put into a case-sensitive OrderedMap using > the > > column names returned from the database as a key. In the case of > > Postgresql for example, the database returns the column names in lower > > case, so that the test cannot find them. See example output of > > dumpResults(): > > > > ---8<--- > > "group_by1", "count_recs", "avg_int1", "min_int1", "max_int1", > > "sum_int1", "avg_float1", "min_float1", "max_float1", "sum_float1", > > "upper" > > "A1", 4, 2.5000000000000000, 1, 4, 10, 5.0, 2.0, 8.0, 20.0, "A1" > > "B1", 4, 3.5000000000000000, 2, 5, 14, 7.0, 4.0, 10.0, 28.0, "B1" > > "C1", 4, 4.5000000000000000, 3, 6, 18, 9.0, 6.0, 12.0, 36.0, "C1" > > "D1", 4, 5.5000000000000000, 4, 7, 22, 11.0, 8.0, 14.0, 44.0, "D1" > > ---8<--- > > > > So I believe either the test or the implementation is wrong. > > > > Other than this, shall we try another RC for Village 3.3.1? > > > > Bye, Thomas > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org > > For additional commands, e-mail: torque-dev-help@db.apache.org >=20 > DukeCE Privacy Statement: > Please be advised that this e-mail and any files transmitted with > it are confidential communication or may otherwise be privileged or > confidential and are intended solely for the individual or entity > to whom they are addressed. If you are not the intended recipient > you may not rely on the contents of this email or any attachments, > and we ask that you please not read, copy or retransmit this > communication, but reply to the sender and destroy the email, its > contents, and all copies thereof immediately. Any unauthorized > dissemination, distribution or copying of this communication is > strictly prohibited. >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org > For additional commands, e-mail: torque-dev-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org