Reduce database usage -- do not open connection if no database commands prepared and no transactions