Reputation: 10463
Currently running into an issue on a customer QA environment for software we wrote and distributed. I am not given access to their system so the only information I can get is what server logs I am able to glean from their overworked and overstressed sys admins. For political reasons I have to get this right the first time. All eyes are on me.
In our internal test environment we are running SQLServer version 10.50.1600. The application is a Java web application using Hibernate 3.5.5 + c3p0 0.9. We recently had to add a database column to fix a bug, it is basically a boolean flag that signifies deletion. Here is the column that I added to the table. This one-line script was part of the deployment package that was delivered to the client.
alter table foo.bar add expired tinyint not null default 0;
I added the following Hibernate mapping to the application:
<property name="expired" type="boolean">
<column name="expired" precision="1" scale="0" not-null="true" />
</property>
Unit tested, code reviewed, integration tested, QA accepted in-house, packaged and delivered to client. Client correctly applied updates and provided screenshots proving such. The column exists. Application fails with the following exception in the logs:
2012-03-09 14:50:18,374 WARNING [org.hibernate.util.JDBCExceptionReporter] (ajp-####) SQL Error: 207, SQLState: 42S22 2012-03-09 14:50:18,374 SEVERE [org.hibernate.util.JDBCExceptionReporter] (ajp-####) Invalid column name 'expired'.
The only discernable difference between the two environments is that they are running SQLServer version 10.0.4000. Their DBA's may have also tinkered it in other ways that they haven't told me. Do you see a connection here or have any other advice about what the problem may be? Could this be a character set problem?
Upvotes: 1
Views: 6674
Reputation: 10463
I figured out what the problem is.
When I said this in the question, it was blatantly untrue.
The column exists.
The column didn't exist on that environment. The DBA's were giving me information on the wrong environment.
Take this as a lesson folks. Don't build a web application to distribute to a client for them to host on their own servers. If you can help it, host your own web applications on your own servers so you have complete control over it. :)
Upvotes: 3