title: JPA spring @Transaction autocommit
body: <p>I am using spring-data-jpa with oracle.  I am unable to get @Transactional to rollback by default for runtime exception.  </p>
  
  <p>Here are snippets:</p>
  
  <pre><code>&lt;persistence-unit name="dev2db" transaction-type="RESOURCE_LOCAL"&gt;
          &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
          &lt;properties&gt;
              &lt;property name="hibernate.archive.autodetection" value="class, hbm"/&gt;
              &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/&gt;
              &lt;property name="hibernate.hbm2ddl.auto" value="validate" /&gt;
  
              &lt;property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver" /&gt;
              &lt;property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@host:port" /&gt;
              &lt;property name="javax.persistence.jdbc.user" value="loginid" /&gt;
              &lt;property name="javax.persistence.jdbc.password" value="mypass" /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  </code></pre>
  
  <p>transactional method uses import javax.transaction.Transactional;</p>
  
  <pre><code>@Transactional
      public void uploadPanelAndAPK(String pz, byte[] file, String apk, byte[] fileApk, byte[] icon) {
          uploadPanel(pz, file);
          uploadApk(apk, fileApk, icon);
  
      }
  </code></pre>
  
  <p>if uploadApk fails uploadPanel is not doing rollback.</p>
  
  <p>beans context.xml snippet:</p>
  
  <pre><code>&lt;context:annotation-config /&gt;
      &lt;tx:annotation-driven transaction-manager="transactionManager"/&gt;
      &lt;jpa:repositories base-package="com.myco.dao" /&gt;
  
      &lt;bean id="transactionManager" 
            class="org.springframework.orm.jpa.JpaTransactionManager"
            p:entityManagerFactory-ref="entityManagerFactory"/&gt;
  
  
      &lt;bean id="entityManagerFactory" 
            class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
            p:persistenceUnitName="dev2db"&gt;
          &lt;property name="jpaVendorAdapter"&gt;
              &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="panelbo" class="com.myco.bo.PanelServiceSpringData"/&gt; 
  </code></pre>
  
  <p>Regards,</p>
  
  <p>Miten.</p>