Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Notice that you give us an incomplete stacktrace since you only print the exception message, and the assertion error, but do not show us the real exception stack (do e.printStackTrace() or something in your catch). Anyway this looks like to be a business, non technical/hibernate/jpa exception so i don't think it will bring any solution.</p> <p>If it works with flush() this probably means that you are now in flushmode=MANUAL, while you were probably in flushmode=AUTO.</p> <p>The available options for Hibernate are described here: org.hibernate.FlushMode Btw it seems the manual flushmode is not part of the JPA specification: javax.persistence.FlushModeType</p> <p>So you may try to check what is you actual flushmode. For exemple by doing:</p> <pre><code>em.getFlushMode() </code></pre> <p>You should also check that result:</p> <pre><code>((Session)em.getDelegage()).getFlushMode() </code></pre> <p>Because you are importing an Hibernate config file hibernate.cfg.xml. Perhaps there are some bugs in hibernate that do not set an appropriate flushmode or something in some specific cases like yours.</p> <p>Check also if your flushmode is consistent on all your application (when you don't explicitly modify it...), because if you are using Spring @Transactionnal attributes with "readonly=true" or some things like that, the hibernate flushmode is automagically set to manual. And if you don't use these annotations it's perhaps a good idea instead of handling transactions in transaction callback system from 2003.</p> <hr> <p>Actually it seems that there is a JpaTemplate.</p> <p>See this code: <a href="http://massapi.com/source/apache-camel-2.5.0/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java.html" rel="nofollow">http://massapi.com/source/apache-camel-2.5.0/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaTemplateTransactionStrategy.java.html</a></p> <p>According to the Javadoc, TransactionTemplate is done for dealing with low-level resources like JDBC. You should use the template that fits to your needs or you may have strange side effects.</p>
    singulars
    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.
    1. This table or related slice is empty.
    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