If you use an app var in the CFQUERY statement you have to place an application-level CFLOCK around your query.
I forgot to mention in my earlier post on this thread that I set request vars for the local and live settings in application.cfm. Does the same job w/o need for locking. No idea whether having to set the var on every read of application.cfm is balanced out by all the locks you don't have to set, both in the CFQUERY statements and in application.cfm, but at a guess using req vars is going to be faster. --------------------------------------- Matt Robertson [EMAIL PROTECTED] MSB Designs, Inc., www.mysecretbase.com --------------------------------------- ---------- Original Message ---------------------------------- from: "Larry Juncker" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] date: Thu, 13 Dec 2001 15:46:12 -0600 If I understand what you are asking, why do you not just set your DSN as an Application variable? <cfset Application.DataSource = "dev"> or <cfset Application.DataSource = "test"> You would use whichever one you wanted while testing and then just change this one spot in your Application.cfm file when you were ready to go live. Create the ODBC connections and just call the correct one in your code. In your templates then, your queries would be like: <CFQUERY NAME="qMyQuery" DATASOURCE="#Application.DataSource#"> Larry Juncker Senior Cold Fusion Developer Heartland Communications Group, Inc. [EMAIL PROTECTED] -----Original Message----- From: bajaria aslam [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 13, 2001 3:36 PM To: CF-Talk Subject: Can we have two datasources with the same name? Hi. Suppose I have a datasource datasource1 pointing to Database1 on a SQL Server called test. Can I have another datasource called datasource1 pointing to Database1 on SQL Server called dev? The datasource1 currently works fine on http://localhost/ I have created a virtual site called http://localhost/Dev So, is there a way to have the same datasource name to point to different servers depending on if I am under http://localhost/ or http://localhost/dev? That way, I thought, I don't have to keep changing the cf code when the code moves to Test server from Dev. Please let me know if you need more details. Thanks AB __________________________________________________ Do You Yahoo!? Check out Yahoo! Shopping and Yahoo! Auctions for all of your unique holiday gifts! Buy at http://shopping.yahoo.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

