|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Self-referencing table integrity
Hello, I'm developing a .NET appl and have problems with self-referencing tables. I got some tree structure a->b->c
->d The server has forced writes off. The problem is that i add new field with id 12. Then i want to add a new child with parent 12, but the engine writes an error, because the field with id 12 has not been written yet. Turning forced writes on is not a good idea i suppose, because this is just a special case, any ideas? |
|
#2
|
|||
|
|||
|
Quote:
Your problem has absolutely nothing to do with forced writes (that should be set to ON, btw), but with transactions. When you insert (update) new data, they are visible only to the transaction that inserted them. After that transaction commits, than the data become visible to - all read committed transactions, - all snapshot transactions started after the commit. |
|
#3
|
|||
|
|||
|
In addition to IvanP's answer --
If adding records to this table is a "unit of work", do it in the same transaction and you'll be avoiding these problems as well. -- Martijn Tonies Database Workbench: IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle Upscene Productions http://www.upscene.com |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Self-referencing table integrity |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|