title: Best way to do database access in a Java desktop application
body: <p>I've been working in Glassfish 3, JPA and Java EE 6.  In a web container you can just inject the Entity Manager into an EJB and let that handle your transactions, rollbacks, etc.  What do I do in a desktop application.  Obviously that does not work.  I know I would still use JPA for ORM.  But would I create an EntityMangerFactory and then create an Entitymanager from that?  Would I have to handle my transactions manually?  It would great if I could see some sample applications.  Thanks!</p>