[Logo] smithproject.org
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
Query of queries error  XML
Forum Index -> Database Access
Author Message
Pablo



Joined: 16/10/2007 14:33:48
Messages: 1
Offline

Hi!

I want to know if exist some function like query of queries. I use QueryNew(), and i want to find some cells into this query.

It is the error:

Error message: Datasource "null" is not defined!
Please check available datasources in Smith administration.
Error type: database

When i try to compile query of queries, it shows this error.

Bye!
tomdonovan



Joined: 11/06/2007 20:20:23
Messages: 38
Offline

Smith doesn't have query-of-queries like CF does.

One thing you can do which is similar - but not really the same - is to use an in-memory database. The Mckoi db which comes with the standalone Smith package will do this.

To set it up in standalone Smith, create a new datasource like the default mckoi datasource with these differences:

  • the JDBC URL is: jdbc:mckoi:local://wwwroot/db.conf?storage_system=v1javaheap&create_or_boot=true
  • the Connection Checkout Timeout (ms) is: 10000 (because the first connection can take several seconds)
  • Keep idle connections for: 0 (i.e. connections last forever)

    There is no need to run startdb.bat or startdb.sh to use this in-memory Mckoi database. It exists entirely in the Smith process' memory. No db server process is required. All the data in this database will evaporate when Smith is shut down, so you will need to populate tables like this:
    Code:
    <cflock name="temp_table" timeout="30" type="EXCLUSIVE">
         <cfquery datasource="mckoi_mem" name="q1">
             DROP TABLE IF EXISTS temp_table
         </cfquery>
         <cfquery datasource="mckoi_mem" name="q1">
             CREATE TABLE temp_table (id INTEGER, stuff VARCHAR(128), PRIMARY KEY (id))
         </cfquery>
         <!--- populate the table --->
     </cflock>
    and perform queries on the table like this:
    Code:
    <cflock name="temp_table" timeout="30" type="READONLY">
         <cfquery datasource="mckoi_mem" name="q1">
             SELECT * FROM temp_table WHERE id BETWEEN #a# AND #b#
         </cfquery>
     </cflock>

    This is unlike query-of-queries because all the simultaneous pages share the same database, and share the tables - just like a real database. Hence the need for <cflock>.

    Queries on an in-memory database are typically very fast, and it is safe for any number of simultaneous pages to perform read-only queries at the same time.

    Hope this is helpful.

    -tom-
  •  
    Forum Index -> Database Access
    Go to:   
    Powered by JForum 2.1.6 © JForum Team