Monthly Archives: November 2013

Get H2 Database Version String

For retrieving the server version of a H2 database you connect to use SELECT H2VERSION() FROM DUAL which returns something like 1.3.174 Recently needed this for preventing an application being started with a specific version of H2 (which contained a … Continue reading

Posted in Software | Leave a comment

Grails ClassCastException com.sun.proxy.$Proxy cannot be cast to org.springframework.orm.hibernate3.HibernateCallback

When launching a Grails app, you sometimes get a java.lang.ClassCastException: com.sun.proxy.$Proxy28 cannot be cast to org.springframework.orm.hibernate3.HibernateCallback Just clear the .slcache directory. On windows, that’s %userdir%\.grails\.slcache On *x, it’s something along ~/.grails/2.0.4/.slcache/ Unfortunately, that happens up to several times a week. … Continue reading

Posted in Software | 1 Comment

Make Grails Application Readonly

For a customer project there was the requirement to make certain parts of the application readonly depending on the state of a central domain object, which I’ll call Lock. Long story short: an implementation of AbstractPersistenceEventListener intercepts persistence events and … Continue reading

Posted in Software | Leave a comment

Single Tomcat 7 Webapp with Apache2 with Ajp Connector

As I had to some pages to get this information together, here’s to to set up a single tomcat webapp as the root of an apache server (on Debian, but should work similarly on other systems). Assuming you’re configuring the … Continue reading

Posted in Software | Leave a comment

Upload Files to S3 with s3cmd in Shell Script

For uploading a defined set of files to S3 using s3cmd, you can use the below shell script. In our case, there’s two additional options (you might find useful as well) -P sets the permissions to publicly readable –add-header=Cache-Control:max-age=604800 sets … Continue reading

Posted in Software | Leave a comment