If you try to use combination of Spring Boot (1.3.3), Spring Data JPA, Atomikos and PostgreSQL database you will probably experience an exception during start of an application.
java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
at org.postgresql.Driver.notImplemented(Driver.java:642) ~[postgresql-9.4.1209.jre7-20160307.201142-10.jar:9.4.1209.jre7-SNAPSHOT]
com.atomikos.datasource.pool.CreateConnectionException: an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s): connection is erroneous
at com.atomikos.jdbc.AtomikosXAPooledConnection.testUnderlyingConnection(AtomikosXAPooledConnection.java:116) ~[transactions-jdbc-3.9.3.jar:na]
These exceptions appears because JPA (Hibernate) supported by Atomikos is trying to verify PostgreSQL CLOB feature. This feature is not implemented by JDBC driver, so driver throws an unimportant exception. Unfortunately Atomikos has an exception listener which marks a connection as erroneous if any exception occurs.
To suppress this behaviour you have to disable driver's feature detection and then configure it's features manually. This is kind of shady undocumented way of how to do that, but it works.
# Disable feature detection by this undocumented parameter. Check the org.hibernate.engine.jdbc.internal.JdbcServiceImpl.configure method for more details.
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false
# Because detection is disabled you have to set correct dialect by hand.
For more details about configuration of distributed transactions with Atomikos check the Fabio Maffioletti's article.