tosker Because if the sauce isn't awesome, what point is there?

I recently finished a development project that required me to migrate large amounts of legacy data from an ASP-coded webapp that stored its information on a Microsoft SQL Server.

“No problem,” I told myself. “CakePHP has an MSSQL datasource object I can use. It’ll be easy as cake.” *wink* Uhh…no.

My first problem was that I didn’t have the right libraries installed on my dev server. The production server didn’t matter at this point because all the migration was going to take place on the development server. My dev server runs Ubuntu 10.10 with Apache 2 and PHP 5.

I had to grab the FreeTDS library and for good measure, I grabbed the php5-sybase plugin. They didn’t work for until I reboot the machine.

After a reboot, Cake wasn’t giving me any datasource errors any more so I figured I was good to go! Yay! Nope, not quite yet.

Cake was cooperating with the driver in-so-much as it found it and was able to send SQL commands to the legacy server. Whenever I’d try to run a query though, I’d get the following error:

Warning (512): SQL Error: Invalid object name ‘memberinfo’. [CORE/cake/libs/model/datasources/dbo_source.php, line 684]

I know the ‘memberinfo’ table existed because Cake was able to describe the table in the previous 2 SQL queries immediately previous to the find query.

It took me several hours of research and banging my head against the wall to realize that no one else had come up against this specific issue before. I few had similar issues, but none were identical to mine. That meant it was up to me to solve.

Eventually, I figured out that by running a raw query in Cake, it returned a valid response along with data. The problem ended up being the MSSQL DBO datasource that Cake shipped with. Apparently it is no longer maintained and didn’t work correctly any more with whatever version of SQL Server this other host was running.

So I fixed it. I created a sub-class of Cake’s DboMssql datasource and through the wonders of inheritance that comes with object-oriented progamming, overrode the fullTableName() function which was the cause of the error–I call it: DboMssqli. The ‘i’ means improved. Because it actually works.

The full writeup of the original problem along with the explanation and solution is at Cake Questions.

http://ask.cakephp.org/questions/view/getting_invalid_object_name_on_find_with_mssql_datasource

 
Post a comment. Categories: Code, Projects Tags: , , ,

If you’re like me and are having trouble installing Ubuntu on your machine because the installer won’t recognize your individual partitions amongst your drives, you’re in luck.

I have 5 separate drives in my computer, each one with multiple partitions. When I boot up the Ubuntu installer, it detects some of my drives, but lumps the rest together as if they were a single logical volume. At first, I wasn’t sure what was going on, but after doing a little research, I figured it out. Continue reading »

 
Post a comment. Categories: Code, Tech Tags: , , , , , , , ,

Star Trek never gets old. No matter how many times I watch the shows or the movies, it always manages to keep my attention.

Doctor Who Season 4 has the best theme of any of the previous seasons. Actually, I think the 4th season as a whole is better than the others. A close second is the first season.

Angel statues are creepy business.

Finding a job is hard, even when you have mad skills(z). Even though I finally managed to find a job, it took a year and 7 months to find it. I don’t like what I do, but it’s employment that pays the bills and right now, that’s what counts.

Netflix is much more enjoyable with an internet connection that doesn’t suck. Likewise AT&T really is the crappiest provider of pretty much anything more complicated than basic telephone service.

Life just isn’t fair.

SyFy is a stupid name. But most of the programming is awesome.

The Wii’s motion controls are totally unnecessary. In most cases, they are never even used.

Back to the Future is a franchise that still has amazing stories left to tell. Picked up Tell Tale’s Back to the Future: The Game and finished the first episode. Story fits right into the franchise like a fourth movie and the voice acting is fantastic.

Blogging is simply not a priority. I should change that.

 
Post a comment. Categories: Life and Junk

I updated and restored what I could find. I could have sworn that I did SQL dumps from my servers before they went down.

Oh well. What I have is up. Going to be updating more regularly once I have something to update with.

 
Post a comment. Categories: Uncategorized

Finally took the time to finish the few small things that kept me from putting the theme online. Next, I need to find a way to get my content from my WordPress-hosted blog over here. The export keeps barfing because of something in on or more of the posts.

Up and running 100% soonish.

 
Post a comment. Categories: Life and Junk, Projects

I don’t know how many people have actually come here looking for content and found none. But just in case anyone does, I’m working on it.

Life’s a little hectic right now with contract jobs and personal projects. I haven’t had much time to myself to work on the design for this site. But it’s coming. I swear.

 
Post a comment. Categories: Uncategorized

Been toying with running OS X on my clearly non-Mac hardware. OS X 10.5.8 Leopard works great. It’s completely stable and runs really well.

Also bought a copy of OS X 10.6 Snow Leopard and have been trying to get that installed but have been hampered by an install issue.

STOP! Others having this issue need to know that it isn’t necessarily going to dash their hopes of running Snow Leopard on their Hackintosh!

My issue is that during the boot of the DVD, it hangs after a certain part. No panics, or errors. It just stops and sits there. The issue is because I’m using a newer ATI chipset–a chipset that IS supposed to be supported. But if you just need to get it up and running, you can swap in an NVidia card and it should work long enough to get Snow Leopard installed.

So to anyone else having this issue: there is hope! It’s not your disc or necessarily your hardware. Probably just the video card is incompatible.

I’m working on a fix and I’ll post updates about it.

 
Post a comment. Categories: Projects, Tech Tags: , , , , , ,

…and coincidentally, I am the man.

So you know what’s worse than being laid-off? Being laid-off and then running out of money. I had to give up all my fun junk that I used my paycheck for like co-location hosting, and GameFly. And to top it all off, I’ve misplaced the backup of my blog I took before pulling it down. Oh well. No better time to start anew.

You heard it here first: I’m back and I’m taking names. I’ve actually been wanting to start my blog back up again for awhile because it gave me a creative outlet that I could use. Twitter (which is fantastic, by the by; gofollowmenowkthxbai) only let’s you use so many characters in a post. If you’ve been reading before the downfall (old-blog-go-boom) you know that I’m a fairly long-winded person. At least in type anyway. Continue reading »

 
Post a comment. Categories: Junk, Projects, Uncategorized Tags: , ,