DBA Data[Home] [Help]

SYS.OJDS_CONTEXT dependencies on OJDS$BINDINGS$

Line 14: insert into ojds$bindings$ (parent, child, id, binding_type)

10:
11: -- "." and ".." do not contribute to reference counting
12: -- that's why the links are inserted and deleted manually
13: -- bind ".." to the parent
14: insert into ojds$bindings$ (parent, child, id, binding_type)
15: values (inode, p, '..', 1);
16: -- bind "." to the parent
17: insert into ojds$bindings$ (parent, child, id, binding_type)
18: values (inode, inode, '.', 1);

Line 17: insert into ojds$bindings$ (parent, child, id, binding_type)

13: -- bind ".." to the parent
14: insert into ojds$bindings$ (parent, child, id, binding_type)
15: values (inode, p, '..', 1);
16: -- bind "." to the parent
17: insert into ojds$bindings$ (parent, child, id, binding_type)
18: values (inode, inode, '.', 1);
19: return inode;
20: end;
21:

Line 39: insert into ojds$bindings$ (parent, child, id, binding_type)

35: begin
36: -- update the refcount first, as we should be idempotent on
37: -- ref managment.
38: update ojds$inode$ set refcount = refcount + 1 where node = c;
39: insert into ojds$bindings$ (parent, child, id, binding_type)
40: values (p, c, i, bt);
41: end;
42:
43: -- remove a node from a parent

Line 50: from ojds$bindings$ b, ojds$inode$ n

46: bt number;
47: begin
48: -- gets the child and lock the rows in bindings$ and inode$ tables
49: select b.child, b.binding_type into c, bt
50: from ojds$bindings$ b, ojds$inode$ n
51: where b.parent = p and b.id = i and
52: n.node = b.child for update;
53: -- delete "." and ".." if it's a context
54: if bt = 1 then

Line 55: delete from ojds$bindings$ where parent = c and (id = '.' or id = '..');

51: where b.parent = p and b.id = i and
52: n.node = b.child for update;
53: -- delete "." and ".." if it's a context
54: if bt = 1 then
55: delete from ojds$bindings$ where parent = c and (id = '.' or id = '..');
56: end if;
57: -- delete the parent -> child link
58: delete from ojds$bindings$
59: where parent = p and id = i;

Line 58: delete from ojds$bindings$

54: if bt = 1 then
55: delete from ojds$bindings$ where parent = c and (id = '.' or id = '..');
56: end if;
57: -- delete the parent -> child link
58: delete from ojds$bindings$
59: where parent = p and id = i;
60: -- update the child ref count
61: update ojds$inode$ set refcount = refcount - 1 where node = c;
62: -- delete the child if refcount is 0

