[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2680) Blobs not updated on Session.merge() for detached instances

J. Ansorg (JIRA) noreply at atlassian.com
Mon Dec 31 09:32:24 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29212 ] 

J. Ansorg commented on HHH-2680:
--------------------------------

I also have hit this bug. Makes it pretty difficult to work with Hibernate and persisted binary data...

I tracked this down to "core\src\main\java\org\hibernate\type\BlobType.java" in hibernate-core.
The method merge is implemented like this:

            public Object replace(Object original, Object target,
  			SessionImplementor session, Object owner, Map copyCache)
			throws HibernateException {
		//Blobs are ignored by merge()
		return target;
	}

Which explains the bug ;)
The same is valid for ClobType.

I wanted to fix this and tried to build hibernate-core from Svn HEAD, but that failed due to strange maven-antlr-plugin dependencies and missing documentation.
So I'm giving up here.

It would be awesome if this could be fixed!
Otherwise Blobs are quite unusable in Hibernate. A workaround is to use byte[] instead, but that isn't that memory friendly.

> Blobs not updated on Session.merge() for detached instances
> -----------------------------------------------------------
>
>                 Key: HHH-2680
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2680
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.2, 3.2.4.sp1
>         Environment: Windows XP Prof., Java 1.5_010, HSQLDB 1.8.0
>            Reporter: Timo Thomas
>         Attachments: BlobTest.zip
>
>
> Blob columns are not updated when a detached instance is saved at the session with merge(). See attached TestCase.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list