title: EntityManger refresh after JPQL bulk DELETE?
body: <p>After executing the following operation in my Seam/Glassfish/JPA container:</p>
  
  <pre><code>@ApplicationScoped
  public class JpaGlossaryDataAccessObject implements IGlossaryDataAccessObject {
      // ...
      @Transactional
      public void deleteColumn(String glossaryName, String columnName) {
          final GlossaryColumn column = getColumn(glossaryName, columnName);
          entityManager.remove(column);
      }
      // ...
  }
  </code></pre>
  
  <p>the requested columns get successfully deleted from the DB, which I can verify using the SQL workbench. However, when calling the following method subsequently:</p>
  
  <pre><code>@ApplicationScoped
  public class JpaGlossaryDataAccessObject implements IGlossaryDataAccessObject {
      // ...
      @Transactional
      public List&lt;Glossary&gt; getGlossaries(Collection&lt;String&gt; glossaryNames) {
          glossaryNames.retainAll(getGlossaryNames());
          return entityManager.createQuery(SELECT_ALL_NAMED_GLOSSARIES, Glossary.class).setParameter(GLOSSARY_NAMES_PARAMETER_INDEX, glossaryNames).getResultList();
      }
      // ...
  }
  </code></pre>
  
  <p>which basically returns the Glossaries containing aforesaid columns, the deleted column is still in the Glossary object! Even though they don't exist anymore in the database. How can this be? Is there some additional refresh I need to perform in order to make this work?</p>
  
  <p>My beans.xml looks like this, by the way:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="urn:java:ee"
      xmlns:security="urn:java:org.jboss.seam.security" xmlns:permission="urn:java:org.jboss.seam.security.permission"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd"&gt;
      &lt;alternatives /&gt;
      &lt;decorators /&gt;
      &lt;interceptors&gt;
          &lt;class&gt;org.jboss.seam.security.SecurityInterceptor&lt;/class&gt;
          &lt;class&gt;org.jboss.seam.transaction.TransactionInterceptor&lt;/class&gt;
      &lt;/interceptors&gt;
      &lt;security:IdentityImpl&gt;
          &lt;s:modifies /&gt;
          &lt;security:authenticatorClass&gt;ch.diction.webportal.security.seam.authentication.ChallengeResponseIdmAuthenticatorDecorator
          &lt;/security:authenticatorClass&gt;
      &lt;/security:IdentityImpl&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>So, what am I missing?</p>
  
  <p>Thanks in advance and best regards
  Pascal</p>