if (nextId <= 0 || nextId > Volume.ID_MAX) throw VolumeServiceException.ID_OUT_OF_RANGE(nextId);
    public static synchronized Volume create(Connection conn, short id,                                             short type, String name, String path,                                             short mboxGroupBits, short mboxBits,                                             short fileGroupBits, short fileBits,                                             boolean compressBlobs, long compressionThreshold)    throws ServiceException {        short nextId = id;        if (nextId == Volume.ID_AUTO_INCREMENT)            nextId = getNextVolumeID(conn);        PreparedStatement stmt = null;        try {            stmt = conn.prepareStatement(                    "INSERT INTO volume " +                    "(id, type, name, path, " +                    "mailbox_group_bits, mailbox_bits, " +                    "file_group_bits, file_bits, " +                    "compress_blobs, compression_threshold) " +                    "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");            int pos = 1;            stmt.setShort(pos++, nextId);            stmt.setShort(pos++, type);            stmt.setString(pos++, name);            stmt.setString(pos++, path);            stmt.setShort(pos++, mboxGroupBits);            stmt.setShort(pos++, mboxBits);            stmt.setShort(pos++, fileGroupBits);            stmt.setShort(pos++, fileBits);            stmt.setBoolean(pos++, compressBlobs);            stmt.setLong(pos++, compressionThreshold);            stmt.executeUpdate();        } catch (SQLException e) {            if (e.getErrorCode() == Db.Error.DUPLICATE_ROW)                throw VolumeServiceException.ALREADY_EXISTS(nextId, name, path, e);            else                throw ServiceException.FAILURE("inserting new volume " + nextId, e);        } finally {            DbPool.closeStatement(stmt);        }        return get(conn, nextId);    }