0 Replies Latest reply on Mar 18, 2008 8:40 AM by heinrich

    Delete entities with LOB

    heinrich

      Hi,

      in what way is it possible to let the EntityManager remove an entity with a LOB property?
      We are using EJB3, JBoss 4.0.5 and Postgres 8.2.
      The underlying table is creates like this

      CREATE TABLE patient.incident_entry_binary(
       id SERIAL PRIMARY KEY,
       binary_content OID
      );
      

      The database stores the binary data in files and writers only an objectid in the table.
      When i try to remove the entity i always get an

      13:26:36,323 ERROR [STDERR] javax.persistence.EntityNotFoundException: deleted entity passed to persist: [lu.tudor.santec.gecamed.patient.ejb.entity.beans.IncidentEntryBinary#<null>]


      exception.


      The part of the entity looks like this:
       @Column(name="binary_content")
       @Lob
       public byte[] getBinaryContent() {
       return binaryContent;
       }
      


      any idea?