Monday, May 10, 2010

Coldfusion 9 orm where in clause

I was trying to do a where in clause using coldfusion 9 orm and it just didn't work. I know pretty fast when something is over my head. A quick search revealed this thread: http://groups.google.com/group/cf-orm-dev/browse_thread/thread/19dc48732d58fca0/f47f3d4ef2e75aab?lnk=raot&fwc=1 in the cf9 orm mailing list. This thread discusses the exact issue I was wondering about. At the end, Barney Boisvert gives an example of how to do this (you have to click on "show Text" in the Bob Sivlerberg Post)

Since I can't figure out how to post code to this STUPID blog, you will have to visit the link.

I also had another issue, I wanted to still use offset and maxrows.  That was easy enough even though I tried to make it hard, and you can see that solution in my post to the same group: http://groups.google.com/group/cf-orm-dev/browse_thread/thread/ab1f8badf28dfbb5?hl=en

Wednesday, May 05, 2010

No Row with the Given Identifier Exists: [contact#0]

So I was setting up coldfusion 9 orm and dumping an object that had lots of related objects, an they had lots of related objects etc.. I kept getting the above error when outputting a one-to-many related object. After searching the database I noticed that that particular foreign key was being set to a 0, instead of a null value, but both those values where present in the linking table.

The solution was to use the missingrowignored="true" option in my orm definition. The record with id = 0 didn't exist and cf 9 orm tried pulling a record with that value (usually it expects a null value when nothing related exists). This caused it to error but I also got a positive from hasContact(). Anyway the missingrowignored="true" was the fix.

Tuesday, May 04, 2010

Specifying Security Credentials in Amazon Web Services AWS EC2

At cfobjective this year Chris Peterson gave a great presentation on running coldfusion in the cloud. In his demo he showed Amazon EC2 and showed how he used it for cloud computing. I was excited about this and I have been checking it out.

Right off the bat I got confused on how to enter my security credentials. I created a key pair and tried to enter that, but it didn't work. So after a couple weeks (I only was able to look at it for a few minutes a couple of different times) I found out what was going on. To get the necessary information, I had to go to the AWS EC2 website and after you login you click "Account" then you click "Security Credentials". Now, after this click, I always have to logon again. NO problem. Then, down below, you will see a section "Access Credentials" with 3 tabs, Choose the "Access Keys" tab, it is probably already selected since it is the first one. You see where it says "Your Access Keys" you can see the Access Key Id, and you simply click on show under the "Secret Access Key" column to see your Secret Key.

Then, using elsaticfox I click on credentials, or it prompts me for them. You can enter anything for the "Account Name" and the AWS Access Key and AWS Secret Access Key where those that we saw above.

Seems simple enough but one of those things that tripped me up.