Menu

#21 Referential integrity

v1.0 (example)
open
nobody
None
5
2013-05-11
2013-05-11
No

Hi

In EyeDBODL.pdf (page 10) says: "EyeDB can maintain the referential integrity by indicating the inverse directive in the ODL..."

I think that this is false... For instance:

ODL:
class Dept {
attribute short dept_no;
attribute string name;
attribute string loc;

relationship set<emp *=""> empleats inverse Emp::dept;
};</emp>

class Emp {
attribute short emp_no;
attribute string name;
relationship Dept *dept inverse Dept::empleats;
};

OQL:
? d10:=Dept(dept_no:10, name:"Production");
= 2605.3.978732:oid
? d20:=Dept(dept_no:20, name:"Education");
= 2607.3.597498:oid
? e100:=Emp(emp_no:100, name:"Gotera", dept:d10);
= 2609.3.885252:oid
? e200:=Emp(emp_no:200, name:"Otilio", dept:d20);
= 2615.3.113405:oid
? \commit

? for (x in (select Dept.dept_no=10)) delete x;
? select Dept;
= bag(2607.3.597498:oid) >>> OK!!!
? select Emp;
= bag(2609.3.885252:oid, 2615.3.113405:oid)
? \print
Emp {2609.3.885252:oid} = {
emp_no = 100;
name = "Gotera";
dept = {2605.3.978732:oid}; >>> Why??? This dept not exists!!!
};
Emp {2615.3.113405:oid} = {
emp_no = 200;
name = "Otilio";
dept = {2607.3.597498:oid}; >>> OK!!!
};
? e100.dept:=null; >>> I cann't to clean this reference in any way!!! Why?
near line 6: 'e100.dept:=null' => oql error: path expression 'e100.dept' : storage manager: invalid size: objectRead: accessing object 2605.3.978732:oid, offset 129, length 8: object size exceeded, object size is 48: the current transaction must be aborted.
? e200.dept:=null; >>> OK!
= 0:obj
? select Emp;
= bag(2609.3.885252:oid, 2615.3.113405:oid)
? \print
Emp {2609.3.885252:oid} = {
emp_no = 100;
name = "Gotera";
dept = {2605.3.978732:oid}; >>> Why???
};
Emp {2615.3.113405:oid} = {
emp_no = 200;
name = "Otilio";
dept = {NULL}; >>> OK!!!
};

Is there any way to clean the references "dangling"?

Thanks a lot!

Isidre Guixà

Discussion


Log in to post a comment.