Have you considered writing your middle name without a space when making a reservation?
I have experience with a last name that is composed of two parts, and at check-in/security they do not appear to care about the presence/absence of the space, as long as both parts of the last name appear on the boarding pass.