Importance of the 'prime' condition

Prime avoidance theorem: Let $$A$$ be a ring (commutative with unity) and $$p_1,...,p_n\subset A$$ prime ideals. Let $$a\subset A$$ be an ideal such that $$a\subset (p_1\cup p_2\cup\cdot\cdot\cdot\cup p_n)$$, then $$a\subset p_k$$ for some $$1\leq k\leq n$$.

Now, I have no problem in proving this theorem. I want to illustrate with an example, the importance of the prime condition in the theorem. That is, I want to show that there exist ideals $$a_1,...,a_n\subset A$$ such that $$a\subset (a_1\cup a_2\cup\cdot\cdot\cdot\cup a_n)$$, but $$a\not \subset a_k$$ for all $$1\leq k\leq n$$. Some of the things that I noticed is that, we cannot find the example in a principal ideal domain nor can we get the example if we take $$n=2$$. I wasn't able to make much progress beyond this.

Let $$A=\mathbb {Z}[X,Y], a=(2,X,Y), a_{1}=(2,X^2,Y), a_{2}=(2,X,Y^2), a_{3}=(2,X+Y,X^2,Y^2,XY)$$
Then $$a$$ is contained in the union of $$a_1,a_2,a_3$$ (you can check it by computing in $$A/(2,X^2,Y^2,XY)$$ , which is a ring with $$4$$ elements) but not contained in any $$a_i$$.
Let $$V$$ be a $$m$$-dimensional vector space over a finite field $$k$$, $$2\leq m<\infty$$. Put on $$V$$ a ring (without identity) structure where all multiplications are 0. Unitize it to give $$A=k\oplus V$$ a commutative ring (with 1). Let $$J_1,J_2,\dots,J_n$$ be the proper subspaces of $$V$$, so are non-prime ideals of $$A$$. Then the (maximal) ideal $$V$$ is not contained in any $$J_i$$ but is contained in their union.