[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2244) Problem with data type 'Blob'

Xavier Bugaud (JIRA) noreply at atlassian.com
Thu Nov 16 04:22:04 EST 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2244?page=comments#action_25319 ] 

Xavier Bugaud commented on HHH-2244:
------------------------------------

Max :

BLOBs with PostgreSQL are mapped as OID, that is : a reference to rows located in the pg_largeobject system table.

Deleting a row containing blobs (OID) will not automatically remove the corresponding rows in the pg_largeobject table. This is a PostgreSQL feature allowing a single blob to be referenced several times. 

The lo_unlink() function will remove the blob from the pg_largeobject table.
I don't know what is best : calling lo_unlink() or doing a "DELETE FROM pg_largeobject WHERE loid=?". 

> Problem with data type 'Blob'
> -----------------------------
>
>          Key: HHH-2244
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2244
>      Project: Hibernate3
>         Type: Bug

>  Environment: Hibernate version:3.2
> DB: postgresql 8.1
>     Reporter: Gulshanrai BABAJEE

>
>
> I have created a table in which I have a field of type BLOB which I store pictures. I insert a picture, note the oid generated. Then I do the following select statement on table 'pg_largeobject' (system table) : select * from pg_largeobject where loid = 'oid of my picture'. I found the oid.
> Then I update my picture. Its oid has been changed. I now make another select from table 'pg_largeobject' where loid = 'my OLD oid' and I was surprised to see that the old oid is STILL in the table. So I conclude that each time I update a picture from my table. The old oids are still there and eventually my database is increasing in size.
> Is this not a bug in hibernate?
> thanks in advance 

-- 
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