Couple of questions.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Couple of questions.

Bugzilla from nicholas.stuart@gmail.com
Got a couple more questions for anyone that can answer.

When are objects supposed to move from 'addedToUnresolved' to the
actual 'objectList' for to-Many relationships, and when they move, are
new objects created int the 'objectList' or simply moved over there?

Running some tests I'm seeing that new objects are being created and
this is causing a problem when I check the toMany list with
'contains(object)' and its not showing up (even though its really
there).

So whats happening:
In my test I create objectA

I create objectB which has a toMany list holding objectA

once everything is commited objectB now has an objectA instance in its
objectList, but its not the same java object in my test scope.

Make sense at all? know its confusing but just wondering if I'm doing
something wrong here.

-Nick
Reply | Threaded
Open this post in threaded view
|

Re: Couple of questions.

Mike Kienenberger
Are both objects in the same DataContext?


On 8/26/05, Nick Stuart <[hidden email]> wrote:

> Got a couple more questions for anyone that can answer.
>
> When are objects supposed to move from 'addedToUnresolved' to the
> actual 'objectList' for to-Many relationships, and when they move, are
> new objects created int the 'objectList' or simply moved over there?
>
> Running some tests I'm seeing that new objects are being created and
> this is causing a problem when I check the toMany list with
> 'contains(object)' and its not showing up (even though its really
> there).
>
> So whats happening:
> In my test I create objectA
>
> I create objectB which has a toMany list holding objectA
>
> once everything is commited objectB now has an objectA instance in its
> objectList, but its not the same java object in my test scope.
>
> Make sense at all? know its confusing but just wondering if I'm doing
> something wrong here.
>
> -Nick
>
Reply | Threaded
Open this post in threaded view
|

Re: Couple of questions.

Bugzilla from nicholas.stuart@gmail.com
Yes. Everything is in the same context (Absolutly sure of this). This
is kind of related to other wierd behavior I was seeing in my other
posts to the list. Thats why I dont understand why its creating new
objects. I always call ctx.createAndRegisterNewObject when I am
creating things and make sure I'm commiting when I need to be, so I'm
not sure whats going on.

Are the XML/Mappings combatible from 1.2M5 to 1.1? Would like to try
out 1.1 to see if its behaving like this.

-Nick

On 8/26/05, Mike Kienenberger <[hidden email]> wrote:

> Are both objects in the same DataContext?
>
>
> On 8/26/05, Nick Stuart <[hidden email]> wrote:
> > Got a couple more questions for anyone that can answer.
> >
> > When are objects supposed to move from 'addedToUnresolved' to the
> > actual 'objectList' for to-Many relationships, and when they move, are
> > new objects created int the 'objectList' or simply moved over there?
> >
> > Running some tests I'm seeing that new objects are being created and
> > this is causing a problem when I check the toMany list with
> > 'contains(object)' and its not showing up (even though its really
> > there).
> >
> > So whats happening:
> > In my test I create objectA
> >
> > I create objectB which has a toMany list holding objectA
> >
> > once everything is commited objectB now has an objectA instance in its
> > objectList, but its not the same java object in my test scope.
> >
> > Make sense at all? know its confusing but just wondering if I'm doing
> > something wrong here.
> >
> > -Nick
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Couple of questions.

Bugzilla from nicholas.stuart@gmail.com
One more quick note.

After the commit, (this is a many-to-many in this case) both objectA
and objectB will have the other objects in their respective
'addedtoUnresolved' list. Its not until I do something like
objectA.getToManyList().size() will the objects be removed from
'addedToUnresolved' and added/recreated to 'objectList'. Have to do
the same for objectB to get the items to move as well.

-Nick

On 8/26/05, Nick Stuart <[hidden email]> wrote:

> Yes. Everything is in the same context (Absolutly sure of this). This
> is kind of related to other wierd behavior I was seeing in my other
> posts to the list. Thats why I dont understand why its creating new
> objects. I always call ctx.createAndRegisterNewObject when I am
> creating things and make sure I'm commiting when I need to be, so I'm
> not sure whats going on.
>
> Are the XML/Mappings combatible from 1.2M5 to 1.1? Would like to try
> out 1.1 to see if its behaving like this.
>
> -Nick
>
> On 8/26/05, Mike Kienenberger <[hidden email]> wrote:
> > Are both objects in the same DataContext?
> >
> >
> > On 8/26/05, Nick Stuart <[hidden email]> wrote:
> > > Got a couple more questions for anyone that can answer.
> > >
> > > When are objects supposed to move from 'addedToUnresolved' to the
> > > actual 'objectList' for to-Many relationships, and when they move, are
> > > new objects created int the 'objectList' or simply moved over there?
> > >
> > > Running some tests I'm seeing that new objects are being created and
> > > this is causing a problem when I check the toMany list with
> > > 'contains(object)' and its not showing up (even though its really
> > > there).
> > >
> > > So whats happening:
> > > In my test I create objectA
> > >
> > > I create objectB which has a toMany list holding objectA
> > >
> > > once everything is commited objectB now has an objectA instance in its
> > > objectList, but its not the same java object in my test scope.
> > >
> > > Make sense at all? know its confusing but just wondering if I'm doing
> > > something wrong here.
> > >
> > > -Nick
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Couple of questions.

Mike Kienenberger
Nick, I don't completely understand your situation, so I can't say much more.

Maybe some code examples would enlighten me.

Short of that, stepping through the debugger and watching what happens
in addedtoUnresolved() and getToManyList() is probably your best bet.

On 8/26/05, Nick Stuart <[hidden email]> wrote:

> One more quick note.
>
> After the commit, (this is a many-to-many in this case) both objectA
> and objectB will have the other objects in their respective
> 'addedtoUnresolved' list. Its not until I do something like
> objectA.getToManyList().size() will the objects be removed from
> 'addedToUnresolved' and added/recreated to 'objectList'. Have to do
> the same for objectB to get the items to move as well.
>
> -Nick
>
> On 8/26/05, Nick Stuart <[hidden email]> wrote:
> > Yes. Everything is in the same context (Absolutly sure of this). This
> > is kind of related to other wierd behavior I was seeing in my other
> > posts to the list. Thats why I dont understand why its creating new
> > objects. I always call ctx.createAndRegisterNewObject when I am
> > creating things and make sure I'm commiting when I need to be, so I'm
> > not sure whats going on.
> >
> > Are the XML/Mappings combatible from 1.2M5 to 1.1? Would like to try
> > out 1.1 to see if its behaving like this.
> >
> > -Nick
> >
> > On 8/26/05, Mike Kienenberger <[hidden email]> wrote:
> > > Are both objects in the same DataContext?
> > >
> > >
> > > On 8/26/05, Nick Stuart <[hidden email]> wrote:
> > > > Got a couple more questions for anyone that can answer.
> > > >
> > > > When are objects supposed to move from 'addedToUnresolved' to the
> > > > actual 'objectList' for to-Many relationships, and when they move, are
> > > > new objects created int the 'objectList' or simply moved over there?
> > > >
> > > > Running some tests I'm seeing that new objects are being created and
> > > > this is causing a problem when I check the toMany list with
> > > > 'contains(object)' and its not showing up (even though its really
> > > > there).
> > > >
> > > > So whats happening:
> > > > In my test I create objectA
> > > >
> > > > I create objectB which has a toMany list holding objectA
> > > >
> > > > once everything is commited objectB now has an objectA instance in its
> > > > objectList, but its not the same java object in my test scope.
> > > >
> > > > Make sense at all? know its confusing but just wondering if I'm doing
> > > > something wrong here.
> > > >
> > > > -Nick
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Couple of questions.

Bugzilla from nicholas.stuart@gmail.com
Did that, and actually I switched over to cayenne 1.1 and things acted
as expected. Upon commit things were moved to the objectList and all
kept the same references to each other. So, this appears to be a bug
in 1.2M5.

I will open a bug report with a test case when I get a chance to
produce a smaller working example.

-Nick

On 8/26/05, Mike Kienenberger <[hidden email]> wrote:

> Nick, I don't completely understand your situation, so I can't say much more.
>
> Maybe some code examples would enlighten me.
>
> Short of that, stepping through the debugger and watching what happens
> in addedtoUnresolved() and getToManyList() is probably your best bet.
>
> On 8/26/05, Nick Stuart <[hidden email]> wrote:
> > One more quick note.
> >
> > After the commit, (this is a many-to-many in this case) both objectA
> > and objectB will have the other objects in their respective
> > 'addedtoUnresolved' list. Its not until I do something like
> > objectA.getToManyList().size() will the objects be removed from
> > 'addedToUnresolved' and added/recreated to 'objectList'. Have to do
> > the same for objectB to get the items to move as well.
> >
> > -Nick
> >
> > On 8/26/05, Nick Stuart <[hidden email]> wrote:
> > > Yes. Everything is in the same context (Absolutly sure of this). This
> > > is kind of related to other wierd behavior I was seeing in my other
> > > posts to the list. Thats why I dont understand why its creating new
> > > objects. I always call ctx.createAndRegisterNewObject when I am
> > > creating things and make sure I'm commiting when I need to be, so I'm
> > > not sure whats going on.
> > >
> > > Are the XML/Mappings combatible from 1.2M5 to 1.1? Would like to try
> > > out 1.1 to see if its behaving like this.
> > >
> > > -Nick
> > >
> > > On 8/26/05, Mike Kienenberger <[hidden email]> wrote:
> > > > Are both objects in the same DataContext?
> > > >
> > > >
> > > > On 8/26/05, Nick Stuart <[hidden email]> wrote:
> > > > > Got a couple more questions for anyone that can answer.
> > > > >
> > > > > When are objects supposed to move from 'addedToUnresolved' to the
> > > > > actual 'objectList' for to-Many relationships, and when they move, are
> > > > > new objects created int the 'objectList' or simply moved over there?
> > > > >
> > > > > Running some tests I'm seeing that new objects are being created and
> > > > > this is causing a problem when I check the toMany list with
> > > > > 'contains(object)' and its not showing up (even though its really
> > > > > there).
> > > > >
> > > > > So whats happening:
> > > > > In my test I create objectA
> > > > >
> > > > > I create objectB which has a toMany list holding objectA
> > > > >
> > > > > once everything is commited objectB now has an objectA instance in its
> > > > > objectList, but its not the same java object in my test scope.
> > > > >
> > > > > Make sense at all? know its confusing but just wondering if I'm doing
> > > > > something wrong here.
> > > > >
> > > > > -Nick
> > > > >
> > > >
> > >
> >
>