Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blobs from Content Store are not deleted from the database when using spring-content-jpa together with PostgreSQL #659

Closed
MartinWilhelm opened this issue Oct 28, 2021 · 1 comment · Fixed by #662

Comments

@MartinWilhelm
Copy link

MartinWilhelm commented Oct 28, 2021

Hi,

we are using spring-content-jpa in combination with spring-content-cmis and a PostgreSQL database.
That means all content store entries are stored as BLOBs in our database.
PostgreSQL doesn't store BLOBs directly in the tables which are used by the application (in our case the content store table BLOB). Instead it only stores a OID there. The BLOB itself is stored in the catalog pg_largeobject (https://www.postgresql.org/docs/9.0/catalog-pg-largeobject.html)
Unfortunately, when we remove the content from the content store, then only the entry from the BLOB table is deleted. The BLOB itself remains available in the pg_largeobject catalog table.
The entries from the the catalog tables pg_largeobject and pg_largeobject_metadata should be removed too.
This is possible by calling "SELECT lo_unlink(OID)" (https://www.postgresql.org/docs/9.4/lo-funcs.html). But this isn't triggered from spring-content-jpa.

Regards
Martin

paulcwarren added a commit that referenced this issue Nov 2, 2021
- delete its associated lob resources

Fixes #659
@paulcwarren
Copy link
Owner

Thanks for the bug report @MartinWilhelm ,

I have submitted a PR with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants