X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) From: "Ralf Schuchardt" Received: from mout.gmx.net ([212.227.17.22] verified) by selbstdenker.ag (CommuniGate Pro SMTP 6.3.7) with ESMTPS id 26713106 for webobjects-dev@wocommunity.org; Sat, 30 Oct 2021 19:27:08 +0200 Received-SPF: pass receiver=post.selbstdenker.com; client-ip=212.227.17.22; envelope-from=rasc@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1635614808; bh=q0Equ6UrzpufkBuaz/t5qC3ZyAkXO+PlEno2hbI/hWg=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=KTFS74pAcmt0znmqkHYK8ojQQjfH8LBIFp84y6AZ5zDFh8hko5MZZq2iJEnUhIBuJ ZR25Aj4G/JvlmgeHlpcwYak7vsdMcCJyMUPg/kG4EFcgKKzRshGDC6mgMqiTUwf770 aR0gDD9VaRAAFD649eMtz/21GOQrn3JT7N+CH84o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.32] ([207.89.105.208]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MxDou-1mrpQm0LEW-00xZ6q for ; Sat, 30 Oct 2021 19:26:48 +0200 To: "WebObjects & WOnder Development" Subject: Re: [WO-DEV] Postgresql jdbc driver upgrade not recommended Date: Sat, 30 Oct 2021 19:26:17 +0200 X-Mailer: MailMate (1.14r5820) Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:+QxR2ysGK329flCS4yzHqn+2hgWqinTxLYWA00tpycvqBmoOJA2 9i4VYZBtJ7INng0OmTSyJZTG2dC+OBQ/OV0W0e7oU3KlL8VJUZRBQwtBc7qSqstJt3/HhuC BBzg8CxnzvZfvLE6dShWHEz/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d0AuXVtgQa7HKXV8BqptbaP+Kfv lWLomczpN0rryhPSLL4m2ZWPml5SAIoxjC7SPfWWC8/v3clQTVLGBPweBtdXA8mFWZ8+E95vy cAhYAiKh8RxDMe4YnJWPuv2nTeIKrkwa0uiiqdIL04w8JfuAudrS2Vlg8XfBjmyBYg== There is a new driver version 42.3.1 fixing https://github.com/pgjdbc/pgj= dbc/issues/2326, what looks like it is this issue. On 30 Oct 2021, at 4:14, D Tim Cummings wrote: > I can reproduce the error in just a few lines of code. Is anyone else u= sing Postgresql JDBC driver 42.3.0? > > =C2=A0=C2=A0=C2=A0 public void doRepeatSave() { > =C2=A0=C2=A0 =C2=A0=C2=A0 EOEditingContext ec =3D ERXEC.newEditingConte= xt(); > =C2=A0=C2=A0 =C2=A0=C2=A0 // fetch the first record from database table= tbl_person > =C2=A0=C2=A0 =C2=A0=C2=A0 TblPerson p =3D TblPerson.fetchTblPerson(ec, = null); > =C2=A0=C2=A0 =C2=A0=C2=A0 BigDecimal bd150k =3D BigDecimal.valueOf(1500= 000000, 4); > =C2=A0=C2=A0 =C2=A0=C2=A0 for (int i=3D0; i < 10; i++) { > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 p.setDollarAmount(bd150k); > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 ec.saveChanges(); > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 logger.info("Count " + i + " p.do= llarAmount=3D" + p.dollarAmount() ); > =C2=A0=C2=A0 =C2=A0=C2=A0 } > =C2=A0=C2=A0=C2=A0 } > > After the sixth save (i=3D5) the value gets truncated.The first five ti= mes, saveChanges() doesn't even trigger an SQL "update" event. > > > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog -=C2=A0 =3D=3D=3D Begin In= ternal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 0 p.dollarAmount=3D150000.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 1 p.dollarAmount=3D150000.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 2 p.dollarAmount=3D150000.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 3 p.dollarAmount=3D150000.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 4 p.dollarAmount=3D150000.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 5 p.dollarAmount=3D15.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 6 p.dollarAmount=3D15.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 7 p.dollarAmount=3D15.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 8 p.dollarAmount=3D15.0000 > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Be= gin Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - evaluateExpression= : > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 - 1 row(s) processed= > Oct. 30 12:04:07 wopg4230[56385] DEBUG NSLog=C2=A0 -=C2=A0 =3D=3D=3D Co= mmit Internal Transaction > Oct. 30 12:04:07 wopg4230[56385] INFO com.triptera.demo.wopg4230.compon= ents.Main=C2=A0 - Count 9 p.dollarAmount=3D15.0000 > > On 29/10/21 20:00, 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 v= ersions. >> >> 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 scal= e 4 eg 150000.0000 >>> >>> I click the edit button which puts the number in a textfield which ha= s 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 n= umber in EO eventually becomes 15 with precision 2 and scale 0. If it hap= pens before the saveChanges() then the new number gets saved to the datab= ase. However it can happen after the save in which case my app sees the s= mall 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 happe= ning with the new JDBC driver and reverting the JDBC driver removes the p= roblem. >>> >>> >>> 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 an= d 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 P= ostgresql 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 >>>>> >>>>> >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 org.postgresql >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 postgresql >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 42.2.23 >>>>> >>>>> >>>>> Hope this helps >>>>> >>>>> Tim >>>>> >>>>> >>>>> >>>> >>>> ############################################################# >>>> This message is sent to you because you are subscribed to >>>> =C2=A0=C2=A0 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 >>> =C2=A0the 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 >>>