title: Java Hibernate Create Native Query javax.persistence.TransactionRequiredException: Executing an update/delete query
body: <p>I have this problem, using native query on Hibernate. This the query :</p>
  
  <pre><code>Query query = session.createSQLQuery(
  "UPDATE InvoiceItems SET current_balance = '"+current_balance+"' WHERE record_id = '"+record_id+"'");
  query.executeUpdate();
  </code></pre>
  
  <p>but i get this error when run the query :</p>
  
  <blockquote>
    <p>javax.persistence.TransactionRequiredException: Executing an
    update/delete query</p>
  </blockquote>
  
  <p>any suggest ? i have try with this way : <a href="https://stackoverflow.com/questions/25821579/transactionrequiredexception-executing-an-update-delete-query">TransactionRequiredException Executing an update/delete query</a></p>