macromedia.coldfusion.database_access
[Top] [All Lists]

Re: Dual sites and dbs

Subject: Re: Dual sites and dbs
From: GArlington <garlington@xxxxxxxxxxxxx>
Date: Fri, 29 Feb 2008 02:24:13 -0800 (PST)
Newsgroups: macromedia.coldfusion.database_access

On Feb 29, 3:16 am, "ndhayes" <webforumsu...@xxxxxxxxxxxxxx> wrote:
> Here is more detail on this issue.
>  We have one instance of MySQL, one instance of CF7. But two separate tables
> serving two separate sites that are clones.
>
>  Of course, the tables have distinct names, and the names are coded in the
> application files appropriately.
>
>  Looks like this:
>
>  Site 1 --> DB1
>  Site 2 --> DB2.
>
>  But when we hit either site 1 or site 2, it causes the other site to seek the
> same DB.
>
>  So it acts like this
>
>  Site 1 --> DB1 <-- Site 2 or,
>  Site 2 --> DB2 <-- Site 1
>
>  The DB user and passwords are the same.

Option 1) setup two separate datasources for two apps
Option 2) make sure that datasource/table details are stored in NAMED
application scope.
You are explaining what is happening, I could see what is happening
from your first post, you do NOT show any code, so I can not guess WHY
it is happening...
One of possible scenarios:
App 1 - Application.cfm -
<cfapplication name="App1" .../>
<cfset application.ds = ... />
<cfset application.table = ... />

App 2 - Application.cfm -
<cfapplication name="App1" .../>
<cfset application.ds = ... />
<cfset application.table = ... />

There are too many different ways to create this problem, NOT naming
the application BEFORE your set datasource and/or table names is yet
another one of the ways.
So, please answer these questions:
1) Are you using Application.cfm OR Application.cfc?
2) When do you set table name in your Application scope? (i.e.
onApplicationStart()?)
3) If you think that everything is correct dump the whole scope where
you store your table name just BEFORE you run your query (i.e. <cfdump
var="#application#">
4) Show us the code that you use - where you SET your table var and
where you USE your table var

<Prev in Thread] Current Thread [Next in Thread>