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

Dynamic datasource in ColdFusion via LCDS ES

Guest
May 08, 2009 May 08, 2009

Hi All,

I'm hitting a wall on a requirement for a Flex application which utilizes the LCDS version included with ColdFusion.

I have the project setup to use DAO's, Assemblers and ValueObject (cfc's) which I call from Flex via DataService implmentation and the fill(), getItem(), etc... methods.

I need to setup my ColdFusion layer to access multiple datasources from the same Flex application.  However, because of the way LCDS gets called from Flex, it doesn't seem that Application or Session variables in ColdFusion persist when I set them.  I was thinking I could just have the HTML (cfm) wrapper page for my Flex application set that, but it is not recognized when I go to make a fill or get call against the assembler.

I thought about passing the datasource as a parameter each time a call is made, but while that would work when I initiate fill and get methods, the sync methods are "invisible" and I wouldn't be able to append an argument to them.

So my issue is... how do I go about having ColdFusion read a dynamic variable to define it's datasource?

Thanks in advance for the help.

Brendan

TOPICS
Flash integration
1.6K
Translate
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
Valorous Hero ,
May 08, 2009 May 08, 2009

I have only used a little bit of Flex and I am just aware of LCDS so this may not apply...

ColdFusion code maintains state by setting and passing around two values CFIDE and CFTOKEN or a single value JSESSIONID.  In normal HTTP requests and responses these values are set and received as cookies.  They can also be configured to be passed as get aka url values.  Any request received that has values that validate to a current application|session state will have access to data stored in that memory space.

With Flex applications I do not believe these values get passed around as automatically as they do with normal, browser based HTTP requests.  It would be up to you to receive, maintain and return these values from request to request.

I do not know if this is possible or doable.  If you are having difficulties passing a DSN string for a type of request I presume it would be equally difficult to pass a JSESSIONID.  But this is what is required to access application and|or session data in CFML code.

HTH

Ian

Translate
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
Guest
May 08, 2009 May 08, 2009
LATEST

Hi Ian,

Thanks very much for the reply.  While it doesn't provide the solution, you definitely hit the nail on the head as to the problem 🙂 

Ben Forta provides and explanation (and solution) for what you describe here: http://www.forta.com/blog/index.cfm/2007/11/15/Flex-And-ColdFusion-Session-Variables  However, I tried his method out, and it didn't work for me... perhaps the difference between HTTP RemoteObject access, and RTMP DataServices.

---

You know... I tried it out a while ago before I had a better understanding of the problem... perhaps I'll try again 🙂  Will post results of latest attempt...

Thanks again,

Brendan

Translate
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