Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #546 (closed)

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

IPojos createDataObjects returning unloaded entities

Reported by: jburel Owned by: jamoore
Priority: minor Milestone: 3.0-Beta1
Component: API Version: 3.0-M3
Keywords: n.a. Cc: cxallan
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

Problem when creating annotations and use createDataObjects.
If I use createDataObject on each annotation it works!!

pseudo code:
I first create an annotation:

Dataset m = (Dataset) annotatedObject;
 
DatasetAnnotation annotation = new DatasetAnnotation();
annotation.setContent(data.getText());

annotation.setDataset(m);

then do

IPojos.createDataObject(annotation, options)

the IObject returned contains the annotated data object (in this case the dataset)

if I create several annotations i.e. one per annotatedObject
then call

IPojos.createDataObjects(annotation[], options)

IObjects returned don't contain the annotated data object

Change History (3)

comment:1 Changed 17 years ago by jmoore

  • Milestone changed from Unscheduled to 3.0-Beta1
  • Version changed from 3.0-Beta1 to 3.0-M3

Let annotation and dataset be newly created objects via ipojos.createDateObject(obj,null). Then:

    	annotation = (DatasetAnnotation)
    	sf.getPojosService().createDataObjects(
    			new DatasetAnnotation[]{annotation}, null)[0];
    	assertNotNull(annotation.getDataset()); // XXX <-- Here is unloaded
    	assertTrue(annotation.getDataset().isLoaded());

throws IllegalStateException at the marked line XXX. Does that look right?

comment:2 Changed 17 years ago by jmoore

  • Cc callan added
  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from IPojos createDataObjects to IPojos createDataObjects returning unloaded entities

r1120 fixes. UpdateImpl?.saveAndReturnArray was returning the original value rather than the copy. This was luckily non-dangerous, because the ID was being transfered to the originals and then they were unloaded before return. However, no telling how many misunderstandings have been caused by this. I'll have to go back and review various failing tests.

comment:3 Changed 17 years ago by jmoore

r1121 fixes resulting problems. Specifically that methods which formerly passed in an array of some subclass of IObject and expected to get a similarly typed array back out would throw ClassCastExceptions (because arrays don't play well with generics). Now we'll have to manually create such an array and use System.arraycopy or just pass back the IObject[].

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.82795 sec.)

We're Hiring!