openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elkhawajah <>
Subject entityManager.merge
Date Sat, 21 Aug 2010 15:24:55 GMT

public void createMessageType(MessageType messageType){

1) I am trying to write a failure test for the code above, what I am doing
is that I am passing non-existing entity to merge method.

I am getting InvalidStateException when flush method is called, my question
is shouldn't merge throw IllegalArgumentException when trying to merging
non-existing entity? why I am getting InvalidStateException?

2) I am using @Transactional annotation in the method above, but I found
that I must invoke flush explicitly, shouldn't that annotation handle
flushing instead of calling flush method explicitly?

I have uploaded
persistence.xml , and
applicationContext.xml .

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message