title: Exposing Database Operations as Webservice
body: <p>Scenario:</p>
  
  <p>In my project, we have a web service (Apache CXF, Hibernate and Spring) to expose some services to third party, Portal (Spring MVC, Portal and Hibernate) for developing the front end web application and some Batch (Spring Batch, Hibernate) operations running separately.</p>
  
  <p>All 3 applications using the same Database and having the mapping &amp; entity managers at application level. </p>
  
  <p>Problem:</p>
  
  <p>The above scenario creates problem of updating the same mapping almost in 3 places and we couldn't able to enable caching also due to the same entity will be updated in multiple applications and each having the separate entity managers.</p>
  
  <p>My Solution:</p>
  
  <p>I have planned to introduce one web service which will take care of all the Database operations and will be used by the other 3 applications. So it will avoid the above problem.</p>
  
  <p>Could you please help me to fine tune my solution or help to get the new best approach?</p>