Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring JPA Hibernate valid configuration not working with JdbcTemplate?
    primarykey
    data
    text
    <p>I do have a working configuration in Spring for JPA with Hibernate provider:</p> <pre><code>&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt; &lt;property name="dataSource" ref="dataSource"/&gt; &lt;property name="loadTimeWeaver"&gt; &lt;bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/&gt; &lt;/property&gt; &lt;property name="jpaVendorAdapter"&gt; &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt; &lt;property name="showSql" value="true"/&gt; &lt;/bean&gt; &lt;/property&gt; &lt;property name="jpaProperties"&gt; &lt;props&gt; &lt;prop key="hibernate.hbm2ddl.auto"&gt;create&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /&gt; &lt;tx:annotation-driven mode="aspectj"/&gt; &lt;bean id="jpaTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"/&gt; </code></pre> <p>This configuration is working in a small Spring based web-app.</p> <p>But, when I insert the same configuration into an other existing Spring based web-app, I do get the following exception:</p> <p><strong>javax.persistence.TransactionRequiredException: no transaction is in progress</strong></p> <p>I think it has some conflict with Spring JDBC Templates:</p> <pre><code>&lt;bean id="mysqlTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate"&gt; &lt;constructor-arg ref="dataSource" /&gt; &lt;/bean&gt; </code></pre> <p>How can I get this to work side by side?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload