I solved the problem with the help of Chris' suggestion to turn on EclipseLink Logging ( Which I didn't know before ) .
The problem happened because of wrong @JoinColumn definition in the entity. And the first entity ( db=1 ) was committing by chance because of the existance of dummy data for this id which doesn't exist for other ids.