cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Set timezone on connection
Date Tue, 04 Aug 2015 11:07:09 GMT
Hi Markus,

If I'm reading the JavaDocs correctly for OracleConnection, then it is
simply an extension of JDBC's Connection, which means you'd probably run
into issues when using a connection pool, as you are only setting the time
zone on one connection.  Also, many connection pools will close idle
connections, and I suspect any time zone information would be lost for that
connection as well.

mrg


On Sun, Aug 2, 2015 at 4:54 AM, Markus Reich <markus.reich@markusreich.at>
wrote:

> Hi,
>
> here is an example
>
> conn = ((DataContext)
>
> context).getParentDataDomain().getDefaultNode().getDataSource().getConnection();
> OracleConnection c = (OracleConnection) conn.getMetaData().getConnection();
> TimeZone tz = TimeZone.getTimeZone("Europe/Berlin");
> c.setDefaultTimeZone(TimeZone.getTimeZone("GMT+0" + tz.getOffset(new
> Date().getTime()) / 1000 / 3600 + ":00"));
>
> 2015-07-31 19:25 GMT+02:00 Andrus Adamchik <andrus@objectstyle.org>:
>
> > > We found a possibility in setting a certain timezone on the java
> > connection.
> >
> > Could you show an example of this?
> >
> >
> > > On Jul 31, 2015, at 5:18 PM, Markus Reich <markus.reich@markusreich.at
> >
> > wrote:
> > >
> > > Hi,
> > >
> > > we've some problems with oracle and timzone in combination with
> daylight
> > > savings :-(
> > > When I search the web to this topic, I can see that we are not the only
> > one
> > > having problems concerning oracle and daylight saving ;-)
> > > But it seems that there's no proper solution to fix it :-(
> > >
> > > We found a possibility in setting a certain timezone on the java
> > connection.
> > > My question what would be the best solution in cayenne to set the
> > timezone
> > > on the based java connection object?
> > >
> > > br
> > > Meex
> >
> >
>
>
> --
> *Markus Reich*
> Waldweg 62
> 6393 St. Ulrich am Pillersee
> www.markusreich.at / www.meeximum.at
> markus.reich@markusreich.at
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message