public MappedInvoice createNewInvoice(final List<MappedDrink> drinks, final int userId) {
        final MappedInvoice invoice = new MappedInvoice();
        try {
            insertLock.lock();
            
            final float due = calculateDue(drinks);

            String query = Conca.t(
                "insert into invoice ",
                "   (userFk, due) VALUES ",
                "   (?, ?)"
            );

            final List<Object> params = new ArrayList<Object>();
            final List<Class<?>> types = new ArrayList<Class<?>>();

            params.add(userId);
            types.add(Integer.class);

            params.add(due);
            types.add(Float.class);

            final int result = executeUpdate(query, params, types);

            if (result == 1) {
                final String lastInserttedIdQuery = "select last_insert_id()";
                final ResultSet rs = execute(lastInserttedIdQuery, Collections.emptyList(), new ArrayList<Class<?>>());
              
                if (rs.next()) {
                    invoice.setId(rs.getInt(1));
                    
                    if (drinks.size() > 0) {
                        params.clear();
                        types.clear();
                        
                        query = Conca.t(
                            "update drink ",
                            "   set invoiceFk = ? ",
                            "   where id in ",
                            "   ("
                        );
                        
                        params.add(invoice.getId());
                        types.add(Integer.class);
                        
                        final StringBuilder sb = new StringBuilder(query);
                        
                        boolean notFirst = false;
                        
                        for (final MappedDrink ea : drinks) {
                            if (notFirst) {
                                sb.append(", ");
                            }
                            
                            sb.append("?");
                            
                            params.add(ea.getDrinkId());
                            types.add(Integer.class);
                            
                            notFirst = true;
                        }
                        
                        sb.append(")");
                        
                        executeUpdate(sb.toString(), params, types);
                    }
                }

                invoice.setUser(findMappedUser(userId));
                invoice.setDrinks(drinks);
                invoice.setDue(due);
            }

        } catch (Exception e) {
            log4jLogger.error(Conca.t("error occurred while attempting to create invoice for user with id ", userId), e);
            
        } finally {
            insertLock.unlock();
        }

        return invoice;
    }