title: Entity is not persisted
body: <p>I'm implementing JPA in my application. 
  This application already uses Spring, Hibernate SessionFactories(3), Wild Fly server with XA Datasource, and a JTA Transaction Manager.</p>
  
  <p>In order to test JPA I set it on a simple Entity which is not linked with any other Entity. </p>
  
  <p>Select and HQL query is ok but not save.
  My problem is when I create or update this Entity, nor creation nor modification is effective and there is no error. </p>
  
  <p>I wonder if problem is not on TransactionManager side.
  I do <strong>not</strong> have <strong>persistence.xml</strong> file</p>
  
  <p>The service : </p>
  
  <pre><code>@Service
  @Transactional(value = "transactionManager")
  public class UtilisateurServiceImpl implements UtilisateurService {
  
         @Autowired
         private UtilisateurDao utilisateurDAO;
  
         public UtilisateurServiceImpl() {
         }
  ...
  
  public void creerUser() {
             utilisateurDAO.creerUser();
         }
  
  }
  </code></pre>
  
  <p>The dao : </p>
  
  <pre><code>@Repository
  public class UtilisateurDaoImpl implements UtilisateurDao {
  
         @PersistenceContext(unitName="habilitationPersistenceUnit") private EntityManager entityManager;     
  
         public UtilisateurDaoImpl() {
  
         }
  ...
  
         public void creerUser() {
             UtilisateurEntity utilisateur2 = new UtilisateurEntity();
          utilisateur2.setDateCreation(new Date());
          utilisateur2.setFax("");
          utilisateur2.setIdentifiant("Olivier");
          utilisateur2.setPassword("password");
          utilisateur2.setMail("");
          utilisateur2.setNom("Potonnier");
          utilisateur2.setNomAffichage("Olivier Potonnier");
          utilisateur2.setPrenom("Olivier");
          utilisateur2.setTelephone("");
          utilisateur2.setDateMAJ(new Date());
          //utilisateur2.setPk(40);
          try {
          entityManager.persist(utilisateur2);
          entityManager.flush();
          } catch(Exception e) {
              e.printStackTrace();
          }
  
  //        try {
  //         UtilisateurEntity entity = entityManager.find(UtilisateurEntity.class, 1);
  //         entity.setPassword("password");
  //         entityManager.merge(entity);
  //        } catch(Exception e) {
  //            e.printStackTrace();
  //        }
  
         }
  </code></pre>
  
  <p>Entity : </p>
  
  <pre><code>@Entity @Table(name="UTILISATEUR")
  public class UtilisateurEntity implements Serializable {
      private static final long serialVersionUID = -3416450676331189345L;
  
      @Id @GenericGenerator(name="entityIdGenerator", strategy="com.prima.solutions.primaclaims.core.dao.impl.PkGenerator", 
                            parameters={@Parameter(name=PkGenerator.TABLE, value="SEQUENCE"),
                                        @Parameter(name=PkGenerator.PK_COLUMN_NAME, value="ENTITE"),
                                        @Parameter(name=PkGenerator.PK_COLUMN_VALUE, value="UTILISATEUR"),
                                        @Parameter(name=PkGenerator.VALUE_COLUMN_NAME, value="NUMERO")
                            })
      @GeneratedValue(generator="entityIdGenerator")
      private Integer pk;
  
          @Column(name="NOM") private String nom;
          @Column(name="PRENOM") private String prenom;
          @Column(name="IDENTIFIANT") private String identifiant;
          @Column(name="PASSWORD") private String password;
          @Column(name="NOM_AFFICHAGE") private String nomAffichage;
          @Column(name="TELEPHONE") private String telephone;
          @Column(name="FAX") private String fax;
          @Column(name="MAIL") private String mail;
          @Column(name="DATE_CREATION") private Date dateCreation;
  
          @Column(name="DATE_MISE_A_JOUR") private Date dateMAJ;
  
  
          public Integer getPk() {
              return pk;
          }
          public void setPk(Integer pk) {
              this.pk = pk;
          }
      ....
      }
  </code></pre>
  
  <p>Datasource config </p>
  
  <pre><code>&lt;!-- Data sources des differents schema --&gt;
      &lt;bean id="dataSourceReferentiel" class="org.springframework.jndi.JndiObjectFactoryBean" scope="singleton"&gt;
          &lt;property name="jndiName" value="java:/DS_Referentiel" /&gt;
          &lt;property name="resourceRef" value="true" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dataSourceHabilitation" class="org.springframework.jndi.JndiObjectFactoryBean" scope="singleton"&gt;
          &lt;property name="jndiName" value="java:/DS_Habilitation" /&gt;
          &lt;property name="resourceRef" value="true" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dataSourceSinistre" class="org.springframework.jndi.JndiObjectFactoryBean" scope="singleton"&gt;
          &lt;property name="jndiName" value="java:/DS_Sinistre" /&gt;
          &lt;property name="resourceRef" value="true" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Transaction manager --&gt;
      &lt;bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" /&gt;
  </code></pre>
  
  <p>Entity managers config</p>
  
  <pre><code>&lt;bean id="referentielEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
          &lt;property name="persistenceUnitName" value="referentielPersistenceUnit" /&gt;      
          &lt;property name="dataSource" ref="dataSourceReferentiel" /&gt;
          &lt;property name="packagesToScan" value="com...entity.referentiel" /&gt;
          &lt;property name="jpaVendorAdapter"&gt;
              &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
                  &lt;!-- Privilégier les logs debug de org.hibernate.SQL --&gt;
                  &lt;property name="showSql" value="false" /&gt;
                  &lt;property name="databasePlatform" value="org.hibernate.dialect.SQLServerDialect" /&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="habilitationEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
          &lt;property name="persistenceUnitName" value="habilitationPersistenceUnit" /&gt;      
          &lt;property name="dataSource" ref="dataSourceHabilitation" /&gt;
          &lt;property name="packagesToScan" value="com...entity.habilitation" /&gt;
          &lt;property name="jpaVendorAdapter"&gt;
              &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
                  &lt;!-- Privilégier les logs debug de org.hibernate.SQL --&gt;
                  &lt;property name="showSql" value="false" /&gt;
                  &lt;property name="databasePlatform" value="org.hibernate.dialect.SQLServerDialect" /&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="sinistreEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
          &lt;property name="persistenceUnitName" value="sinistrePersistenceUnit" /&gt;      
          &lt;property name="dataSource" ref="dataSourceSinistre" /&gt;
          &lt;property name="packagesToScan" value="com...entity.sinistre" /&gt;
          &lt;property name="jpaVendorAdapter"&gt;
              &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
                  &lt;!-- Privilégier les logs debug de org.hibernate.SQL --&gt;
                  &lt;property name="showSql" value="false" /&gt;
                  &lt;property name="databasePlatform" value="org.hibernate.dialect.SQLServerDialect" /&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>