Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 86936 invoked from network); 12 Aug 2008 06:44:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Aug 2008 06:44:50 -0000 Received: (qmail 83145 invoked by uid 500); 12 Aug 2008 06:44:49 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 83135 invoked by uid 500); 12 Aug 2008 06:44:49 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 83124 invoked by uid 99); 12 Aug 2008 06:44:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Aug 2008 23:44:49 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of oyvindharboe@gmail.com designates 209.85.200.170 as permitted sender) Received: from [209.85.200.170] (HELO wf-out-1314.google.com) (209.85.200.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Aug 2008 06:43:52 +0000 Received: by wf-out-1314.google.com with SMTP id 25so2139871wfc.28 for ; Mon, 11 Aug 2008 23:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=NVaNZvlVXRpewe6R48gI8Xe6M4sKzSgBz54A+qZ6zuQ=; b=YU1ic6Ic+gkczc6bJANAAwbySHpMKo+L47rdrOYuOcaBoTm8VNmcePkctfP+y1d32N 7eZO6K2l8yPnXCujOeURfcnmvySQ8KTBsGZHkq6neeAVzw70esLem/jGMpC/egsxL63f 6RSZbZ5knBAVrUL4K/kdvfE4vcOS/qEMn1HZo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=QfCKYuRp5eedSWeaDK5QgaYANoqXclEjzEFz5agRS76rdBj2FvtgAxRlslVwsXhYv2 1C+nYqxp54P02H80eoFHk2We9i+IzWOP8WDVM80ACUu3SwsS9WmlEUsJFHDBYdmjSM2r 1BtROcchVfijgjHCvk6LinLzVvH6RzioVPme0= Received: by 10.142.47.13 with SMTP id u13mr2510333wfu.170.1218523460346; Mon, 11 Aug 2008 23:44:20 -0700 (PDT) Received: by 10.142.50.21 with HTTP; Mon, 11 Aug 2008 23:44:20 -0700 (PDT) Message-ID: Date: Tue, 12 Aug 2008 08:44:20 +0200 From: "=?ISO-8859-1?Q?=D8yvind_Harboe?=" Sender: oyvindharboe@gmail.com To: user@cayenne.apache.org Subject: Re: NUMERIC default scale behaves differently on Derby & SQL Server In-Reply-To: <0BAED557-4846-44B7-B85B-E8B58079073C@objectstyle.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <6955CF3B-38A8-43DF-BD1B-D740F3F55BB2@objectstyle.org> <616EDC8D-A5D5-48B9-8B3E-DE691A1D57A3@objectstyle.org> <0BAED557-4846-44B7-B85B-E8B58079073C@objectstyle.org> X-Google-Sender-Auth: 2fca2db99a44bc71 X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Aug 12, 2008 at 12:26 AM, Andrus Adamchik wrote: > > On Aug 9, 2008, at 12:18 PM, =D8yvind Harboe wrote: > >> I guess the problem I see is that I test only against one or two databas= es >> so I'd rather see the *same* behaviour across databases regardless of wh= at >> JDBC is defined to do... > > I understand. > >> We flipped scale=3D"2" for all our NUMERIC types >> since that is what our application assumes. > > I think this is the "correct solution" as it explicitly tells the driver > what to do leaving no room for ambiguity. I am still unsure about what th= e > Cayenne default behavior should be (when there's no scale set). Good question indeed. Perhaps this is just a bug in Derby? Shouldn't scale -1 mean infinite precision for BigDecimal? I *could* add a BigDecimal extended type to handle this in a way that follows the *applications* rules, right? (whatever those rules might be). Make scale=3D0 default? Forces user to choose? Perhaps add a file to cayenne which lists known ideosynchrazies across databases? Keep it under Subversion such that it is in sync w/source code from a historical point of view, a javadoc comment would do... That would only document it, not necessarily help the developers catch the problem up front(as that would require reading documentation and everybody knows how well that works...) I can't think of anything that is a 30% improvement over the current state of affairs, so perhaps doing nothing is just as well... --=20 =D8yvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9 XScale Cortex JTAG debugger and flash programmer