hibernate-orm
hibernate-orm copied to clipboard
HHH-14725 Fix reset handling on BlobProxy
https://hibernate.atlassian.net/browse/HHH-14725
How about wrapping an InputStream
to make sure closing only happens at the end of a TX when we do resource cleanup in Hibernate? If we see that the InputStream
doesn't support marking, we could read the contents first into a byte[]
and then serve data from there, or alternatively, write into a temporary file and serve data from that.
Is there maybe an ETA when this will be merged? We have encountered an issue with exactly this problem recently.
Our workaround for now is:
We refresh
the Entity
with the Blob
using the EntityManager
before operating on the Blob's InputStream/Bytes
.
Another workaround is to use a Session
and get the Entity
with the Blob
from the Session
and then operate on the InputStream / bytes[]
.
How about wrapping an
InputStream
to make sure closing only happens at the end of a TX when we do resource cleanup in Hibernate? If we see that theInputStream
doesn't support marking, we could read the contents first into abyte[]
and then serve data from there, or alternatively, write into a temporary file and serve data from that.
Hi @beikov do we have another proxy type that does this so I can use that as a reference guide?
It's fine, let's merge this as soon as tests succeed.
The test seems to fail @Naros