December 17, 2011 by huionn
I encountered this error yesterday. I thought it is common error and so easy to solve. Unfortunately, all google search results are mostly irrelevant.
After trying many ways in void, finally I look into the source codes of PostgreSQL JDBC.
What does not make sense to me is that although my operation is performed within JTA transaction, postgresql still insists to be in auto-commit=off mode in order to insert the LOB.
After hours of googling + trials an errors, finally I understand what happens – it is due to the subtle mis-configuration of Tomcat resource in nuxeo.xml as shown in https://jira.nuxeo.com/browse/NXP-6985
<Resource name=”jdbc/case-manager” auth=”Container”
type=”javax.sql.DataSource” maxActive=”100″ maxIdle=”30″ maxWait=”10000″
The JTA requires org.postgresql.xa.PGXAConnection which properly sets the autocommit based on context. (Actually I did try to use PGXAConnection, but got no effect because of incorrect configuration also.)