Issue Type: Improvement Improvement
Affects Versions: 4.1.7
Assignee: Steve Ebersole
Components: core
Created: 17/Oct/12 8:44 AM
Description:

When the user wants to create a lob-locator (mapped in the entity as a JDBC Blob/Clob/NClob), Hibernate provides a convenience for creating the lob-locator instance via the LobHelper obtained from the Session. LobHelper provides methods to create Blobs, Clobs and NClobs.

There are forms for each that accept an existing stream. Currently, how that gets handlesd and eventually passed to the database is inefficient. The problem is twofold.

First, we try to rely on the lob-locator creation of the JDBC driver if possible. THe problem there is that those methods do not accept and parameters. So you simply create an empty lob-locator which you then need to fill. And the only way to fill it given an InputStream is to copy that stream's content over. Which causes the stream data to be read into memory.

Second, we have a suboptimal implementation of copying streams from an in-memory lob-locator to the JDBC driver as a stream. Specifically, this is in cases where the LobHelper is not using the JDBC driver's lob creation methods, instead creating a "mock" lob.

Fix Versions: 4.1.8, jpa21
Project: Hibernate ORM
Priority: Major Major
Reporter: Steve Ebersole
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira