ALA-(GU)-KA-(NNA)-N

Past dies as we speak Future comes as we speak present is what we speak

cfthread and request timeout in coldfusion

I have been playing around with CFthread in CF9 and assumed the threads would behave the same way as in Java, where the thread doesn’t die until all the operations are completed.

I was expecting a similar behavior with CFthread as well,since I was planning to spawn a asynchronous thread and let it complete a file upload to cloud using CFHTTP. In the process I found the following after some testing and playing around:

  1. The CFthread basically respects the CF admin panel timeout if it’s set and kills the thread after the timeout period.
  2. It doesn’t respect the request timeout set using the CFsetting tag in onRequestStart or any where in the code.
  3. There are still certain tags that don’t obey the CFthread request timeout,they are CFFTP,CFEXECUTE, CFX tags and CFStoredProc.

So if you like start a asynchronous thread that runs for a longer time than the request timeout set in the CFadmin,please use the following ways:

  1. Un-check the request timeout settings in the CFadmin and then set request timeout for all other requests using the cfsetting @ onrequestStart function.
  2. Use either of the above tags that don’t respect the CFthread timeout.
  3. Use the event gateways if needed.

Just thought some one could find it useful.

No Comments »

Don’t use Default attribute on CF9 ORM persistant object primary key instead use unSavedvalue

I recently started using the CF9 along with Hibernate ORM and I had trouble saving the the object using the EntitySave Method on a new object with out setting the ForceInsert param to true.

If I don’t set the forceInsert param to true then I would get the below error which was driving me nuts since I wanted to use the EntitySave method and let CF ORM decide to save/update the object.


Exception in Hibernate operation.
Either the updated/deleted row does not exist or the session contained stale data. Root cause :o rg.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

After a lot of time googling and going through my logs I figured out that doing the following would let me use the EntitySave as I wanted.

  1. Adding the Unsavedvalue attribute to the primary key and setting it to my default ID before the object is persisted.
  2. Removing the default attribute also works.

Looks like CF9 internally uses the primary key of the object to determine if the object is persisted or not. But setting the default attribute makes the CF engine to set the value when the object is created.

I was used to setting the default attribute on my properties by practice and even the CFBuilder didn’t highlight this as an invalid attribute on the primary key which all led me to waste almost a day on this silly issue.

Hopefully this would help some one starting  off  with CF9 ORM.

3 Comments »

Railo 3.1 CFML server is awesome

Lately I have been playing around with Railo 3.1 in my Ubuntu 9 and believe me its super fast even in my single core centrino Thinkpad R50e laptop !!!!!

No offense to Adobe CF8 last time I tried to install and use Coldbox it just kept on giving me the blue screen of death.Not sure what caused the issue but my system is damn old so I can’t blame any one.

There are so many nice features in Railo which many of discussed here. Personally I like the cfdump eval and the debugging templates. Once it gets the complete BlazeDS integration done then it will be best of CFML engines out there.

I hope Railo helps CFML lead the way in web.

No Comments »

try{use xp;}catch(n crashes;slow;){use Ubuntu;}

Well the title explains it all. After using my IBM Thinkpad R50e for almost 3.7 years after

  1. 10 – 20 times of complete crash downs.
  2. Backing up and recovering every time.
  3. Slow system which wouldn’t allow me to use Eclipse :(   or Dreamweaver or run my fav coldfusion server CF8/Railo 3.
  4. Upgrading my Ram to max 2 gb.

I don’t hate XP but the software’s in this current world has made my laptop work like a 6 moths old Netbook.

All these have forced me to finally try out Ubuntu 9.04 OS instead of XP. All though there was a pretty big learning curve to use Ubuntu but it has been fruitful so far with all my required software running fine without any performance hit. I still have to figure out how to fix the Flash full screen lag issue with Ubuntu 9.04 and my system expect that everything looks gr8.

If you have enough patience,time and old laptop u still want to use please try out Ubuntu out which has gr8 UI.

Thanks to eclipse, cfeclipse, mysql and railo CF engine for their gr8 open source products.

3 Comments »

I won a Adobe web suite premium @ CFUG

I won the lottery for Adobe web suite premium CS4 products conducted @ IECFUG in November 2008 although I got the license only last week. Its worth like 1700$ bugs thanks to adobe and IECFUG.

Here are the lists of products Adobe web suite has and let me know if you  need to use one of the products other than Photoshop,acrobat and dreamweaver.

I will not be giving out the suite to any one for free or for money since its against adobe terms and policies it seems which I dint know of. Sorry guys for giving you false hope.
2 Comments »

Switch to our mobile site