how to storing tree view in database and avoid concurrency problem 
Author Message
 how to storing tree view in database and avoid concurrency problem

Hi all,

I am using a tree view for my project. Currently, it is expected to have 130
users who may perform transactions e.g. dragging the nodes from one parent
to another or updating. This resulted in concurrency problem. I am using MS
transaction server which is extremely slow and do have concurrency conflict.
What concurreny control can I take and how do you store a tree in a database
which is effective for reformation of tree for viewing or chop one branch
and store to another. Thank you for your help.

Best regards,
Peko



Sat, 10 May 2003 03:00:00 GMT  
 how to storing tree view in database and avoid concurrency problem
I use a Nodes table with fields for the 'NodeID' (used in the key of the
treeview node) and the ParentID (the nodeID of the parent of the node) as
well as Caption and other fields.

I load the treeview 'on demand', that is, I only load the root
branch(ParentID =0) on start-up and load each branch as its expanded. To do
this, when I load each node on the branch I check to see if it has children,
and if so I add a 'dummy node'. This way on the 'Expand' event I check if
there is a dummy node, and if so, remove it and load the branch nodes from
the db.

Concurrency is toughie, one idea would be to add a flag field to hold a
state e.g. OK/Updating/Updated then when a user performs a operation on an
item you can check if it needs refreshing and lock it so others can do
anything to it. I am currently implementing a check-in/check-out system
similar to sourcesafe.

--
Rob Muir - Rastan[B2]

"Computer Science is no more about computers than astronomy is about
telescopes."
- E.W Dijkstra


Quote:
> Hi all,

> I am using a tree view for my project. Currently, it is expected to have
130
> users who may perform transactions e.g. dragging the nodes from one parent
> to another or updating. This resulted in concurrency problem. I am using
MS
> transaction server which is extremely slow and do have concurrency
conflict.
> What concurreny control can I take and how do you store a tree in a
database
> which is effective for reformation of tree for viewing or chop one branch
> and store to another. Thank you for your help.

> Best regards,
> Peko



Sun, 11 May 2003 09:29:49 GMT  
 how to storing tree view in database and avoid concurrency problem
Sounds like a good idea you have going there B2...
BUT
        What if the user wants the tree to be displayed in a specific order,
do I just go ahead and add index as a primary field?
        If so, what is user A moves a NodeQ on top of NodeX? I believe, I
would have to update NodeX's id to NodeX+1 and so on.... Doing so would
require me to lock the table for             quite a while.
        In the mean time, user B moves another NodeE on top of NodeX,
similarly, the table would be locked to update NodeX's id to NodeX +1 and so
on? Locking the table again?

This looks like an interesting topic, please keep suggestions/ideals coming
please...


Quote:
> I use a Nodes table with fields for the 'NodeID' (used in the key of the
> treeview node) and the ParentID (the nodeID of the parent of the node) as
> well as Caption and other fields.

> I load the treeview 'on demand', that is, I only load the root
> branch(ParentID =0) on start-up and load each branch as its expanded. To
do
> this, when I load each node on the branch I check to see if it has
children,
> and if so I add a 'dummy node'. This way on the 'Expand' event I check if
> there is a dummy node, and if so, remove it and load the branch nodes from
> the db.

> Concurrency is toughie, one idea would be to add a flag field to hold a
> state e.g. OK/Updating/Updated then when a user performs a operation on an
> item you can check if it needs refreshing and lock it so others can do
> anything to it. I am currently implementing a check-in/check-out system
> similar to sourcesafe.

> --
> Rob Muir - Rastan[B2]

> "Computer Science is no more about computers than astronomy is about
> telescopes."
> - E.W Dijkstra



> > Hi all,

> > I am using a tree view for my project. Currently, it is expected to have
> 130
> > users who may perform transactions e.g. dragging the nodes from one
parent
> > to another or updating. This resulted in concurrency problem. I am using
> MS
> > transaction server which is extremely slow and do have concurrency
> conflict.
> > What concurreny control can I take and how do you store a tree in a
> database
> > which is effective for reformation of tree for viewing or chop one
branch
> > and store to another. Thank you for your help.

> > Best regards,
> > Peko



Sun, 11 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to storing tree view in database and avoid concurrency problem

2. Using Tree View Control to store into database

3. How to avoid flash when fill Tree View Node

4. Tree View populated through results returned from stored procedure

5. How will support Data Integrity to avoid Concurrency??

6. How will support Data Integrity to avoid Concurrency??

7. TREE VIEW AND DATABASE

8. Tree View into Database

9. Tree view of data in a database table.

10. Tree view of data in a database table.

11. Tree View into Database

12. Tree view of data in a database table.

 

 
Powered by phpBB® Forum Software