title: Getting "java.sql.SQLException:Transactions not supported" Error while calling Spring Boot Rest API with Informix Database
body: <p>I Have Created a Simple Spring boot Rest Application which can get/post the data to the Informix Database.</p>
  <p>While Calling the Rest API getting below mentioned Error Message, I have searched for root cause  about the same but not found any sources,</p>
  <p>Appreciate help on this, Here is the Configuration  and code which I have created:</p>
  <blockquote>
  <p><em>application.properties</em></p>
  </blockquote>
  <pre><code>spring.datasource.url=jdbc:informix-sqli://XXXX:XXXX/localdb:INFORMIXSERVER=ol_xxxxx
  spring.datasource.username=username
  spring.datasource.password=password
  spring.datasource.driver-class-name=com.informix.jdbc.IfxDriver
  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.InformixDialect
  spring.jpa.hibernate.ddl-auto=update
  </code></pre>
  <blockquote>
  <p>Along with spring starter web, Data JPA, Dev Tools Added below Additional Dependency</p>
  </blockquote>
  <pre><code>   &lt;dependency&gt;
          &lt;groupId&gt;com.ibm.informix&lt;/groupId&gt;
          &lt;artifactId&gt;jdbc&lt;/artifactId&gt;
          &lt;version&gt;4.10.8.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  <blockquote>
  <p>Rest Controller</p>
  </blockquote>
  <pre><code>@RestController
  @RequestMapping(&quot;/api&quot;)
  public class UserController {
      @Autowired
      UserRepository repository;
      
      @GetMapping(&quot;/user/{userId}&quot;)
      public void getUserDetails(@PathVariable Long countryId) {
        Optional&lt;webCountry&gt; country = repository.findById(countryId);
        System.out.println(country);
      }
      
      @PostMapping(path=&quot;/saveuser&quot;)
      public void saveUser(@RequestBody UserEntity user) {
          repository.save(data);
      }
  }
  </code></pre>
  <blockquote>
  <p>Repository Interface</p>
  </blockquote>
  <pre><code>@Repository
  public interface UserRepository extends JpaRepository&lt;UserEntity, Long&gt; {
  
  }
  </code></pre>
  <blockquote>
  <p>While Calling the Get API from post Man getting Below Error Message</p>
  </blockquote>
  <pre><code>    Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.TransactionException: JDBC begin transaction failed: ] with root cause
  
  java.sql.SQLException: Transactions not supported
      at com.informix.util.IfxErrMsg.buildException(IfxErrMsg.java:474) ~[jdbc-4.10.8.1.jar:4.10.8.1]
      at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:443) ~[jdbc-4.10.8.1.jar:4.10.8.1]
      at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:394) ~[jdbc-4.10.8.1.jar:4.10.8.1]
      at com.informix.jdbc.IfxSqliConnect.setAutoCommit(IfxSqliConnect.java:2426) ~[jdbc-4.10.8.1.jar:4.10.8.1]
      at com.zaxxer.hikari.pool.ProxyConnection.setAutoCommit(ProxyConnection.java:414) ~[HikariCP-3.4.5.jar:na]
      at com.zaxxer.hikari.pool.HikariProxyConnection.setAutoCommit(HikariProxyConnection.java) ~[HikariCP-3.4.5.jar:na]
      at org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.begin(AbstractLogicalConnectionImplementor.java:72) ~[hibernate-core-5.4.25.Final.jar:5.4.25.Final]
      at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.begin(LogicalConnectionManagedImpl.java:282) ~[hibernate-core-5.4.25.Final.jar:5.4.25.Final]
      at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin(JdbcResourceLocalTransactionCoordinatorImpl.java:246) ~[hibernate-core-5.4.25.Final.jar:5.4.25.Final]
      at org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:83) ~[hibernate-core-5.4.25.Final.jar:5.4.25.Final]
      at org.springframework.orm.jpa.vendor.HibernateJpaDialect.beginTransaction(HibernateJpaDialect.java:184) ~[spring-orm-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:402) ~[spring-orm-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400) ~[spring-tx-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) ~[spring-tx-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:574) ~[spring-tx-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:361) ~[spring-tx-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) ~[spring-tx-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:178) ~[spring-data-jpa-2.3.6.RELEASE.jar:2.3.6.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
  </code></pre>