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

Leave a comment

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

<Resource name=”jdbc/case-manager” auth=”Container”
    type=”javax.sql.DataSource” maxActive=”100″ maxIdle=”30″ maxWait=”10000″
    Password=”${nuxeo.db.password}” />

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.)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: