[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.
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?
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.
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)
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.
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.
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.”