New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HHH-11773 - Add support for JDBC 4.2 type names #1940
Conversation
Regarding database support in general you need up to date database drivers. To my knowledge the current situation is like this:
This all comes from marschall/threeten-jpa#41 in this project. To be fair I only use |
I created h2database/h2database#536 to fix the issue in H2. |
pgjdbc should definitively support it https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java#L637 |
We use the following drivers:
I'll also try with |
I tried with I'll leave this PR open for a while hoping that JDBC drivers will better handle the new JDBC 4.2 timestamp and time with timezone types. |
I understand this decision. There exist work arounds for people who want to experiment. Probably in time for the JPA 2.1 service release that's part of Java EE 8 this will have to be revisited, let's hope the situation improves until then. Speaking of which right now Hibernate implements support for
private static LocalDateTime getUnstorableValue() {
ZoneId systemTimezone = ZoneId.systemDefault();
Instant now = Instant.now();
ZoneRules rules = systemTimezone.getRules();
ZoneOffsetTransition transition = rules.nextTransition(now);
assertNotNull(transition);
if (!transition.getDateTimeBefore().isBefore(transition.getDateTimeAfter())) {
transition = rules.nextTransition(transition.getInstant().plusSeconds(1L));
assertNotNull(transition);
}
Duration gap = Duration.between(transition.getDateTimeBefore(), transition.getDateTimeAfter());
return transition.getDateTimeBefore().plus(gap.dividedBy(2L));
} Ultimately somebody has to make the first move, if drivers are waiting for frameworks to move first and frameworks are waiting for drivers to move first we end up in a chicken and egg situation see pgjdbc/pgjdbc#695 Yes |
@dreab8 Andrea, check out the comment above about |
Hi @vladmihalcea, |
@dreab8 @sebersole I created HHH-11835 for those findings. |
Any update for this pull request ? I think support Is hibernate still plan to support JDBC 4.2 type names ? |
@abcfy2 until fully supported you may find the threeten-jpa-jdbc42-hibernate subproject of https://github.com/marschall/threeten-jpa to be helpful. Pleas note that:
|
Was fixed in 2c80250 in 6.0.0. Can be closed. |
https://hibernate.atlassian.net/browse/HHH-11773