I'm having the same problem.  Is there an elegant solution to this in OJB?
Bart Molenkamp wrote:
Hi,

I've a problem storing objects using m:n relations. Suppose I have a
class Person, and a class Project, and an m:n relationship between them
(classic example). Now, in a single transaction, I want to create a new
person instance, a new project instance, set a relationship between
them, and then store them both (add them to the database because they're
new) by committing the transaction. But I get an error, because of an
insert on table "person_project" which says that I violate a constraint:
when storing the person instance, it also stores the relationship but
the project isn't stored in the database yet.

I could work-around this by first creating a new person, a new project,
storing them both (transaction.checkpoint()) and then setting the
relationship, and commit() the transaction. But is there anyway that I
can tell OJB to do this transparently?

Thanks,
Bart.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to