Saturday, 17 March 2018

Caused by: org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode.

A large object refers to the entity property that is modified by @Lob. It may be persisted in several records.

However, in database management system, auto-commit means that each query or persistence is considered as one transaction, and implemented immediately. So, it seems that this setup conflicts a lob property, which may need several statements to persist it.

It may need a transaction to wrap several statements together, between BEGIN and COMMIT.  Turning off the auto-commit mode could be a solution, however, using @Transactional to wrap statements should be a fundamental solution.

I solved the error by this way.



No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...