These are chat archives for hibernate/hibernate-orm

21st
Sep 2017
Dan Cancro
@dancancro
Sep 21 2017 01:50
Hi all. I'm a rank amateur at Hibernate so this should be an easy question. How does Hibernate pluralization magic work and can I turn it off completely for my application? I have a many-to-many, self-referential relationship between one table and itself and it was working with my in-memory H2 development build but then when I did the postgresql production build it complained that an "s" was missing. I now can't find this omission. The error message names an offending "author_id" field that it wants to be "authors_id" but a complete search of my codebase for "author_id" turns up nothing involving the join table in the error's sql.
Playing with it some more, I get an error that names a bad "AUTHOR_FOLLOWERS" table but the text "AUTHOR_FOLLOWERS" exists nowhere in my code. The join table is called "AUTHOR_FOLLOWER".
I'd like to just not have any pluralization at all
Giovanni Lovato
@heruan
Sep 21 2017 18:16
What happens to a java.sql.Blob, when the session is closed? I'm experiencing strange behaviors, like if all the data gets loaded in memory. If so, where does this happen?
ryan2049
@ryan2049
Sep 21 2017 18:19
do you sleep @heruan ? lol
ryan2049
@ryan2049
Sep 21 2017 18:32
https://stackoverflow.com/a/10763047/3641203 this answer gives a good overview
Giovanni Lovato
@heruan
Sep 21 2017 19:37
Are you everywhere @ryan2049? :smile:
Thank you for the link! I understand that the EM is closed when returning from the persistence layer, but how Blobs stream are handled when it happens?
I'm using the SQL Server JDBC driver, which implements Blobs returning live streams from the DB (while for example the MySQL JDBC driver returns Blobs with a byte[] stream).
But, regardless of this, in Hibernate the Blob's data gets loaded in memory at some point.
Giovanni Lovato
@heruan
Sep 21 2017 19:42
I need to stream large files from database, so I'm trying to figure out if I can do this with the container managed persistence layer, or not.