How to avoid this vObjectPtr error

Juergen Schreck lists at innernine.com
Wed May 19 17:32:38 CDT 2004


I just ran into a snag with V4RB 1.10. I'm creating a database with two 
tables, where the second table links to the first via vObjectPtr.

When that database was created no errors were reported.
When records and related records were added, no errors were reported.

However, when I opened the database in Valentina.app I did not have the 
relation working. In table 2, there was my vObjectPtr field, but it 
didn't have a target and it wasn't set to cascade as I had specified in 
the code.

When I manually set the target all was ok. I could see the related 
records in Valentina.app.

But why wasn't this relation created properly when my code created the 
database [without error]? It took me a while to find out. Too long to 
be comfortable actually. In the end, the problem was that in my 
db-subclass's constructor I first instantiated the 'many' table and 
then the 'one' table. Switching the sequence in property assignment 
fixed the problem.

It does make sense, but shouldn't Valentina report an error when I try 
to assign a vObjectPtr to NULL vBaseObject? I suppose I can check for 
it in code or just simply get it right the first time :-P but some kind 
of warning would've really saved me some pain.

Thanks,
Juergen



More information about the Valentina mailing list