title: Spring Boot @Transaction(timeout = 1)
body: <p>I am using <code>spring-boot-starter-data-jpa</code> from Spring Boot 1.5.6</p>
  
  <p>Everything works fine when the transaction timeout is greater than 1, for example 
  <code>@Transaction(timeout = 2)</code>, <code>@Transaction(timeout = 5)</code>, or <code>@Transaction(timeout = 10)</code>, 
  but when i set it to <code>@Transaction(timeout = 1)</code> it throws an exception in less than one second. Here is a snapshot of my code:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Transactional(readOnly=true)
  public interface IUserRepository extends CrudRepository&lt;UserEntity,Long&gt;{
       @Transactional(timeout = 1)
       Iterable&lt;UserEntity&gt; findAll();
  </code></pre>
  
  <p>And the exception is:</p>
  
  <pre class="lang-java prettyprint-override"><code>15:18:11.078 [http-nio-9999-exec-2] ERROR [o.a.c.c.C.[.[.[.[dispatcherServlet]:181] - Servlet.service() for servlet [dispatcherServlet] in context with path [/springJPA-LOCAL] threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: nested exception is javax.persistence.PersistenceException] with root cause
  javax.persistence.PersistenceException: null
  at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
  at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
  at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)
  at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:50)
  at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:329)
  at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:74)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:504)
  at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:489)
  at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
  at com.sun.proxy.$Proxy198.findAll(Unknown Source)
  at com.dharam.springJPA.service.impl.UserServiceImpl.doFindAll(UserServiceImpl.java:29)
  at com.dharam.springJPA.Controller.SpringJPAController.startFindAll(SpringJPAController.java:39)
  at com.dharam.springJPA.Controller.SpringJPAController$$FastClassBySpringCGLIB$$1b008118.invoke(&lt;generated&gt;)
  ... `
  </code></pre>