Note that there are some explanatory texts on larger screens.

plurals
  1. POConcurrent Creation Event
    primarykey
    data
    text
    <p>I'm using JBoss 5.1.0 GA together with Hibernate and I'm now trying to enable the second level cache. I've added the following properties to my Hibernate configuration.</p> <pre><code>&lt;property name="hibernate.cache.use_query_cache" value="true"/&gt; &lt;property name="hibernate.cache.use_second_level_cache" value="true"/&gt; &lt;property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory"/&gt; &lt;property name="hibernate.cache.jbc2.query.localonly" value="true"/&gt; &lt;property name="hibernate.cache.region_prefix" value="my_prefix" /&gt; </code></pre> <p>And I've annotated entities that I expect to change infrequently with the following:</p> <pre><code>@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL) </code></pre> <p>This is based on my understanding of the <a href="http://docs.jboss.org/jbossclustering/hibernate-caching/3.3/en-US/html_single/index.html" rel="nofollow">documentation</a>.</p> <p>The application successfully deploys with no scary looking messages (e.g. WARN or ERROR messages in the log stream). For a short period of time I see caching working (I'm using Hibernate statistics to see this), but after a short while I get stack traces of the form (even when logged on as a single user with no remote access whatsoever):</p> <blockquote> <p>"Transaction attempted to create MYCLASS anew. It has already been created since this transaction started, by another (possibly remote) transaction. We have a concurrent creation event"</p> </blockquote> <p>Following by a giant stack trace which eventually traces back to a named query that I have made which has the following form:</p> <pre><code>SELECT x FROM X WHERE x.deleted = false </code></pre> <p>The named query has no additional annotations for caching.</p> <p>Any advice on how to solve this problem would be greatly appreciated.</p>
    singulars
    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.
    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