Error in executing the DDL.

I’m trying to upgrade from## 2.0.0.00095

to the latest stable release and now I am getting

Error in executing the DDL.

[Macromedia][SQLServer JDBC Driver][SQLServer]ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column ‘SSLOnly’ cannot be added to non-empty table ‘cb_page’ because it does not satisfy these conditions.

Any ideas how to fix this?

Thanks.

Jonathan

I’m not sure. I had my own issues preventing me from upgrading from 2.0 to 2.1 where the DB never got updated. I actually wonder if this was the error i was getting but it wasn’t logging.

What database are you using? I’m curious if manually adding that column would help?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

MS SQL Server, what type of column do I need?

Can you point me to where ORM is doing this?

I’m just guessing, but I assume this is the dbcreate = “update” kicking in when ORM reloads. The stack trace should prove this or not. Look in the page entity to see what the new column type is. Also, what version of ContentBox are you upgrading to? I think Luis usually tests with MySQL, perhaps it has different rules on adding not-null columns without a default value. Hmm, actually looking at the entity- there IS a default value. I wonder if this is a bug in ORM. Well-- all this assumes that the DDL in question is being generated by hibernate. It actually could be an update script that’s part of the upgrade. I’d need to see your stack trace to actually know.

property name=“SSLOnly”
notnull=“true”
ormtype=“boolean”
default=“false”
index=“idx_ssl”;

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I used the tool to upgrade to latest “stable”. I haven’t used ORM in past due to way I build apps. Where do I find this update script?

Stack trace below

g.hibernate.JDBCException: Error during DDL export
	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:232)
	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:178)
	at coldfusion.orm.hibernate.HibernateConfiguration.exportSchema(HibernateConfiguration.java:482)
	at coldfusion.orm.hibernate.HibernateConfiguration.exportSchema(HibernateConfiguration.java:434)
	at coldfusion.orm.hibernate.HibernateConfiguration.initHibernateConfiguration(HibernateConfiguration.java:215)
	at coldfusion.orm.hibernate.HibernateConfiguration.<init>(HibernateConfiguration.java:183)
	at coldfusion.orm.hibernate.ConfigurationManager.initConfiguration(ConfigurationManager.java:67)
	at coldfusion.orm.hibernate.HibernateProvider.InitializeORMForApplication(HibernateProvider.java:184)
	at coldfusion.orm.hibernate.HibernateProvider.onPageRequestStart(HibernateProvider.java:147)
	at coldfusion.filter.ApplicationFilter.firePageRequestStart(ApplicationFilter.java:644)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:449)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:142)
	at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
	at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
	at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
	at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
	at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
	at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
	at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
	at coldfusion.CfmServlet.service(CfmServlet.java:219)
	at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column 'SSLOnly' cannot be added to non-empty table 'cb_page' because it does not satisfy these conditions.
	at macromedia.jdbc.sqlserverbase.ddcw.b(Unknown Source)
	at macromedia.jdbc.sqlserverbase.ddcw.a(Unknown Source)
	at macromedia.jdbc.sqlserverbase.ddcv.b(Unknown Source)
	at macromedia.jdbc.sqlserverbase.ddcv.a(Unknown Source)
	at macromedia.jdbc.sqlserver.tds.ddr.v(Unknown Source)
	at macromedia.jdbc.sqlserver.tds.ddr.a(Unknown Source)
	at macromedia.jdbc.sqlserver.tds.ddr.a(Unknown Source)
	at macromedia.jdbc.sqlserver.dda3.m(Unknown Source)
	at macromedia.jdbc.sqlserverbase.dde7.e(Unknown Source)
	at macromedia.jdbc.sqlserverbase.dde7.a(Unknown Source)
	at macromedia.jdbc.sqlserverbase.dde7.v(Unknown Source)
	at macromedia.jdbc.sqlserverbase.dde7.x(Unknown Source)
	at macromedia.jdbc.sqlserverbase.dde7.executeUpdate(Unknown Source)
	at coldfusion.server.j2ee.sql.JRunStatement.executeUpdate(JRunStatement.java:193)
	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:227)

added column and problem solved.

Looking at the stack trace, that’s DDL being generated automatically by hibernate. I’m guessing it’s some sort of bug. Glad adding the column got you past that error. I’m not sure how many people are using ContentBox on SQL Server.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

I am getting ready to deploy using SQL server and CF10.

I am currently on the most stable release

Interesting, I’ve used SQL server on the majority of web projects over the years and it makes me wonder what the ORM is doing
with data type boolean? Boolean is not a SQL server thing.

property name=“SSLOnly”
notnull=“true”
ormtype=“boolean”
default=“false”
index=“idx_ssl”;

For example, I’ve always used tinyint for 1/0 true/false on SQL server although BIT data type

is closer to what boolean would be in the mysql world.

Also, mysql for whatever reason says their boolean is just a synonym for tinyint.

http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html

Makes me think the error is something going on with trying to add a disallowed data type when translating “boolean”

“ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column.”

ORMType is not SQLType there is a difference and under the hood it translates back to tinyint in most cases.

I just wonder if I’m the only person not using Ralio. Seems like others would have found some of these issues.

I am not using Railo, Lucee is the newest and best if you want to go down that route. But I use ColdFusion 11, but haven’t updated past 2 as yet.