Datasources in Application.cfc Video

90 views
Skip to first unread message

Mark Drew

unread,
Jul 1, 2013, 12:06:12 PM7/1/13
to ra...@googlegroups.com

Hi there


I thought some of the people in this list might be interested in this week's Railo video that we have just posted:

http://www.youtube.com/watch?v=rnWY4GjC2R0&feature=youtu.be&a


Hope you enjoy it. And I appreciate any feedback! 


Many thanks! 


Mark Drew

The Railo Company
Professional Open Source
skype: mark_railo ma...@getrailo.com
+44 7971 852296 http://www.getrailo.com

Igal @ getRailo.org

unread,
Jul 1, 2013, 12:58:39 PM7/1/13
to ra...@googlegroups.com
great job Mark!  :)
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/etPan.51d1a8f4.2eb141f2.50bb%40railo.home.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Igal Sapir
Railo Core Developer
http://getRailo.org/

James Kilford

unread,
Jul 1, 2013, 1:06:23 PM7/1/13
to ra...@googlegroups.com
Nice!

Some background as to why you might want to do this would be good -- a quick discussion about pros and cons would help people decide on the right approach for themselves. 

James


--

Mark Drew

unread,
Jul 1, 2013, 1:07:03 PM7/1/13
to ra...@googlegroups.com

I think that is out of the scope of the video maybe? But yeah, thanks! 



Regards
Mark Drew

The Railo Company
Professional Open Source
skype: mark_railo ma...@getrailo.com
+44 7971 852296 http://www.getrailo.com

M@

unread,
Jul 2, 2013, 7:13:07 AM7/2/13
to ra...@googlegroups.com
Brilliant, we've been awaiting this, we want our application to require zero configuration, simply have railo install, pull code from git into directory and run it.

Jeremy R DeYoung

unread,
Jul 22, 2013, 10:51:34 PM7/22/13
to ra...@googlegroups.com
This doesn't seem to work with ORM. any ideas when this will work? I just tested 4.1.1.

Arthur Blake

unread,
Oct 24, 2013, 10:34:35 AM10/24/13
to ra...@googlegroups.com
I love this feature. For some reason I can't get it to work in Railo 4.1.1.009 final.
My Application.cfc is not a pure cfscript cfc - is that a requirement?
 

Michael Offner

unread,
Oct 25, 2013, 11:21:52 AM10/25/13
to ra...@googlegroups.com
a small addition, you can also add the datasource definition directly with the query if you like.
example:
<cfquery datasource="# {
class:"org.gjt.mm.mysql.Driver"
,connectionString:"jdbc:mysql://localhost:3306/contentbox?useUnicode=true&characterEncoding=UTF-8"
,username:"contentbox"
,password:"foobar"
,blob:true
,clob:true
}#">
select ....
</cfquery>

Micha







2013/7/1 Mark Drew <ma...@getrailo.com>

--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/etPan.51d1a8f4.2eb141f2.50bb%40railo.home.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
/micha

Michael Offner CTO Railo Technologies GmbH

Arthur Blake

unread,
Oct 25, 2013, 3:31:00 PM10/25/13
to ra...@googlegroups.com
OK, that's great, but doesn't really answer my question.
I have an Application.cfc of this form:

<cfcomponent extends="shared.components.application.applicationBase" output="no">
<cfscript>
this.datasources.test=
{
class = 'com.microsoft.jdbc.sqlserver.SQLServerDriver',
connectionString = '..........',
username = '............',
password = ''.............
};

....etc....

But when I go and try to use the datasource it's not found...
What am I doing wrong?
Thanks...

Michael Offner

unread,
Oct 25, 2013, 6:20:11 PM10/25/13
to ra...@googlegroups.com
do you see that datasource with this dump?
what railo version?

<cfdump var="#getApplicationSettings()#">

Micha



2013/10/25 Arthur Blake <arthur...@gmail.com>

--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.

For more options, visit https://groups.google.com/groups/opt_out.

Arthur Blake

unread,
Oct 28, 2013, 8:58:30 AM10/28/13
to ra...@googlegroups.com
Yes I do see the datasources with that dump (but I do not see in the same dump, the datasources defined in railo administrator  - which are the only ones that work...)
I am using Railo 4.1.1.009 final.

Michael Offner

unread,
Oct 28, 2013, 11:13:30 AM10/28/13
to ra...@googlegroups.com
you only see settings made in the application.cfc, nothing from the admin.
can you please send your application.cfc (please REPLACE all sensitive data with dummy data, not remove them)
then i will check what is going on

Micha



Micha


2013/10/28 Arthur Blake <arthur...@gmail.com>

For more options, visit https://groups.google.com/groups/opt_out.

Michael Offner

unread,
Oct 28, 2013, 12:08:59 PM10/28/13
to ra...@googlegroups.com
the current error message does not show datasources defined in application.cfc, we have improved this for next release.

Micha


2013/10/28 Michael Offner <mic...@getrailo.com>

Arthur Blake

unread,
Oct 28, 2013, 1:07:33 PM10/28/13
to ra...@googlegroups.com
OK I will try and work up a minimal test case that exhibits the problem.

Bruce Kirkpatrick

unread,
Oct 28, 2013, 9:48:48 PM10/28/13
to ra...@googlegroups.com
Nice job mark.  I noticed with 4.1.2.001 patch that you guys are actually making most or all of the settings of railo admin available to be set in Application.cfc.  That's more exciting then just datasources since it could save installation / configuration help for people that distribute frameworks/cfml apps as Railo's options become more complex.

Does it really make sense for the "this" scope settings of Application.cfc to be recreated from scratch on each execution?   If you want to make the app more efficient and reuse application.cfc data you can only optimize this by using structappend() or cfinclude to copy in the functions and data to application.cfc.  I have a feeling they only did this to let us be lazy about writing thread-safe code since 2 application.cfc files running at once can't break each other.  It would be nice if we're going to have a bunch of new structs in application.cfc to be able to set them once in shared memory and not keep causing duplicate objects / memory on every request.  structappend is pretty fast, but I think it still wastes extra memory.

What happens when you change the Application.cfc configuration on every request in onRequestStart?  I found that you can define a datasource in onRequestStart now, and that will work.  Is it safe to have all requests have a completely different railo configuration?   When I try to do that with a dynamic mapping, it throws a stackoverflow error eventually.   Is railo still able to maintain database connection limits behind the scenes based on the datasource configuration matching some other internal structure?  Does it only maintain this limit information when there are concurrent active requests?    What happens if you make the connectionLimit a dynamic value on each request?  How does that impact the connectionLimit that railo actually uses?  If this is a "bad idea" to change these settings on each request, then maybe application.cfc this scope is not the best place for them.  Maybe some new bugs will occur based on us using this feature in unexpected ways like I'm describing.

A railo configuration is usually specific to an entire context, yet application.cfc is specific to a single application and actually just a single request for many of the features.  Will multiple applications in the same context be able to coexist with different railo configurations now with this feature?    That may be an unmentioned benefit of the new syntax.
Reply all
Reply to author
Forward
0 new messages