users@glassfish.java.net

Re: Timezones, Glassfish, Two different systems: How do I change the TZ of Glassfish?

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Mon, 27 Apr 2009 16:57:05 -0700

I'm wondering how can it work with JDBC and fail with JPA... JPA uses the same
JDBC API to get the data from the database...

Will using property-based persistence where you modify the Date values when they
come from the database solve your problem?

thanks,
-marina

rdblaha1 wrote:
>
>
> Alex Sherwin wrote:
>
>>The underlying JDK uses the systems time I believe...
>>
>
>
> Thank you Marina and Alex. Your information is helpful. While we have been
> working for several years in Java, and your answers gave a help
> consideration for furthering our time library we have developed, we are
> fairly new to Glassfish and persistence. Prior we were using direct JDBC
> access to our database. The database doesn't care one way or another. It
> just accepts time or dates as long integers that has worked great. However,
> we have intentionally based our numbers placed in the database to be UTC.
>
> The problem we are seeing is that the application server appears to apply
> the system time zone of the environment it is in and perform a conversion
> before it persists the value to the database. Since we continue to use the
> older system in parallel with the new system we are developing. Therefore
> the time value Glassfish persists to the database cannot be read by the
> pre-application server system and return the date and time that is expected.
> The older system is not going to be re-written to guess at what Time Zone
> that Glassfish was in when it persisted the time value to the database.
>
> Because of this I was asking if there is a way to tell Glassfish which Time
> zone I want it to use?
>
> Thank you.