Hi all,
this pull request upgrades the postgresql jdbc driver... who knows, it also
may solve
the timezone issue in prepared statements.

But it may not, if what I see is correct, the timezone ends up being cached
at the connection
level, so we'd have to drop all connections instead of pooling them:
https://github.com/pgjdbc/pgjdbc/blob/bd013c8f02342bf16feb03e91ddc7dcb30a3b102/org/postgresql/jdbc2/TimestampUtils.java#L37
https://github.com/pgjdbc/pgjdbc/blob/7b500209a297d02110da30d3913b6c60c709fdf6/org/postgresql/jdbc2/AbstractJdbc2Statement.java#L1802

Shall we raise a ticket against the postgis driver? Althought, timezone
changing at runtime is indeed something
I would not expect.

Ian, since we drop the connection pool between test, you might solve the
issue by having several test methods
calling a single testing method utility with different time zones.

Cheers
Andrea

On Sun, Jun 7, 2015 at 3:49 AM, Ben Caradoc-Davies <[email protected]> wrote:

> Thanks, Ian, your workaround (disabling all but one time zone for
> PostgisDateOnlineTest) fixes the gt-jdbc-postgis build for me. I had a
> poke around and the JDBC driver changes the date in setDate on the
> prepared statement when the timezone is +14:00! Not sure why (and I have
> not yet attached source for that jar). I am willing to believe your
> conjecture that the original timezone is cached.
>
> This commit of yours disabled the failing coverage:
>
> commit 79ea21088977bbc7900676495df3b7daa22101a3
> Author: Ian Turton <[email protected]>
> Date:   Thu Jun 4 14:00:02 2015 +0100
>      add workround for prepared statements (in Postgresql at least)
> caching the timezone.
>
> Kind regards,
> Ben.
>
> On 02/06/15 09:43, Ben Caradoc-Davies wrote:
> > I now see one new failure for the PS version of PostgisDateOnlineTest;
> > the non-PS version works fine. Tested in Maven with
> > {open,oracle}jdk{7,8} against postgresql 9.4.2-1 amd64 on debian/sid.
> > Also confirmed with openjdk7 in Eclipse.
> >
> > Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.256
> > sec <<< FAILURE! - in org.geotools.data.postgis.ps.PostgisDateOnlineTest
> > testFiltersByDate(org.geotools.data.postgis.ps.PostgisDateOnlineTest)
> > Time elapsed: 0.112 sec  <<< FAILURE!
> > junit.framework.AssertionFailedError: wrong number of records for
> > GMT+14:00 expected:<2> but was:<1>
> >       at junit.framework.Assert.fail(Assert.java:57)
> >       at junit.framework.Assert.failNotEquals(Assert.java:329)
> >       at junit.framework.Assert.assertEquals(Assert.java:78)
> >       at junit.framework.Assert.assertEquals(Assert.java:234)
> >       at junit.framework.TestCase.assertEquals(TestCase.java:401)
> >       at
> >
> org.geotools.jdbc.JDBCDateOnlineTest.testFiltersByDate(JDBCDateOnlineTest.java:63)
>
> --
> Ben Caradoc-Davies <[email protected]>
> Director
> Transient Software Limited <http://transient.nz/>
> New Zealand
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> GeoTools-Devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>



-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to