Questions tagged [cyclic-reference]

A cyclic reference is established if object A holds a reference to B while B holds a reference to A.

A cyclic reference is established if object A holds a reference to B while B holds a reference to A. This exposes a dynamic problem ("hen-vs-egg"), for instance in a programming language, to create a cyclic reference, A and B must be known prior to establishing their inter-relationship. Thus a form of temporal sequence (delay) is needed if data structures are purely functional, for example by declaring the initialization of the references lazy. Cyclic references can also pose problems to garbage collection which needs to detect that none of two objects involved in a cyclic reference are reachable any more by the rest of the code.

143 questions
1
vote
2 answers

Terraform cyclic dependency issue when referencing IP addresses to generate config file

I am trying to setup an AWS environment with 2 ec2 instances in a VPC that are configured to run a piece of software that requires a config file containing the IP address of the other ec2. To do this, I am creating the config file in a template that…
1
vote
1 answer

Dealing with a cyclical reference in EF 4

I have a legacy database design that I'm trying to work around with EF 4. Essentially, I have two tables that reference each other causing issues when trying to add new entries. My structure is this: CREATE TABLE [dbo].[Account] ( [AccountId]…
Brian Vallelunga
  • 9,869
  • 15
  • 60
  • 87
1
vote
1 answer

Rules and Facts (cyclic ?) definition in an inference engine

I am working on an backwards chaining engine as a school project. Until now, I have mostly done projects in C, and so I decided to try Haskell for that projet. I have read LYAH in order to get started and have begun to implement the representation…
1
vote
1 answer

Core-dumped due to unique_ptr or vector in classes with cyclic references

I am trying to handle with a code with cyclic references classes. And I found I got some problem with unique_ptr or vector, when I tried to define them as class members. This code contains 3 classes. I will show all of them in order to avoid any…
JIN TLG
  • 37
  • 6
1
vote
1 answer

Foreign Key cyclic reference Dilemma

Consider a simple situation in which there are 2 tables, named Users and WorkGroups. A User's email address is the primary key in the users table. A Workgroup_id is the primary key in the WorkGroup table. A user can create multiple workgroups. A…
1
vote
1 answer

Is there a way to build a structure with cyclic links without runtime overhead?

I am trying to implement a cyclic linked data structure in Rust. My Nodes are defined as: #[derive(Debug)] enum Node<'a> { Link(&'a Node<'a>), Leaf, } I am trying to build a minimal structure like this (extra brackets for better lifetime…
Felk
  • 7,720
  • 2
  • 35
  • 65
1
vote
0 answers

JPA cyclic reference with GSON

I am using JPA and I am trying to use GSON to serialize it into JSON. I keep getting a stackoverflow due to cyclic reference. Here is the class @Entity @Table(name = "STUDENT") @XmlRootElement @NamedQueries({ @NamedQuery(name =…
Darlyn
  • 4,715
  • 12
  • 40
  • 90
1
vote
2 answers

Data model, cyclic references

I have the following data structure for storing meridians and parallels. Each cartographic point stores: A] geographic and spatial coordinates, cartographic distortions, etc. B] pointer to north/south/east/west node. It allows to store…
Robo
  • 21
  • 2
1
vote
1 answer

JAXB cyclic reference avoidance using @XmlIDREF

I'm using JAXB in a web service with some slightly complex objects. One of the objects, Sensor, has a list of other objects it can communicate with, which necessarily can include itself (behavior that cannot be changed), leading to a cyclic…
Chris M
  • 21
  • 3
1
vote
2 answers

C++ cyclic dependency confusion with adjacency list representation

Sorry for my inexperience with C++, but I spent quiet some time with solving a cyclic dependency issue and hence posing this. I am trying to represent a Adjacency List in C++. I have struct Node, struct Node{ int data; unordered_set
Anoop
  • 5,540
  • 7
  • 35
  • 52
1
vote
1 answer

Inner classes use outer class' method. Is that Cyclic reference? How to avoid

I was wondering if it is considered bad practice to call the outer Class' method in an inner Class and then use the inner Class' method in the outer class. In this case: In BidParser I call the method updateMaps(), which belongs to the outer…
MayTheSchwartzBeWithYou
  • 1,181
  • 1
  • 16
  • 32
1
vote
4 answers

Fastest way to remove reciprocal relationships in Neo4j?

I imported a thesaurus with duplicate "Related Term" relationships so when A and B are related, my graph contains (A)-[:RT]->(B) as well as (B)-[:RT]->(A) To clean this up, because Neo4j allows me to traverse the graph in both directions, I…
Graphileon
  • 5,275
  • 3
  • 17
  • 31
1
vote
1 answer

Finding a circular object in the code

I am writing a script using jQuery for loading some content into my page. At runtime nothing happens. I get this error when inspecting Firebug console: TypeError: cyclic object value data: JSON.stringify({ columnName: _columnName }) Here is the…
Kamran
  • 782
  • 10
  • 35
1
vote
1 answer

How can I have cyclic or forward ReferenceField when using reverse_delete_rule in MongoEngine?

This code bombs: from mongoengine import * class Employee(Document): name = StringField() boss = ReferenceField("Employee", reverse_delete_rule = NULLIFY) Heres the exception: Traceback (most recent call last): File "", line 1, in…
MiniQuark
  • 46,633
  • 36
  • 147
  • 183
1
vote
1 answer

Python cyclic imports fail when using from package import module syntax

Possible Duplicate: Cyclic module dependencies and relative imports in Python Consider the following example of cyclic imports in python: main.py: from pkg import foo pkg/__init.py__: # empty pkg/foo.py: from pkg import bar pkg/bar.py: from…
pygo
  • 13
  • 3