Hi Marina,
Comments inline.
Marina Vatkina wrote:
>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].
>
>
I think section 2.1.1 of the specification disallows this configuration:
"It is required that the entity class follow the method conventions for
a JavaBean when persistent properties are used.
In this case, for every persistent property property of type T of the
entity, there is a getter method, get-Property, and setter method
setProperty. For boolean properties, isProperty is an alternative name for
the getter method.
For single-valued persistent properties, these method signatures are:
• T getProperty()"
>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?
>
>
My initial thought is that this may be a bug. How are you fetching the
instance?
-Tom
>thanks,
>-marina
>
>
--
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com