I saw a post a while back querying the necessity of completely sequential
field-descriptor ids... I just found out the hard way what happens if they
are non-sequential. I generate my repository.xml from a Rational Rose model
and so the ids are assigned to field-descriptors as the model is parsed. For
the next available field-descriptor id, I was just taking the next value
beyond the current maximum for a given class-descriptor - this was leaving
some "holes", e.g. I'd have field descriptors numbered 1, 2, 4, 5. This
didn't cause any problems... until...

When I saved a new class with a cascade-update collection, OJB would assign
the same primary key ID to every member of the collection and save every
member of the collection as though it was the same object. Therefore, I'd
end up with one row in a database table instead of 10, with the values of
the row reflecting the last member of the collection that was saved.

I've now changed the code generator to fill in the holes in the numbering.
But I do wonder, is this behaviour really desirable? Will the ids be ditched
at some point?

Thanks

Gareth.

-----------------------------------------------------------
Gareth Cronin
Analyst/Programmer
Kiwiplan NZ Ltd, Auckland, New Zealand
Ph 64 9 2727622 x854
-----------------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to