Line 93: node in (select i.node from ojds$inode$ i, ojds$bindings$ b

89: delete from ojds$attributes$ where node = unrefNodes_rec.node;
90: delete from ojds$refaddr$ where node = unrefNodes_rec.node;
91: -- delete child bindings and children's refcount
92: update ojds$inode$ set refcount = refcount - 1 where
93: node in (select i.node from ojds$inode$ i, ojds$bindings$ b
94: where i.node = b.child and b.parent = unrefNodes_rec.node and b.id <> '..' and b.id <> '.');
95: delete from ojds$bindings$ where parent = unrefNodes_rec.node;
96: end loop;
97: return notEmpty;

Line 95: delete from ojds$bindings$ where parent = unrefNodes_rec.node;

91: -- delete child bindings and children's refcount
92: update ojds$inode$ set refcount = refcount - 1 where
93: node in (select i.node from ojds$inode$ i, ojds$bindings$ b
94: where i.node = b.child and b.parent = unrefNodes_rec.node and b.id <> '..' and b.id <> '.');
95: delete from ojds$bindings$ where parent = unrefNodes_rec.node;
96: end loop;
97: return notEmpty;
98: end;
99:

Line 104: select count(*) into cnt from ojds$bindings$ where parent = c and id <> '.' and id <> '..';

100: -- remove empty context; return 1 if it's NOT EMPTY; returns 0 : success.
101: function rmEmptyCtx (c number) return number is
102: cnt number;
103: begin
104: select count(*) into cnt from ojds$bindings$ where parent = c and id <> '.' and id <> '..';
105: if (cnt <> 0)
106: then
107: return 1; -- not empty
108: end if;

Line 110: delete from ojds$bindings$ where parent = c;

106: then
107: return 1; -- not empty
108: end if;
109: -- delete its own "." and ".."
110: delete from ojds$bindings$ where parent = c;
111: -- delete all pointers to itself
112: delete from ojds$bindings$ where child = c;
113: -- delete the inode, permission, and attributes
114: delete from ojds$inode$ where node = c;

Line 112: delete from ojds$bindings$ where child = c;

108: end if;
109: -- delete its own "." and ".."
110: delete from ojds$bindings$ where parent = c;
111: -- delete all pointers to itself
112: delete from ojds$bindings$ where child = c;
113: -- delete the inode, permission, and attributes
114: delete from ojds$inode$ where node = c;
115: delete from ojds$permissions$ where node = c;
116: delete from ojds$attributes$ where node = c;

Line 126: select b.child into c from ojds$bindings$ b, ojds$inode$ n

122: procedure relink (p number, i varchar2, nc number, nt number) is
123: c number;
124: begin
125: -- gets the child and lock the rows in bindings$ and inode$ tables
126: select b.child into c from ojds$bindings$ b, ojds$inode$ n
127: where b.parent = p and b.id = i and
128: n.node = b.child for update;
129: -- update the child ref count
130: update ojds$inode$ set refcount = refcount - 1 where node = c;

Line 132: update ojds$bindings$ set child = nc, binding_type = nt where parent = p and id = i;

128: n.node = b.child for update;
129: -- update the child ref count
130: update ojds$inode$ set refcount = refcount - 1 where node = c;
131: -- update the binding
132: update ojds$bindings$ set child = nc, binding_type = nt where parent = p and id = i;
133: -- ref managment.
134: update ojds$inode$ set refcount = refcount + 1 where node = nc;
135: -- delete the child if refcount is 0
136: delete from ojds$inode$ where refcount = 0 and node = c;

Line 197: delete from ojds$bindings$ where child = inode_number;

193: delete from ojds$permissions$ where node = inode_number;
194: delete from ojds$attributes$ where node = inode_number;
195: delete from ojds$refaddr$ where node = inode_number;
196: -- delete inward pointers.
197: delete from ojds$bindings$ where child = inode_number;
198: end;
199:
200: function is_this_a_context (inode_number NUMBER) return boolean is
201: tmp1 NUMBER;

Line 229: delete from ojds$bindings$ where parent=inode_number and ((id = '.') or (id = '..'));

225: close drop_inode_cur;
226:
227: if (is_this_a_context(inode_number)) then
228: -- take care of '.' and '..'
229: delete from ojds$bindings$ where parent=inode_number and ((id = '.') or (id = '..'));
230: drop_all_child_links(inode_number);
231: end if;
232: drop_inode_node(inode_number);
233: return TRUE;

Line 239: cursor all_children_cur is select child from ojds$bindings$ where parent = inode_number and id <> '.' and id <> '..';

235:
236: -- after deleting pointers to children and decrement children's reference count
237: -- we can use 'rmUnrefNode' to take care of the rest
238: procedure drop_all_child_links (inode_number NUMBER) is
239: cursor all_children_cur is select child from ojds$bindings$ where parent = inode_number and id <> '.' and id <> '..';
240: tmpp boolean;
241: begin
242: for children_rec in all_children_cur
243: loop

Line 246: delete from ojds$bindings$ where parent=inode_number and id <> '.' and id <> '..';

242: for children_rec in all_children_cur
243: loop
244: update ojds$inode$ set refcount = refcount - 1 where node = children_rec.child;
245: end loop;
246: delete from ojds$bindings$ where parent=inode_number and id <> '.' and id <> '..';
247: -- remove nodes with zero refcount cascadingly
248: loop
249: tmpp := rmUnrefNodes(1);
250: exit when tmpp = FALSE;