ColdFusion 9.0.1 upgrade issue

ColdFusion No Comments »

So, after successfully testing CF 9.0.1 on the dev server for 2 weeks today I decided to update the production servers. Upgrade on development server was without any hickups, so I was expecting the same on production. Well, I should know better.

After the update I started getting a database error:

"macromedia.jdbc.sqlserver.SQLServerLicense cannot be cast to macromedia.jdbc.sqlserverbase.BaseLicense".

Thanks to Google, found Adam Lehman's comment on Ben Forta's blog about this issue. The resolution was easy and it worked. Basically it was an issue related to Macromedia (why ???) DB driver and I needed to revert back to the old one.

But for that comment, I would have been struggling to revert back to 9.0. I think Adobe should have updated the faq and/or release notes to mention this issue... 

 

mappedsuperclass metadata issue

Mach-II , ColdFusion , ORM No Comments »

So, it's great to have mappedsuperclass implementation in CF 9.0.1, but it's certainly half baked. Earlier I posted about issues related to DDL creation with mappedsuperclass and one-to-one relationship.  Once I got past that one, I stumbled upon another issue. If the persistent component doesn't have any properties then the methods of mappedsuperclass are not returned in the metadata (as top level struct).

So, in my previous example I had:

Data.cfc

ExtraData.cfc (persistent, no property, extends ExtraDataBase)

ExtraDataBase.cfc (mappedsuperclass)

If I dump the metaData of ExtraData, here is what I get:

See how there is no struct key "functions" in the top level struct? Now here is what I get if I add a property foo in the ExtraData entity. You will see that now all the properties of mapped super class are available in the top level structs function key.  

The reason I came across this is because I'm using Mach-ii. And they use metadata to populate beans. Which in the above case throws error when it tries to access the "functions" from the metadata.

Last few days it seems like most of my time is going in finding bugs. Hopefully we will get an update soon with these kinks resolved. 

 

 

Keywords: ORM Coldfusion mappedsuperclass metadata mach-ii event-bean  

mappedsuperclass and one-to-one mapping error

ColdFusion , ORM 2 Comments »

ORM drove me nuts today. After hrs and hrs of frustation, finally I was able to find the issue. It seems to be an error with use of one-to-one relationship with mappedsuperclass. Consider this simple example:

Data.cfc



component persistent="true" {	


	property name="dataID" ormtype="int" fieldtype="id" generator="identity" unsavedvalue="0" default="0" ; 


	property name="extraData" fieldtype="one-to-one" cfc="ExtraData" cascade="all"  ;


}


ExtraData.cfc



component persistent="true" extends="ExtraDataBase" {


}

ExtraDataBase.cfc



component mappedsuperclass="true" {


	property name="dataID" ormtype="int" fieldtype="id" generator="foreign" params="{property='data'}" ;


	property name="data" fieldtype="one-to-one" cfc="Data" constrained="true"  ;


}


Really straight forward setup. If you run this ORM won't be able to create the database tables. It throws the error:

"Error while resolving the relationship extraData in cfc Data. Check the column mapping for this property."

If I create the the ExtraData table manually everything works just fine. If I remove the one-to-one relationship everything works fine too. Once the table is created ORM is able to "manage" it and add new properties (fields) without issue.

What threw me for a loop is it didn't generate any DDL error. In fact it wasn't even running DDL!

I must say, other than few of these hickup, that will make you scream at the top of your voice, ORM is AWESOME! I love it. Specially with 9.0.1 multiple database support and proper transaction handling, it rocks!

 

 

 

ORMExecuteQuery() bug

ColdFusion , ORM No Comments »

Few months back I found a bug in ORMExecuteQuery(), which I forgot to report. I think I mentioned on the ORM google group. Basically, in ORMExecuteQuery() if you pass the queryOption argument then the "unique" argument is ignored and it always returns array.

It wasn't a big deal before, but now with multiple datasource, it's an issue because the datasource is passed in the queryOption argument. So, if you pass the datasource, you will never get a unique object back. 

Once I report the issue I will update the post with Bug#.

Update:

Adobe has verified the bug and it is targeted for CF 10 Alpha 1

Bug# 83620

Server crash and JVM setting

Mura , JVM , ColdFusion No Comments »

We are running CF 9 on Win 2008. We were having issues with our server crashing every few days. We would see ColdFusion become unresponsive, stops processing requests and CPU Spike up and stay busy at above 50%. Normal CPU usage are around 10%. I have another instance of ColdFusion running on that server and that stays up and responsive when the other goes down. So, that eliminated any server/network related issue.

Looking at application and exception log I couldn't find any issue. Running SeeFusion and Fusion Reactor didn't reveal anything either. 

Then finally, when looking at the ColdFusion server logs here is what I found:

"java.lang.OutOfMemoryError: PermGen space".

Many of these error at the time of crash! After doing some Google'ing, I found this article which confirmed the issue we were having.

http://www.cfconsultant.com/blog/2010/01/27/jvm-permgen-memory-usage-with-many-cfm-templates/

I changed the -XX:MaxPermSize to 512m. Default JVM setting for MaxPermSize is 192m. 

Happy to report that server has been up for 4 days. So, if you are running application that uses any kind of framework that creates lot of class files, make sure you set MaxPermSize appropriately.

Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds