title: PlayFramework 2 + Ebean - raw Sql Update query - makes no effect on db
body: <p>I have a play framework 2.0.4 application that wants to modify rows in db.</p>
  
  <p>I need to update 'few' messages in db to status "opened" (read messages)
  I did it like below</p>
  
  <pre><code>    String sql = " UPDATE message  SET opened = true, opened_date = now() "
              +" WHERE id_profile_to = :id1 AND id_profile_from = :id2 AND opened IS NOT true";
      SqlUpdate update = Ebean.createSqlUpdate(sql);
      update.setParameter("id1", myProfileId);
      update.setParameter("id2", conversationProfileId);        
      int modifiedCount = update.execute();
  </code></pre>
  
  <p>I have modified the postgresql to log all the queries.</p>
  
  <p>modifiedCount is the actual number of modified rows - but the query is in transaction. 
  After the query is done in the db there is ROLLBACK - so the UPDATE is not made.
  I have tried to change db to H2 - with the same result.</p>
  
  <p>This is the query from postgres audit log</p>
  
  <pre><code>2012-12-18 00:21:17 CET :  S_1: BEGIN
  2012-12-18 00:21:17 CET :  &lt;unnamed&gt;:  UPDATE message  SET opened = true, opened_date = now()  WHERE id_profile_to = $1 AND id_profile_from = $2 AND opened IS NOT true
  2012-12-18 00:21:17 CET : parameters: $1 = '1', $2 = '2'
  2012-12-18 00:21:17 CET :   S_2: ROLLBACK
  </code></pre>
  
  <p>..........</p>
  
  <p>Play Framework documentation and Ebean docs - states that there is no transaction /if not declared or transient if needed per query/. </p>
  
  <p>So... I have made the trick</p>
  
  <pre><code>    Ebean.beginTransaction();
      int modifiedCount = update.execute();
      Ebean.commitTransaction();
      Ebean.endTransaction();
      Logger.info("update mod = " + modifiedCount);
  </code></pre>
  
  <p>But this makes no difference - the same behavior ...</p>
  
  <pre><code>Ebean.execute(update);
  </code></pre>
  
  <p>Again - the same ..</p>
  
  <p>Next step i did - I annontated the method with</p>
  
  <pre><code>@Transactional(type=TxType.NEVER)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@Transactional(type=TxType.MANDATORY)
  </code></pre>
  
  <p>None of them made a difference.</p>
  
  <p>I am so frustrated with Ebean :(
  Anybody can help, please ?</p>
  
  <p>BTW.
  I set</p>
  
  <pre><code>    Ebean.getServer(null).getAdminLogging().setDebugGeneratedSql(true);
      Ebean.getServer(null).getAdminLogging().setDebugLazyLoad(true);
      Ebean.getServer(null).getAdminLogging().setLogLevel(LogLevel.SQL);
  </code></pre>
  
  <p>to see in Play console the query - other queries are logged - this update - not </p>