title: issue ORA-00001: unique constraint violated coming in INSERT/UPDATE
body: <p>I am trying to insert some values in table throught the application and get issue ORA-00001: unique constraint violated.
  I see that sequences are out of sync with the highest id of the table, but even after fixing the sequence number the error still persists. 
  How can I debug this error more, does oracle logs give more error? how can I see the oracle logs?
  Thanks
  Priyank</p>
  
  <p>update: we are using the audit logging plugin and in the domain class for User we catch the save event and log the entry into the audit log</p>
  
  <p>So in User class we do: </p>
  
  <pre><code>class User {
  
  //some attributes, constraints, mappings
  
  def onSave = {
   Graaudit aInstance = new Graaudit();
           aInstance.eventType= "GRA User Create"
           aInstance.eventDescription = "GRA User Created"
           aInstance.objectid = username
           aInstance.objecttype = 'GRAUSER'
           aInstance.user_id = RequestContextHolder.currentRequestAttributes().session.username
  
            aInstance.withTransaction{
                aInstance.save()
            }
      }
  
  }
  </code></pre>
  
  <p>When we dont have the above code in the onSave event the User is created successfully.<br> I am assuming its related to hibernate transaction which we are using on aInstance, thats dying or the current transaction is dying due to that save.<br> If we dont use the transaction we get an exception <code>"org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here"</code>
  Not sure how to fix this issue..
  Thanks</p>