title: Entity not being persisted when using jpa
body: <p>I am using the following field annotations:</p>
  
  <p><code>
  @Id<br>
  @TableGenerator( name = "comment_sequence", pkColumnValue = "comment_sequence" )<br>
  @GeneratedValue( strategy = GenerationType.TABLE, generator = "comment_sequence" )<br>
  private Long id_comment;
  </code></p>
  
  <p>The sql for creating the table is:</p>
  
  <p><code>
  CREATE TABLE hibernate_sequences ( sequence_name VARCHAR(255) NOT NULL, next_val bigint, PRIMARY KEY ( sequence_name ) );<br>
  INSERT INTO hibernate_sequences VALUES ( 'comment_sequence', 1 );
  </code></p>
  
  <p>But the entity simply is not persisting. Any idea of what could be happening? Am I doing something wrong with the code presented above?</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>I suppressed a few information in the original post, I'm sorry (asked in the middle of night almost sleeping =/).</p>
  
  <p>The entity is being properly created, if I do change the strategy to <code>SEQUENCE</code> and add the SQL <code>CREATE SEQUENCE hibernate_sequence</code> everything works fine (it is persisted), but I want to use the <code>TABLE</code> strategy to hold each table sequence in a row on <code>hibernate_sequences</code>.</p>
  
  <p>The only exceptions I have is the <code>TransactionRolledbackException</code> due to a <code>NullPointerException</code> caused by a failing test in the integration test. Nothing explicit for why it is not inserting the data.</p>
  
  <p>I get the following hibernate output when using <code>hibernate.show_sql = true</code>:</p>
  
  <pre><code>...
  
  12:38:48,753 INFO  [stdout] (pool-5-thread-1) Hibernate: 
  12:38:48,754 INFO  [stdout] (pool-5-thread-1)     insert 
  12:38:48,755 INFO  [stdout] (pool-5-thread-1)     into
  12:38:48,756 INFO  [stdout] (pool-5-thread-1)         cm_comment
  12:38:48,757 INFO  [stdout] (pool-5-thread-1)         (cd_status, ds_message, dt_alt, dt_inc, id_user_alt, id_user_inc, id_problem, id_comment) 
  12:38:48,758 INFO  [stdout] (pool-5-thread-1)     values
  12:38:48,759 INFO  [stdout] (pool-5-thread-1)         (?, ?, ?, ?, ?, ?, ?, ?)
  
  12:38:48,766 INFO  [stdout] (pool-5-thread-1) Hibernate: 
  12:38:48,766 INFO  [stdout] (pool-5-thread-1)     select
  12:38:48,767 INFO  [stdout] (pool-5-thread-1)         commentent0_.id_comment as id1_6_,
  12:38:48,768 INFO  [stdout] (pool-5-thread-1)         commentent0_.cd_status as cd2_6_,
  12:38:48,770 INFO  [stdout] (pool-5-thread-1)         commentent0_.ds_message as ds3_6_,
  12:38:48,771 INFO  [stdout] (pool-5-thread-1)         commentent0_.dt_alt as dt4_6_,
  12:38:48,772 INFO  [stdout] (pool-5-thread-1)         commentent0_.dt_inc as dt5_6_,
  12:38:48,773 INFO  [stdout] (pool-5-thread-1)         commentent0_.id_user_alt as id6_6_,
  12:38:48,774 INFO  [stdout] (pool-5-thread-1)         commentent0_.id_user_inc as id7_6_,
  12:38:48,775 INFO  [stdout] (pool-5-thread-1)         commentent0_.id_problem as id8_6_ 
  12:38:48,776 INFO  [stdout] (pool-5-thread-1)     from
  12:38:48,777 INFO  [stdout] (pool-5-thread-1)         cm_comment commentent0_ 
  12:38:48,778 INFO  [stdout] (pool-5-thread-1)     where
  12:38:48,779 INFO  [stdout] (pool-5-thread-1)         commentent0_.id_problem=?
  
  12:38:48,840 ERROR [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-5-thread-1) 
  ...
  
   java.lang.AssertionError: expected:&lt;1&gt; but was:&lt;0&gt;  
  
  ...
  </code></pre>
  
  <p>I am not sure if this can be related but in a previous test I get the error:</p>
  
  <p><code>
  12:50:36,510 INFO  [org.jboss.as.ejb3] (pool-4-thread-1) JBAS014101: Failed to find SFSB instance with session ID {[-98, -17, -32, -33, 63, 107, 74, 59, -76, -127, -19, 29, 24, 45, -50, 5]} in cache
  </code></p>
  
  <p>When I change <code>postgresql.conf</code> for <code>log_statement = 'all'</code> and check in the <code>pg_log</code> directory after running the app I dont see any logs. So I am not sure how I can enable that option.</p>
  
  <p>I am also using Arquillian, arquillian persistence API, and a JBoss managed instance for integration testing. I am going to update the tags cause this could be related to any of those.</p>