persistence@glassfish.java.net

Re: [Fwd: bugs or user error?]

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Tue, 29 Nov 2005 10:47:52 -0800

Gordon Yorke wrote:

> The property warning is simply a warning notifying the user that because they have choosen to use abstract properties (properties without a field) the relationship will be eagerly retreived. From a functional point of view the end user should not notice a difference. It is also spec compliant as fetch types are suggestions within the Spec.

It's different from a user standpoint and needs to be documented.


>
>
> As far as the second item, I would be surprised if it was a bug. We have numerous tests here that perform the remove operation. Could you post the code you are calling? Are you removing Customer directly or is is referenced from the bean being deleted?

It was em.remove(findCustomer("Joe Smith")) where findCustomer uses the same
em as the calling method as it's an instance variable. And there is only 1 "Joe Smith".

thanks,
-marina

>
> --Gordon
>
> -----Original Message-----
> From: mvatkina_at_ha21sca-mail1.SFBay.Sun.COM
> [mailto:mvatkina_at_ha21sca-mail1.SFBay.Sun.COM]On Behalf Of Marina Vatkina
> Sent: Monday, November 28, 2005 8:44 PM
> To: ejb3-toplink-ext_at_sun.COM; persistence_at_glassfish.dev.java.net
> Subject: [Fwd: bugs or user error?]
>
> Team,
>
> This is another email that I've sent on Tuesday
> with no luck of getting through :(.
>
> thanks,
> -marina
>
> -------- Original Message --------
> Subject: bugs or user error?
> Date: Tue, 22 Nov 2005 13:20:24 -0800
> From: Marina Vatkina <marina.vatkina_at_sun.COM>
> To: "persistence_at_glassfish.dev.java.net" <persistence_at_glassfish.dev.java.net>
>
> Team,
>
> I encountered the following problems while running my simple test:
>
> 1. With property-based persistence (the default, right?), if I do *not*
> have a field that matches exactly the name of property for lazy loading
> (e.g. 'cust' vs. getCustomer()), I get the following warning in Java SE
> (I didn't check Java EE yet):
>
> --Weaving for valueholders not enabled for class [entity.Order] because it does
> not have field [customer].
>
> 2. Remove of an instance fetched in the same tx throws an exception that
> it's detached:
>
> Exception in thread "main" java.lang.IllegalArgumentException: Entity must be
> managed to call remove: entity.Customer_at_10849bc, try merging the detatched and
> try the remove again.
> at
> oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.performRemove(UnitOfWorkImpl.java:2711)
>
> at
> oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.remove(EntityManagerImpl.java:117)
>
> Are these bugs or my errors?
>
> thanks,
> -marina