title: Hibernate mysql innodb
body: <p>I wanted to force hibernate to use innodb.</p>
  
  <p>So, i changed the "hibernate.dialect" in order to have innodb, but i can connect to mysql, but when i do some transactions i have the following error:</p>
  
  <blockquote>
    <p>org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Transaction marked as rol
    lbackOnly
            at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:465)
            at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
            at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
            at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
            at $Proxy46.deleteAsset(Unknown Source)</p>
  </blockquote>
  
  <p>here is my persistence.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
      http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"&gt;
      &lt;persistence-unit name="name" 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.show_sql" value="false"/&gt;
              &lt;property name="hibernate.format_sql" value="true"/&gt;
              &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/&gt;                      
              &lt;property name="hibernate.hbm2ddl.auto" value="update"/&gt;    
              &lt;!--        
              &lt;property name="hibernate.c3p0.min_size" value="5"/&gt;
              &lt;property name="hibernate.c3p0.max_size" value="20"/&gt;
              &lt;property name="hibernate.c3p0.timeout" value="300"/&gt;
              &lt;property name="hibernate.c3p0.max_statements" value="50"/&gt;
              &lt;property name="hibernate.c3p0.idle_test_period" value="3000"/&gt;     
              --&gt; 
              &lt;property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/&gt;
              &lt;property name="hibernate.connection.url" value="jdbc:mysql://xxxxxx"/&gt;
              &lt;property name="hibernate.connection.username" value="xxxxx"/&gt;
              &lt;property name="hibernate.connection.password" value="xxxxxx"/&gt;
  
              &lt;property name="defaultAutoCommit" value="false"/&gt;
  
              &lt;!-- Connection auto reconnect after long inactivity --&gt;
              &lt;property name="connection.autoReconnect" value="true"/&gt;
              &lt;property name="connection.autoReconnectForPools" value="true"/&gt;
              &lt;property name="connection.is-connection-validation-required" value="true"/&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;         
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Do you have any idea ?</p>