Sorry for the late reply Jeanne..well its like this,
Well I create a that object which is type PQR using new() in my EJBUnit class..where that PQR object has a relationship with ABC like following,
So what i realise is when using merge() we have to use a PQR object which exists in database rather create new one and that exception goes.
And with persist() that doest matter even object is created newly or already exists in DB...(mm not sure about that..have to try it..)
So the difference is come from the difference of mereg() and persist() method..where in merge method cant apply to new objects which does not persist in database right? so can some one elaborate this fact more theoretically what is the reason?