[hibernate-dev] 6.0 - HQL literals

Dave Cramer davecramer at gmail.com
Mon Jan 13 11:14:37 EST 2020


Dave Cramer


On Mon, 13 Jan 2020 at 11:10, Yoann Rodiere <yoann at hibernate.org> wrote:

> Hi,
>
> As far as I know there wasn't any specific time-related problem with the
> org.postgresql:postrgresql driver. I'm not sure we run tests against
> pgjdbc, that might be something to consider.
>

Please do run your tests against that.

One thing I noted was that you were not using the native interval type for
intervals.


> The problems were mainly with MariaDB/MySQL/Sybase drivers, and we
> upgraded our dependencies since then, so they may behave better now.
>
> In any case, most of the problems come from the conversion to javax.sql
> types and the rendering of these types by the JDBC drivers. If we can pass
> the java.time types to the drivers directly, that would indeed solve lots
> of problems. That would mean losing support for older versions of those
> drivers when it comes to java.time, but maybe it's not a big deal?
>
> Always a tough call, In my experience guaranteed to annoy at least half of
the users.

Dave

>
> On Mon, 13 Jan 2020 at 14:30, Dave Cramer <davecramer at gmail.com> wrote:
>
>> Hi Steve,
>>
>> I'm not sure there is a better way to store the data in the database.
>> Doing
>> any kind of date/time math in anything else but UTC seems fraught with
>> danger.
>>
>>
>> See below as to how we handle Java 8 types.
>>
>> https://github.com/pgjdbc/pgjdbc/blob/db228a4ffd8b356a9028363b35b0eb9055ea53f0/pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java#L961-L968
>>
>> Also tells you which driver I maintain.
>>
>> As far as my interest in this discussion goes. What is the pgjdbc driver
>> doing that is not consistent with what hibernate is doing/wants ?
>>
>> I'd certainly be up for a hibernate compatibility mode.
>>
>> Thanks,
>>
>> Dave Cramer
>>
>>
>> On Sun, 12 Jan 2020 at 23:36, Steve Ebersole <steve at hibernate.org> wrote:
>>
>> > Hi Dave.
>> >
>> > Same - I was swamped with stuff at the end of last week.
>> >
>> > Yes, from what I was reading postgres is a bit strange in storing
>> temporal
>> > values.  Not unique to postgres - many databases do interesting things.
>> >
>> > I'm curious how the driver handles binding Java 8 types directly.  The
>> > JDBC spec was updated to support these types through the generic
>> > `#setObject` methods (`#getObject` as well?).  Does the driver handle
>> this.
>> >
>> > Out of curiosity, which jdbc driver are you helping with?
>> >
>> >
>> >
>> > On Thu, Jan 9, 2020 at 10:23 AM Dave Cramer <davecramer at gmail.com>
>> wrote:
>> >
>> >> Hi,
>> >>
>> >> As one of the maintainers of the postgres jdbc driver I am interested
>> in
>> >> this discussion.
>> >> Postgres only stores date/times in UTC. Everything else is a
>> translation.
>> >> The driver uses the client's timezone for all dates/times (for better
>> or
>> >> worse) If there is anything I can do to help make things easier, let me
>> >> know.
>> >>
>> >>
>> >>
>> >> --
>> >> Sent from: http://hibernate-development.74578.x6.nabble.com/
>> >> _______________________________________________
>> >> hibernate-dev mailing list
>> >> hibernate-dev at lists.jboss.org
>> >> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>> >>
>> >>
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>
>>


More information about the hibernate-dev mailing list