cfadmin create/update datasource

284 views
Skip to first unread message

Sid Wing

unread,
Apr 8, 2016, 12:30:02 PM4/8/16
to Lucee
I can create/update a datasource dynamically using cfadmin - but the one thing I cannot figure out how to do (or find documentation on) - is how to set that datasource as "Allow to use this datasource as client/session storage."

I can do it from the Lucee Admin - but I need a way to do it from inside my app when I am/need to create/update the datasource

Terry Whitney

unread,
Apr 8, 2016, 12:40:01 PM4/8/16
to Lucee
In your application, you would want to first define a master connection to the db server, with full rights.

Next you would want to create an environment class called inside the application that looked up a table for your db sources.

in the lookup table you would store the db source, connection name, username, password and any other fields you find useful, such as application_environment or what not.

At least that is how I would do it. I am sure there are some far more veteran CF folks who would tell you to make a CFC, or explain why you really shouldn't do this. 

Sid Wing

unread,
Apr 8, 2016, 12:49:11 PM4/8/16
to Lucee
I'm already doing all of that, actually. What I am looking for is the way to mark the datasource as "Allow to use this datasource as client/session storage".  I can set the "blob" and "clob" settings - with attributes - just wanting to know how to set THAT flag (Allow to use...) as well

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/1il7osoO58A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/7922d9ac-7f7b-44be-acd4-bdbc1110c29e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Sid Wing
"We are dreamers, shapers, singers, and makers. We study the mysteries of laser and circuit, crystal and scanner, holographic demons and invocations of equations. These are the tools we employ, and we know many things." - Elric

Sid Wing

unread,
Apr 8, 2016, 1:14:46 PM4/8/16
to Lucee
Example - I create the datasource like this:

<cfadmin action="updateDatasource"
type="server"
password="#LuceeADMPWD#"
dbdriver="#dbDriver#"
database="#regModel.theDB#"
classname="#theClassname#"
dsn="#connstring#"
host="#regModel.theHost#"
name="#theDSN#"
newname="#theDSN#"
port="#regModel.thePort#"
blob="true"
clob="true"
dbusername="#regModel.dsnU#"
dbpassword="#regModel.dsnP#">

I need a way to set the "storage:true" flag on this datasource so that it can be used for client variable storage

Gert Franz

unread,
Apr 8, 2016, 1:35:50 PM4/8/16
to lu...@googlegroups.com

Sid,

 

Have a look in the source of the Lucee Administrator. There you’ll find the file services.datasource.create.cfm. There it has the following entry:

 

                        <cfadmin action="updateDatasource" type="#request.adminType#" password="#session["password"&request.adminType]#"

                                   

                                    classname="#driver.getClass()#"

                                    dsn="#driver.getDSN()#"

                                                                       

                                    name="#form.name#"

                                    newName="#form.newName#"

                                   

                                    host="#form.host#"

                                    database="#form.database#"

                                    port="#form.port#"

                                    timezone="#form.timezone#"

                                    dbusername="#form.username#"

                                    dbpassword="#form.password#"

                                   

                                    connectionLimit="#form.connectionLimit#"

                                    connectionTimeout="#form.connectionTimeout#"

                                    metaCacheTimeout="#form.metaCacheTimeout#"

                                    blob="#getForm('blob',false)#"

                                    clob="#getForm('clob',false)#"

                                    validate="#getForm('validate',false)#"

                                    storage="#getForm('storage',false)#"

                                   

                                    allowed_select="#getForm('allowed_select',false)#"

                                    allowed_insert="#getForm('allowed_insert',false)#"

                                    allowed_update="#getForm('allowed_update',false)#"

                                    allowed_delete="#getForm('allowed_delete',false)#"

                                    allowed_alter="#getForm('allowed_alter',false)#"

                                    allowed_drop="#getForm('allowed_drop',false)#"

                                    allowed_revoke="#getForm('allowed_revoke',false)#"

                                    allowed_create="#getForm('allowed_create',false)#"

                                    allowed_grant="#getForm('allowed_grant',false)#"

                                    verify="#verify#"

                                    custom="#custom#"

                                    dbdriver="#dbdriver#"

                                    remoteClients="#request.getRemoteClients()#">

                                    <cfset form.mark="update">

 

I presume the bold line above is what you are looking for…

 

Sincerely
Gert Franz

 

RASIA GmbH

Spittelgasse 7

5103 Moeriken-Wildegg

Switzerland

Email: ge...@rasia.ch
Skype: gert.franz

Phone Switzerland: +41 76 5680 231

--

Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---

You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.


To post to this group, send email to lu...@googlegroups.com.

image001.png

Sid Wing

unread,
Apr 8, 2016, 1:44:34 PM4/8/16
to Lucee
Hi Gert!

I actually tried:  storage="true" (because that seemed logical) - but when it created the datasource - it did not have the storage flag...

We are running version - Lucee 4.5.2.018 final



You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/1il7osoO58A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

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

Gert Franz

unread,
Apr 8, 2016, 2:00:57 PM4/8/16
to lu...@googlegroups.com
Hmm...

That functionality is identical since Railo 3.3. It has to work. I'm on the road atm so i can't check myself, but perhaps you could fiddle with the settings a bit.

If not, I'll have a look asap...

Gert

Sent from somewhere on the road

<image001.png>

Sid Wing

unread,
Apr 8, 2016, 2:07:36 PM4/8/16
to Lucee
Gert - Thanks much, sir!  

I'll keep poking away at it


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

Gert Franz

unread,
Apr 11, 2016, 1:54:32 AM4/11/16
to lu...@googlegroups.com

Hi Sid,

 

Just tried this:

 

<cfadmin action="updateDatasource" type="web" password="********"

     classname="com.microsoft.sqlserver.jdbc.SQLServerDriver"

     dsn="jdbc:sqlserver://{host}:{port}"

     name="susi"

     newName="susi"

     host="localhost"

     database="GIAppl"

     port="1433"

     dbusername="youruser"

     dbpassword="********"

     storage="true"

> 

 

And it perfectly works as expected…

 

Sincerely
Gert Franz

image001.png
Reply all
Reply to author
Forward
0 new messages