Project

General

Profile

Actions

Support #542

closed

recursive relationships in Dbo?

Added by Sean Hogan over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/28/2010
Due date:
% Done:

0%

Estimated time:

Description

Hi all,

I'm just starting to use Wt::Dbo, seeing if it will work in a project I'm involved in. I suspect I'm running up against a Dbo limitation, and I'd appreciate confirmation.

I have a class A which is recursive, through a class B; i.e. A has-an-optional B (implemented with hasMany because there's no one-to-one mapping type), and B has-many A. Effectively then, A can have zero or more A.

I create a transient A with no B children, then try to session~~add() it. When I flush() the resulting Dbo::ptr~~ I'm flushing because I want to log the id() - I get "A collection for 'A:0' is already in use. Reentrant [etc.]".

I'm not explicitly using a collection in a reentrant way, but is the recursive relationship causing Dbo to do so under the hood?

If so, is there some other way to accomplish the same thing? I know I can map the foreign key relationships as integers and manage them manually, but that's a bletcherous hack I'd rather avoid.

Thanks,

Sean

Actions #1

Updated by Koen Deforche over 13 years ago

Hey Sean,

Let me try to reproduce this in the test suite. This shouldn't be a limitation in Dbo --- recursive relations without the indirect class are used e.g. in the comments of the blog.

Regards,

koen

Actions #2

Updated by Sean Hogan over 13 years ago

Thanks, I'll also try to produce a small demo.

Actions #3

Updated by Koen Deforche over 13 years ago

  • Status changed from New to Feedback

Hey Sean,

I'ld appreciate it alot if you can make a small test case, and I'll work from that ?

Regards

koen

Actions #4

Updated by Sean Hogan over 13 years ago

So far I haven't been able to make it happen in a test case. :(

I had disabled that relationship in the larger app so that I could continue; I'll reenable it and see if the problem still exists.

Regards,

Sean

Actions #5

Updated by Sean Hogan over 13 years ago

... and of course now the larger app doesn't show the problem either!

Let's chalk this up to a "Code 18"... the problem was 18 inches in front of the monitor. ;-)

Thanks for your support and a great s/w package,

Sean

Actions #6

Updated by Koen Deforche over 13 years ago

  • Status changed from Feedback to Resolved

Bugs which automatically resolve are at the same time the best and the worst :-)

Actions #7

Updated by Koen Deforche over 13 years ago

  • Status changed from Resolved to Closed

Fixed in 3.1.6

Actions

Also available in: Atom PDF