Let's start with the Hibernate document:
@Lob indicates that the property should be persisted in a Blob or a Clob depending on the property type: java.sql.Clob, Character[], char[] and java.lang.String will be persisted in a Clob. java.sql.Blob, Byte[], byte[] and serializable type will be persisted in a Blob.
For instance:
@Lob public String getFullText() { return fullText; } @Lob public byte[] getFullCode() { return fullCode; }
Knowing this, this may mean that the object is not in the database. It may have been deleted from the table, but this did not happen in the reference table. Let's say that blobs with id 5 were removed from the Blobs table, but in the users_blobs table the users_blobs link is called:
| user_id | blob_id| | 4 | 5 | //This entry blob were delete but is still referenced by that table | 5 | 2 |
If so, you should redefine your users_blobs restrictions (for example) so that it is deleted or null if the blob is removed.
In addition, this link may also be useful:
http://h2-database.66688.n3.nabble.com/IO-Exception-quot-Missing-lob-entry-1-0-quot-90028-171-when-trying-to-read-a-BLOB- longer-than-128-bye-td4026236.html
source share