4 Replies Latest reply on Jun 6, 2006 4:32 AM by peter_kaas

    @Lob doesn't clean up large objects on PostgreSQL?

    peter_kaas

      Running JBoss 4.0.4 GA on both PostgreSQL 7.2 and 8.1 databases, large objects associated with @Lob columns seem to be left behind after deleting the object. This is with the latest JDBC drivers (postgresql-8.1-407.jdbc3.jar).

      Relevant bit of code:

      @Lob
      @Basic(fetch = FetchType.LAZY)
      public byte[] getObject() {
       return object;
      }
      


      Database table:

       Column | Type | Modifiers
      ----------------+-----------------------------+-----------
       id | bigint | not null
       object | oid |
       index | integer | not null
       timestamp | timestamp without time zone |
       transaction_id | character varying(255) |
      


      After deleting an object my row is gone, but the large objects are still visible through \lo_list in psql:

       Large objects
       ID | Description
      -------+-------------
       16421 |
       16422 |
      (2 rows)