Great advice Andrus, now I understand better my problem. Probably in my code there is some relation between one registered dataobject and another one not registered.
I think Cayenne is a very good framework, but the support you did on that mailing list, make it a greater product.
Regards
Andrea
From: Andrus Adamchik <andru..bjectstyle.org>
Reply-To: cayenne-user@objectstyle.org
To: cayenne-user@objectstyle.org
Subject: Re: Newbie: DataObject declaration and commit
Date: Thu, 15 Dec 2005 19:38:17 +0300
>>So what's the difference between the two object decalrations ?
>
>Andrea, it is not clear from your example how the first object is
>initialized and later manipulated. This advice is a shot in the
>dark, but one way to keep a transient object around is to create
>and register an object, and then delete it from DataContext right
>before the commit.
>
>Andrus
>
>
>On Dec 15, 2005, at 4:23 PM, Andrea Borgogelli Avveduti wrote:
>>// Example (not real code):
>>
>>.....
>>public MyCayenneDataClass myCayenneDataObject;
>>.....
>>MyCayenneDataClass myCayenneDataObject2= ( MyCayenneDataClass )
>>dataContext.createAndRegisterNewObject( MyCayenneDataClass.class );
>>.....
>>datacontext.commitChanges();
>>
>>
>>// Question is:
>>
>>/*
>>
>>Why the Cayenne try to insert to records in the DB. I don't want to
>> insert myCayenneDataObject but only myCayenneDataObject2. I'd
>>like to use the first object only for temporary data.
>>So what's the difference between the two object decalrations ?
>>
>>Thank you all for any help
>>
>>Andrea.
>>
>>*/
>
This archive was generated by hypermail 2.0.0 : Fri Dec 16 2005 - 09:36:28 EST