Connection conn = null;
try {
conn = getConnection();
invoiceDAO = new InvoiceDAO();
invoiceDAO.setConnection(conn);
orderDAO = new OrderDAO();
orderDAO.setConnection(conn);
conn.setAutoCommit(false);
for (Entity order : orders) {
orderDAO.save(order);