Archive

Archive for February, 2010

Java Certificats and Mac

February 24th, 2010 1 comment

For those of us using Macs we seem to relatively often run up against certificates (such as login-dev or olt-dev) not being in our cacerts certificate store even after we are sure that we’ve added them.

A comment I found on another site (http://mediakey.dk/~cc/java-default-keystore-password-cacerts/) suggests why.

It would appear that Apple updates (and I suspect simply replaces) the cacerts file during some of their software updates. This will infact completely reset your cacerts store.

Also note that the other article also notes that apple have changed the default password from ‘changeit’ to ‘changeme’

Gerwood

Categories: Uncategorized Tags: , ,

H2 Database alternative to commit

February 24th, 2010 Comments off

So the earlier post on H2 suggested adding commit to the sql statements to make the tests more reliable.

After a little more research it would appear that there is another setting you may need to apply to H2 to make it run the way you need. By default H2 in memory databases will be wiped out if there are no more connections to them. This means that if you remove all connections to an in memory database and then create a new one it will be connecting to a brand new, empty, in memory database.

How to fix it?

You can add ;DB_CLOSE_DELAY=-1 to the end of the testDatabaseName field in you spring datasource bean.

This means that the in memory database will be contained for the life of the running JVM. You can alternatively set it to a number greater than 0 and the database will be maintained for that many seconds past the last connection. This may be an alternative if you want the database to be available for a limited period only.

Gerwood

Categories: Uncategorized Tags: