These are chat archives for hibernate/hibernate-orm

31st
Jul 2017
Declan Curran
@dcrn
Jul 31 2017 03:07
I added an issue related to my previous messages: https://hibernate.atlassian.net/browse/HHH-11900
Eugene Tolbakov
@etolbakov
Jul 31 2017 11:02
Hello everyone!
I'm investigating some search results inconsistency depending on the environment(I'm using postgres db 9.4, hibernate 4.3.8 / jpa 2.1)
I have an assumption that a JDBC driver detects the character encoding differently and that causes the issue.
Could someone help me and give me a hint (or place in the code) where hibernate interacts with the driver and determines encoding, so I can verify my idea?
Thanks a lot !
Chris Cranford
@Naros
Jul 31 2017 13:16
@dcrn I'm a bit confused about HHH-11900
If I understand correctly, a merge followed by detach actually should not persist the changes.
Thats at least according to the EntityManager#detach java doc
e.g. Unflushed changes made to the entity if any (including removal of the entity), will not be synchronized to the database.
so if you want to merge then detach, make sure you flush prior to detach
ryan2049
@ryan2049
Jul 31 2017 13:19
yeah @Naros I was thinking the same thing...the test case he wrote might show some inconsistencies with repeated detach/merge operations, but I'd really like to see the scenario that is being done in his code because I get the feeling he's doing something wrong
Chris Cranford
@Naros
Jul 31 2017 13:19
what I do find strange is that detach, merge, detach without a flush persisted the changes per your jira.
in that use case, depending on how you setup the test, I don't think that should.
@ryan2049 I agree. @dcrn Could you update the JIRA with your test case you used with the detach/merge/detach scenario for completness?
@dcrn I added a comment on the JIRA in case you don't see this chat.
ryan2049
@ryan2049
Jul 31 2017 13:24
@etolbakov Hibernate documentation refers to a hibernate.connection.charSet, I'm not certain if it works with postgres, but I believe any additional driver properties can be set under the hibernate.connection namespace
I imagine these are the properties you could set https://jdbc.postgresql.org/documentation/head/connect.html (on top of the default hibernate ones)