• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Finding the Oracle datasource...

Participant ,
Oct 09, 2014 Oct 09, 2014

Copy link to clipboard

Copied

I've inherited a ColdFusion 10 application with an Oracle 11g backend; Windows server.    I am mostly a DBA and not a ColdFusion expert.  In the code for the application, they have the datasource hard coded.  This means when I move it to Test I must change the datasource, upload the modules, and test.   After a successful test, I have to change the datasource, yet again, upload and have it promoted to production.   I seem to remember in the old application I used to support, the code was generic and the datasource depended on what server you were on; if on development, test, or production you didn't have to worry.  I don't remember how this was done.   What would be the best way to eliminate this hard coding and have it more automated?   I know I'm probably missing something, but you all have been very helpful to me in the past few weeks, so hopefully, it's not a completely stupid question.   Thank you.

Views

3.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Oct 09, 2014 Oct 09, 2014

I do not have CF Admin

Can you clarify that?  Do you mean you don't have access to CF Admin?

Without access to CF Admin, I'm not sure you can do anything differently than you are now., unless you write in some logic to examine the server's host name or the site's domain name and set the datasource accordingly.

If you can get access to CF Admin, create two datasources: one for production and one for testing.  Then in application.cfc you can write some logic to examine the server's host name or dom

...

Votes

Translate

Translate
Community Expert ,
Oct 22, 2014 Oct 22, 2014

Copy link to clipboard

Copied

This reminds me of something we stumbled upon during your getBuiltInScopes saga. We discovered quite late in the thread that the datasource of the test environment of your application, abcdTest, and that of the production environment, abcdProd, were unmatched. That might well be the case here, too. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 22, 2014 Oct 22, 2014

Copy link to clipboard

Copied

The code was unmatched, but the databases are identical, except their names.  I don't think this issue is the same, but I'll check.  I'll also check with the SysAdmin and see what CF Admin has for the datasource.  It could be as simple as I have the name spelled wrong... although, I doubt it.  Here's the trace and it leads me to believe it doesn't know the source, even though it's spelled out in the code.

java.sql.SQLSyntaxErrorException: [Macromedia][Oracle JDBC Driver][Oracle]ORA-00942: table or view does not exist

    at macromedia.jdbc.oraclebase.ddca.b(Unknown Source)

    at macromedia.jdbc.oraclebase.ddca.a(Unknown Source)

    at macromedia.jdbc.oraclebase.ddb9.b(Unknown Source)

    at macromedia.jdbc.oraclebase.ddb9.a(Unknown Source)

    at macromedia.jdbc.oracle.ddm.q(Unknown Source)

    at macromedia.jdbc.oraclebase.ddem.v(Unknown Source)

    at macromedia.jdbc.oraclebase.ddem.r(Unknown Source)

    at macromedia.jdbc.oraclebase.ddem.execute(Unknown Source)

    at coldfusion.server.j2ee.sql.JRunStatement.execute(JRunStatement.java:359)

    at coldfusion.sql.Executive.executeQuery(Executive.java:1442)

    at coldfusion.sql.Executive.executeQuery(Executive.java:1201)

    at coldfusion.sql.Executive.executeQuery(Executive.java:1131)

    at coldfusion.sql.SqlImpl.execute(SqlImpl.java:406)

    at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:1059)

    at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:688)

    at cfindex2ecfm887840342.runPage(\\xxxxx002\TestProdMX\Sites\XXX\IE\XXXX\index.cfm:25)

    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)

    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)

    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)

    at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)

    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:449)

    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)

    at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)

    at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)

    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)

    at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)

    at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)

    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)

    at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)

    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)

    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)

    at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)

    at coldfusion.CfmServlet.service(CfmServlet.java:219)

    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

    at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)

    at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)

    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)

    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)

    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

    at java.lang.Thread.run(Thread.java:722)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 21, 2014 Oct 21, 2014

Copy link to clipboard

Copied

