title: DAO and Connections
body: <p>Where I should open and close connections to repositories? In article "<a href="http://www.ibm.com/developerworks/java/library/j-genericdao/index.html" rel="nofollow">Dont repeat the DAO</a>" written:</p>
  
  <blockquote>
    <p>The DAO is not responsible for handling transactions, sessions, or
    connections. These are handled outside the DAO to achieve flexibility.</p>
  </blockquote>
  
  <p>But some people suggest me to inject <code>@Resource DataSource</code> object into DAO classes and handle all connections inside DAO methods...i.e. every CRUD operation should open and close connection to repository.</p>