ColdFusion 9 ORM and ORMSetting dbcreate dropcreate problems

While developing on a development server I would have my ORMSetting dbcreate='dropcreate' and on my testing/staging/production server it would be set to update.

However the last hour i have come to the conclusion that the setting dropcreate is nothing but buggy as hell.

So what is the problem that could make me so hoping mad?

Well the thing is that it seems to be very inconsistent when creating the tables, for example when using many-to-many on two or more tables, I found that ColdFusion would throw an error on one of these tables complaining that this table didn't exist.

You could refresh the page again straight away, and it wouldn't complain. But I found that some data was never actually saved to the database either.

I decided to try and track this down further and found that if I removed all the M2M relationships, the application would work correctly and save the data in the tables as expected. But as soon as I placed them back in the problems existed again.

Another weird issue that also happened from time to time, was that I would get an exception along the lines of could rename some obscure combination of characters as the table name.

So not one to give up, I decided that enough was enough, and decided to update the database instead of doing a dropcreate. From that moment onwards I have not had any more problems with the CF-ORM side of things in my Application.

So please be aware if you use this setting in your ORMSettings that there are some serious issues with the creation of the tables, and I have even seen 4 exceptions after refreshing the page 4 times and then decide to work on the 5th time, just minus the correct data in the tables.



  • Rory's Gravatar I've noticed many problems with the dropcreate setting as well. The only way to get the ORM to create the tables consistently is if I run a drop all tables command against the database first; then it will create without issue.
    # Posted By Rory | 1/25/10 10:56 AM