openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dianne Richards <diann...@gmail.com>
Subject Re: Refreshing detached entities
Date Thu, 11 Mar 2010 18:16:22 GMT
Jerry - I'll look into this.

Dianne

On Thu, Mar 11, 2010 at 11:21 AM, Jerry Carter <jerry@jerrycarter.org>wrote:

>
> Possible gap in my understanding, but I would expect an exception in this
> case based on section 3.2.5 of the JPA 2.0 specification: "If [entity] X is
> new, detached, or removed entity, the IllegalArgumentException is thrown".
>
> try {
>        TestEntity refreshDetached = new TestEntity("refresh detached");
>        em.persist(refreshDetached);
>        em.flush();
>        em.detach(refreshDetached);
>        em.refresh(refreshDetached);
>        logger.error("ERROR: No exception from em.refresh(detached)");
> } catch (IllegalArgumentException e) {
>        logger.info("SUCCESS: Refresh detached");
> } catch (Exception e) {
>        logger.error("ERROR: Unexpected exception from em.refresh(detached):
> " + e.toString());
> }
>
> ERROR: No exception from em.refresh(detached)
>
>
>


-- 
Thanks - Dianne

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message