Hey John,

2011/6/4 John Robson <[email protected]>:
> ptr<User> user = session_.find<User>().where("id =
> ?").bind(app_->userID); // OK
>
> collection< ptr<Project> > collect = user->projects; // OK

This is what causes the problem: you cannot copy a collection which is
involved in a relation (M-N or N-1).

If you change this to a const reference like below, then it should
work okay. I could not reproduce the SQL error you get, but I do get a
segmentation fault when the collection goes out of scope.

   const collection< ptr<Project> >& collect = user->projects;

I've fixed this also in my git copy which I will push to the git repo
by tomorrow, by implementing a copy constructor. I've also added a
test for this to DboTest.C

> Exception: ERROR:  column reference "version" is ambiguous
> LINE 1: select "id", "version", "countrys_id", "type_projects_id", "na...
>
> Table User and Projects has same column name ("version") and (I think)
> Wt::Dbo not discriminate columns:  user.version and projects.version

Can you paste the complete SQL that triggers the error, or is it not printed ?

Regards,
koen

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to