Set up logging for OrdersServlet and fixing database operation order.