persistence@glassfish.java.net

RE: IdentityHashmaps

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Mon, 2 Oct 2006 09:41:24 -0400

Hello Markus,
    Yes there is only one identitymap per heirarchy.
    Yes UnitOfWorkImpl.registerNewObjectForPersist(), also during the discoverUnregisteredNewObjects() call.
--Gordon

-----Original Message-----
From: Markus.Fuchs_at_Sun.COM [mailto:Markus.Fuchs_at_Sun.COM]On Behalf Of
Markus Fuchs
Sent: Friday, September 29, 2006 7:55 PM
To: persistence_at_glassfish.dev.java.net
Subject: Re: IdentityHashmaps


Hi,

Markus Fuchs wrote:

> Hi Tom, Gordon,
>
> During a transaction, will there be an IdentityHashmap for every
> subclass of an inheritance hierarchy, or is there only one for the
> base, which also contains all subclass instances?
>
My assumption: There's only one IdentityHashmap per hierarchy.

> When and where are new instances registered for a relationship
> annotated with cascade=PERSIST?

One place is UnitOfWorkImpl.registerNewObjectForPersist(), which is
called from em.persist, if the relationship is set at that time.

Please confirm! Thanks,

-- markus.

>
>
> Thanks!
>
> -- markus.