Hi Keith,
Here's what caused the problem.
At the Castor homepage, XML Mapping section (3.5 The <bind-xml> element), it
states:

-       transient: Allows for making this field transient for XML. The
default value is inherited from the <field> element.

In fact, transient isn't inherited from the <field> element. 
The problem was that in our XML mappping file, only the <field> element was
marked transient.
The problem vanished when I added transient="true" to the <xml-bind>
element.

Thank you (and to Werner also),
Emir
 

> -----Original Message-----
> From: Keith Visco [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, February 26, 2005 5:12 AM
> To: [email protected]
> Subject: Re: [castor-user] [XML] Why Castor iterates 
> transient collection field?
> 
> 
> 
> Emir,
> 
> Castor XML should not be calling the getter if you've marked 
> it transient. If it is, then we need to find out why.
> 
> What does the relevant section of your mapping file look like?
> 
> You said it's used by both the JDO framework and XML 
> framework? What happens if you load your mapping file and 
> configure the Marshaller without using any JDO code, and then 
> marshal an instance of your object model? Does Castor XML 
> still call the getter?
> 
> 
> --Keith
> 
> [EMAIL PROTECTED] wrote:
> > Keith, I have a class which is a JDO and it has a 
> collection field. I 
> > load this class' objects from database using Castor JDO and 
> then try 
> > to marshall it using Castor XML. One of the fields in my class is a 
> > collection field which is lazy loaded. When I marshall the class I 
> > don't need this field be marshalled, so I've set it in XML 
> mapping as 
> > transient. But, when I try to marshall it, the Castor raises a 
> > Transaction not in progress! exception. This is related to 
> JDO's lazy 
> > loading. When I setLazyLoadedCollection(null) prior to 
> marshalling I 
> > got no expcetion.
> > 
> > Why Castor tries to iterate this transient collection?
> > 
> > Regards, Emir
> > 
> > 
> > 
> > ----------------------------------------------------------- If you 
> > wish to unsubscribe from this mailing, send mail to 
> > [EMAIL PROTECTED] with a subject of: unsubscribe castor-user
> > 
> > 
> 
> 
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to 
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user
> 



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to