That pretty much rules everything out.  Even writing a CFM page to open the Server API and pull information about datasources would require you to have a username/password setup in the CF Administrator.

-Carl V.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 23, 2014 Oct 23, 2014

Copy link to clipboard

Copied

Update (I think it's relevant)...

I suspected that my updates to Application.cfc, to correct the getBuiltInScopes issue previously.  The Application.cfc file exists in a subdirectory, which after you login, called secure.   I have attempted to do the change to the cfquery I mentioned above (set this.datasource and elminate it from the cfquery).  I did this and uploaded the Application.cfc with the set datasource in the cfcomponent area.  I then attempted to remove the datasource attribute and couldn't.  I got the error message that the datasource attribute was missing.  This, to me, means it's not finding the changes to Application.cfc.  I copied the Application.cfc to the root, and it hung with session expired.  When I take off the datasource attribute on the cfquery calls, it still complains...  could I put a modified Application.cfc in root with just the info I need to get past this error?   The gov't SysAdmin assures me the datasource is correct in CF Admin.  Still searching for answers.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 24, 2014 Oct 24, 2014

Copy link to clipboard

Copied

The gov't SysAdmin just verified the connection is there and OK with a screen shot.   Completely at a lost as to where to go next.   I will reference this thread in the database forum.   Thank you.

BTW... when it was suggested that I post in the database forum... just where is it?  Did you mean on the Oracle site?   Thanx.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 24, 2014 Oct 24, 2014

Copy link to clipboard

Copied

LouieWarren wrote:

BTW... when it was suggested that I post in the database forum... just where is it? 

Database Access

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 29, 2014 Oct 29, 2014

Copy link to clipboard

Copied

This problem has just popped up on my Development server, but I think I have caused it.    During all this mess, I was instructed to update my CF to 10, and Oracle to 11g.   Due to other issues, I got CF updated to 10 and can get into CF Admin on this server.  The Oracle 11g, isn't complete so I have disabled all the services to the instance and still have my old 10.2 instance.    I set up the Data source in CF Admin to point to the 10.2 instance, but when I attempt to bring up my application, I get the error that the datasource is not found, even though I've set it up.   CF Admin tells me everything connects fine and the status is ok... much like the gov't SysAdmin tells me my Test database/datasource is ok, but the Test application keeps giving me the datasource is not found message.   Just thought the two issues could be related.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2014 Oct 29, 2014

Copy link to clipboard

Copied

LouieWarren when you setup your datasource on CFAdmin did you use the right version and type?  Also have you tried creating small templates, say one to basically just use the datasource in a query and then dump it.  Sometimes trying to fix an app could be complicated because there may be more than one issue so breaking up the problems into small test templates may help you narrow down your issues.  Tell us what you find.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 06, 2014 Nov 06, 2014

Copy link to clipboard

Copied

I set it up on the same server with the same info (DSN, SID, user credentials) that was used on the 8 version.   I have yet to upgrade the 10.2 Oracle DB to 11g.  I run the Verify in CF Admin and it says things are ok.   What can I do to find out what I did wrong?  Right now, all I am trying to do is bring up the index.cfm page.   I believe if I can solve this problem, I can also solve the original problem I was having getting into my Test application.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 17, 2014 Nov 17, 2014

Copy link to clipboard

Copied

Does any one have any ideas?   I've gone into CF10 Admin and verified the connection to the 10.2 database is correct (Data & Services > Data Sources >  Connected Data Sources > Verify All Connections or Verify my specific connection) and the status says "OK".  What other things should I try?   Thank you in advance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 17, 2014 Nov 17, 2014

Copy link to clipboard

Copied

PLEASE STOP ALL THE SPAM!!! I keep unsuscribing but emails keep coming in.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 17, 2014 Nov 17, 2014

Copy link to clipboard

Copied

LATEST

I don't see where this is SPAM.  Contact forum support to find out why you are still receiving e-mails.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation