Skip to main content
November 25, 2008
Question

CF 8 instance

  • November 25, 2008
  • 11 replies
  • 1401 views
I am new at this and not sure if it is possible to achieve the following;
I have 2 websites accessing one MS SQL server, however each website access a different database within the SQL server.
- My action plan is to have 2 website in the IIS 6.0 (one webserver),
- in CF admin console I set the default for the 1st website - by pointing to 1 data source in my SQL server, let says > sales1
- create an instance and create a 2nd data source and point to AccoutRec in my SQL server.
So when I del/mod record in the sales1 database it will not affect the AccountRec database.

ANy suggestions would be much appreciated

DT
This topic has been closed for replies.

11 replies

December 1, 2008
I needed something similar. All of my CFQUERY tags have a

datasource="#Application.datasource#" on them.

Depending on the environment I'm in (dev, test, production) I set that variable in Application.cfm based on the machine name I'm running on. The side benefit is I can also point my dev environment at the test database or in an emergency the production database.
November 26, 2008
Thanks Ian,
I will do some research on the tool, although it doesn't seem like much to configure, but obviously I am not doing something right, because now I can not get the admin page to load for the CF instance, but the default admin page loads fine.

Thanks you all for your input it is much appreciated
Inspiring
November 26, 2008
sujictat wrote:

> I assume wsconfig is the web server configuration tool?
>

Yes, this is the tool that configures web servers so that they know
which cold fusion instance to hand cf request to for each web site.
November 26, 2008
Ian wrote:
Have you run the ColdFusion wsconfig tool to connect each web site to
each ColdFusion instance as you desire?

I ran that last night tried to add the 2nd site in there....wow BAD result due to lack of understanding of wsconfig, I probably did something wrong, after that I counld not access the CF admin page anymore...had to reinstall, than change the port number on the jrun.xml file in order for it to run again. So to answer your question. Not really? I am current trying to fine some more info on wsconfig
I assume wsconfig is the web server configuration tool?
Inspiring
November 26, 2008
sujictat wrote:
> Thanks for the reply Ian,
> yes I've thought about what a pain it is to maintenance 2 sites. Since I do
> not have much time with this project I thought the short cut at would be to
> have 2 sites.
> I've created another instance in CF8, but both website are accessing the same
> database, which is in the default CF server: cfusion, I can't get the 2nd
> website to see/use the second instance' datasource.
>

Have you run the ColdFusion wsconfig tool to connect each web site to
each ColdFusion instance as you desire?
Inspiring
November 26, 2008
> And I do not want to go
> through the entire website and change all the data source name

You shoudln't need to do that. You should be using a variable, which is
set in one place (app_globals.cfm, or something like that, which is
included from Application.cfm). This means when you find yourself in the
situation you're in, all you need to do is to vary one line in a single
file.

You've dug a bit of a hole for yourself in hard-coding the DSN names.

--
Adam
November 26, 2008
Thanks for the reply Ian,
yes I've thought about what a pain it is to maintenance 2 sites. Since I do not have much time with this project I thought the short cut at would be to have 2 sites.
I've created another instance in CF8, but both website are accessing the same database, which is in the default CF server: cfusion, I can't get the 2nd website to see/use the second instance' datasource.

Somehow I have to connect the 2nd site to the 2nd CF instance' datasource

DT
Inspiring
November 26, 2008
sujictat wrote:
> I want to keep the same data source name but point to different data base with
> the SQL server.
> website1 >data source > online > point to sales1 database
> website2 >data source > online > point to AccountRec database
>
> thanks
>
> DT
>

Then yes, you can do this with multiple instances of ColdFusion. Each
instance can have a data source named "online" but each one with
different database connection details.

This sounds like a really troubling scenario and, personally, I would
think hard on if there is not a better way that would not require the
maintenance of two sets of identical code just so they could use
different data sources.

November 26, 2008
I want to keep the same data source name but point to different data base with the SQL server.
website1 >data source > online > point to sales1 database
website2 >data source > online > point to AccountRec database

thanks

DT
November 26, 2008
thanks for the reply Adam

yes, but my website is a little different here is how;
the 2 websites are an exact duplicate, I basically copy all the content of one website and made a new one from it, with same coding etc. And most importantly...the NAME OF THE DATASOURCE are the same. And I do not want to go through the entire website and change all the data source name. for ex. sales website access a data source called "online" database. I cannot create multiple data source call "online". but hoping that if I create another instance i will be able to keep the same data source name.

DT