[baseten-users] Problems with baseten 1.6.2

Tuukka Norri tuukka.norri at karppinen.fi
Wed May 20 01:21:18 EEST 2009


Hi!

Jianhua Meng kirjoitti 19.5.2009 kello 18.08:
> After I imported our model with BaseTenAssistant, everything appears  
> to be normal in the sense that BaseTenAssistant installs the  
> application schema and baseten schema. When I ran our app, a problem  
> surfaced: the app fails to create objects involving relationships. I  
> stepped through our code and found out that the code breaks at point  
> where it attempts to access a relationship that is supposed to exist  
> according to the model. According the  
> EntityDescription.relationshipsByName, no relationships are defined.  
> This unexpected discovery led me to poke around in the baseten  
> schema. To my surprise, the table 'baseten.relationship' is empty.  
> My common sense tells me something may be wrong here.  I expected to  
> see hundreds of rows in this table (from my experience with a prior  
> release).  I admit I don't understand the architecture of baseten  
> schema, I'm just pointing out the obvious discrepancy. This may or  
> may not be related to the problem I'm facing. Please advise on what  
> is going on.
Unfortunately I have no idea why the relationship table got emptied.  
As you wrote, relationships are stored there, and the table being  
empty was undoubtedly the reason for the problems you were  
experiencing. BaseTen Assistant attempts to recreate them when  
quitting in case something has changed, but you can also do it by hand  
with a query like “SELECT baseten.refresh_caches()”. We have written  
some documentation on BaseTen's internals for version 1.7, and it's  
available on the automatically built disk images about which Marko  
wrote. Also, in the new version, BaseTen Assistant has the ability to  
display available relationships for each entity, which should help in  
case something goes wrong.

> Other observations:
> + the baseten schema has changed relative to what I saw before we  
> moved to 1.6.2
There were some references to oids in the schema even before that  
version, but I guess it didn't cause any problems for you. In version  
1.7, oids are used only in the framework because libpq provides schema  
information using them, but not in the schema.

> It would be nice if the baseten framework includes some high level  
> api for applications to: (1) install baseten schema; (2) reinstall  
> baseten schema; (3) report if baseten schema needs to be reinstalled.
While a feature like this could be useful in some situations, BaseTen  
isn't intended primarily for modifying the database schema. (BaseTen  
Assistant does this but tells BaseTen to reload database metadata when  
needed.) BXDatabaseContext currently works with different schema  
versions like it does with databases without BaseTen schema. We could  
add a delegate method or something like that to ease version mismatch  
handling.
-- 
Best regards,
Tuukka Norri
MK&C



More information about the baseten-users mailing list