X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "D Tim Cummings" Received: from mail.triptera.com.au ([159.65.15.17] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.7) with ESMTPS id 26713448 for webobjects-dev@wocommunity.org; Sun, 31 Oct 2021 00:47:10 +0200 Received-SPF: pass receiver=post.selbstdenker.com; client-ip=159.65.15.17; envelope-from=tim@triptera.com.au Received: from localhost (localhost [127.0.0.1]) by mail.triptera.com.au (Postfix) with ESMTP id E1F69182E74 for ; Sat, 30 Oct 2021 22:46:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.triptera.com.au Received: from mail.triptera.com.au ([127.0.0.1]) by localhost (mail.triptera.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qSB5RwtPu0hJ for ; Sat, 30 Oct 2021 22:46:43 +0000 (UTC) Message-ID: <38b6c553-564f-cdcd-1de7-91b2e28adfa4@triptera.com.au> DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=triptera.com.au; s=201903; t=1635634003; bh=7BWrF8+iKnoGqBjpYSuRK4uFBRcqdwCc9CBIhFFU0dU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=jn0QAJ/61XU4O9JWVxSea+0s5p50yZ5T4qxjUU176AnPBp8jT1Ext00nVwIxvhn8j /iI38qF6jJtVEf+yYyOiZBabxI1JCKjFTjsHReYCAuTaKdfJUCVaxd9T+TxpYHvDgb lWs0qyHaV9xx0jCkdx0cXANE5DX2bjhTFtRUFYInt6wdCFdVO6cp4xBq2XU62ooCk6 0dsyVqVriJuTNJXTrNuN0tHCYSoUk79NnZe35ey8SaRkoi6iID1U0Pi22QP/D0WWT9 DwIEbbGC8I1RRd6/n1kPjf3yVUeFj528OocbB3R5g5lCt7Vn5UVeKQgvn7H/Rkwfzp z1DPYqMZN4eNQ== Date: Sun, 31 Oct 2021 08:46:41 +1000 MIME-Version: 1.0 Subject: Re: [WO-DEV] Re: Postgresql jdbc driver upgrade not recommended Content-Language: en-AU To: WebObjects & WOnder Development References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I don't think so Ted. I think the issue is only with 42.3.0. I have tested with 42.2.23, 42.2.24 and 42.3.1 and none of them have that issue. Tim On 31/10/21 02:41, Theodore Petrosky wrote: > Well, I can confirm the same issue with jdbc postgresql-42.2.23.jar. wonder 7.2 > > Ted > >> On Oct 29, 2021, at 6:00 AM, D Tim Cummings wrote: >> >> I have built a small app which demonstrates this behaviour. >> >> https://github.com/timcu/wopg4230 >> >> It is a very simple app with a database with one table with one record with one field (other than the primary key). The app has one WOComponent with one form with one text field and one save button. >> >> It is a maven app but that makes it easy to swap between jdbc driver versions. >> >> I would be interested if other people see the same behaviour. You will need to set up a postgresql database but I have put instructions on the github README.md on how to do that. >> >> Tim >> >> On 27/10/21 20:06, D Tim Cummings wrote: >>> Postgresql data type : Numeric(38,4) allows null >>> >>> Java data type: BigDecimal >>> >>> EOModel using prototype: currencyAmount >>> >>> When number is first retrieved from database it has precision 10 scale 4 eg 150000.0000 >>> >>> I click the edit button which puts the number in a textfield which has numberformat "$#,##0; ($#,##0)" and it displays as $150,000 >>> >>> I click save button. Number in EO is now 150000 with precision 6 and scale 0 >>> >>> I run ec().saveChanges() where ec() is my editingContext. >>> >>> Number in EO is still 150000 with precision 6 and scale 0 >>> >>> I repeat the procedure "edit / save" several times and randomly the number in EO eventually becomes 15 with precision 2 and scale 0. If it happens before the saveChanges() then the new number gets saved to the database. However it can happen after the save in which case my app sees the small number but it doesn't get saved to database if I shutdown the app at that point and start it up again. >>> >>> It looks like a problem with my app except that it only started happening with the new JDBC driver and reverting the JDBC driver removes the problem. >>> >>> >>> Tim >>> >>> >>> On 27/10/21 18:48, Hugi Thordarson wrote: >>>> Hi Tim, >>>> out of curiosity, what's the data type of the number that's getting truncated? (both the DB and java/model side) >>>> >>>> - hugi >>>> >>>> >>>>> On 27 Oct 2021, at 04:53, D Tim Cummings wrote: >>>>> >>>>> I just upgraded my postgresql jdbc driver from 42.2.23 to 42.3.0 and suddenly any number returned from the database that ended in four zeros was having the zeros trimmed. >>>>> >>>>> For example >>>>> >>>>> 150000 became 15 >>>>> >>>>> This did not affect numbers ending in three zeros >>>>> >>>>> 151000 stayed as 151000 >>>>> >>>>> I am still looking for the cause but rolling back to 42.2.23 fixed the problem. Problem was reproducible on Postgresql 10.18 on Ubuntu and Postgresql 13.3 on Mac. >>>>> >>>>> I am using Wonder 7.2 with Postgresql plugin. My project is defined using the maven structure. I was using the postgresql jdbc driver in my pom.xml with >>>>> >>>>> >>>>> org.postgresql >>>>> postgresql >>>>> 42.2.23 >>>>> >>>>> >>>>> Hope this helps >>>>> >>>>> Tim >>>>> >>>>> >>>>> >>>> ############################################################# >>>> This message is sent to you because you are subscribed to >>>> the mailing list . >>>> To unsubscribe, E-mail to: >>>> To switch to the DIGEST mode, E-mail to >>>> To switch to the INDEX mode, E-mail to >>>> Send administrative queries to >>>> >>> ############################################################# >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> To switch to the DIGEST mode, E-mail to >>> To switch to the INDEX mode, E-mail to >>> Send administrative queries to >>> >> > > ############################################################# > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > To switch to the INDEX mode, E-mail to > Send administrative queries to >