title: Make a J2EE application avoid updating the DB
body: <p>I have a JBoss 6 application running both EJB and Spring code (some legacy involved in this decision). It should communicate to Oracle and PostgreSQL databases, on demand.
  JPA is the way DB operations are done, no direct JDBC is involved.</p>
  
  <p>I would like to do the following: without altering the business logic, to be able to "silence" database updates/deletes from my application, without breaking the flow with any exceptions. </p>
  
  <p>My current thoughts are:</p>
  
  <ul>
  <li>Set the JDBC driver as read-only from the deployment descriptor - this works only with PostgreSQL (Oracle driver does not support this)</li>
  <li>Make a read-only user on the RDBMS level - it might fill me up with errors</li>
  <li>Make all transactions rollback instead of committing - is this possible?</li>
  <li>Make entity manager never persist anything - set the FlushMode to MANUAL and make sure flush() never gets called - but commit() still flushes everything.</li>
  </ul>
  
  <p>Is there any other concise approach to this?</p>