On Aug 16, 2010, at 9:09 AM, John Doyle wrote:
1) What I've found is that when time comes to create the
transformation, and I go back to the model to get the params, I don't find what I
expect. The correct answer in this case is to hold it all in the parser and create the
model objects all at the end, but more generally, should I expect that I can get the model
objects I add to a ModelResource back from that resource before I have saved it?
There must be something else going on here, because in general, yes, you should be able to
retrieve what you've put in your model resource. There are possibly some issues
related to not having all dependencies, including external, setup in the container, but
that scenario should at least produce errors. Are you using the ModelContainer or a
transient container?
2) More generally, if I'm creating more than one model resource
in the run of an importer, what is the right way to save my changes so that follow on
actions only happen once? I seem to be triggering multiple runs of workspace build and
PVDB creation. Is wrapping all of the saves in a single WorkspaceModifyOperation enough?
I think the main issue here is probably the container. You should really be using a
transient container during the import and merge right before you save. This is a pattern
we've been following in a few importers, and I've just completed something similar
in the DDL importer if you want a reference.
JPAV