[Nitro] OG connect and exec_statement: unexpected behaviors (Critical -> Trivial)

Mark Van De Vyver mvyver at gmail.com
Mon Sep 3 06:03:50 EDT 2007


> >  INFO: Og uses the Mysql store.
> > DEBUG: Og manageable classes: [Member]
> > DEBUG: CREATE TABLE `ogmember` (`first_name` text, `last_name` text,
> > `address1` text, `city` text, `state` text, `email` text, `oid`
> > integer AUTO_INCREMENT PRIMARY KEY)
> > DEBUG: SELECT * FROM `ogmember` LIMIT 1
> > DEBUG: SELECT * FROM `ogmember` LIMIT 1
>
> This I've tracked down to:
> [./og/lib/sql.rb]
> Line 290
> Line 291
>
> In line sql.rb:290 SQLEnchantMixin#og_create_scheme is called, which
> in turn calls SQLStore#create_field_map.

The full route to the first call of SQLStore#create_field_map is:
sql.rb:290          og_create_scheme
sql.rb:79            evolve_schema
evolution.rb:59   create_field_map

The second call of SQLStore#create_field_map is:
sql.rb:291           create_field_map


>
> Hence the duplicated queries to the database whenever a table is created.
>
> I'm not sure how to fix this, but hope this helps someone.
> I'm happy to help test if needed.
>
> Mark
>
> > Using the Sqlite adapter I see something slightly different, but still
> > the duplicate `'SELECT':
> >
> >  INFO: Og uses the Sqlite store.
> > DEBUG: Og manageable classes: [Member]
> > DEBUG: CREATE TABLE ogmember (first_name text, last_name text,
> > address1 text, city text, state text, email text, oid integer PRIMARY
> > KEY)
> >  INFO: Created table ogmember.
> > DEBUG: SELECT * FROM ogmember LIMIT 1
> > DEBUG: SELECT * FROM ogmember LIMIT 1
> >
> >
> > HTH
> > Mark
> >
> >
>


More information about the Nitro-general mailing list