title: Standalone application transactions
body: <p>I have a standalone application written in Java Swing against MySQL via Hibernate, with just one client connected to the database, using <code>HibernateUtils</code> provided by Netbeans example app skeleton. Basically committing each transaction explicitly.</p>
  
  <p>Now I need more than one client connected to the same MySQL server instance and I don't know how to manage connections properly. I'm integrating Spring context and <code>entityManager</code> but without an application server ¿How can and have the connections to the database synchronized?</p>
  
  <p>I am concerned about the visibility of entities by different threads, so always keep refreshed.
  EDITED:
  I've been reading about the patterns related to session managing. In my application i have implemented de transaction-per-operation antipattern, opening and closing the session inside every DAO operation calling 'HibernateUtil'.This ensure that the data is allways updated, but now that I need more users connected, i don't know if I must change to a client-server architecture, or move to a JPA managed session configuration, or maybe keep working whith this anti-pattern.</p>