-
1. Re: Update exiting BLOB does not work
carstenrudat Jan 15, 2008 10:57 AM (in response to carstenrudat)Hi,
I tried this with Oracle Express (latest version/very new oracle-driver).
It doesn't work with Oracle, too, so I think it is
a) a failure of my code/understanding of merge and cascade
b) a bug in Hibernate?
Any ideas - please ;-)
Carsten -
2. Re: Update exiting BLOB does not work
carstenrudat Jan 16, 2008 3:42 AM (in response to carstenrudat)Hi all,
I have tested this with Hibernate directly.
a) If I set the blob while my entity (Signature) is attached to a EntityManager-Session, my new blob will be updated to the database
b) If I set the blob while it is not attached, then reattache to a new session and calling a EntityManager.merge(signature) the blob will not be updatet to the database.
Is a) the only way to update a blob? If I create a new Signature with a Blob (not attached) and call EntityManager.perist(signature), my blob will also be inserted. So, why does update causes these problems?
Thanks,
Carsten -
3. Re: Update exiting BLOB does not work
carstenrudat Jan 16, 2008 5:25 AM (in response to carstenrudat)...debugging Hibernate - BlobType.replace says:
public Object replace(Object original, Object target, SessionImplementor session, Object owner, Map copyCache) throws HibernateException { //Blobs are ignored by merge() return target; }
"It's not a bug - it's feature"?!