Wednesday, May 1, 2013

New CrNiCKL version addresses issue with JUnit and Java 7

Version 1.2.1 of crnickl was released yesterday April 30, 2013. It comes with a small improvement to the API and addresses a problem with unit tests under Java 7

API improvement

The Database interface declares a new method named makeSurrogate to turn a string into a Surrogate. The string is typically produced by a surrogate's toString method. It was previously not possible to create a surrogate from such a string without making some assumptions and using low-level methods.

Issue with JUnit and Java 7

JUnit tests written with JUnit are usually short pieces of code which can be run independently of each other. However, when writing test cases for a database system, it is often handy to assume that test methods are executed in a predictable order, for example in source code order. Under this assumption, a first series of test methods populates the database, followed by a series of methods which modifies the data, and finally a series of methods which deletes the data.

Making this assumption was fine until upgrading to Java 7. The new implementation of the reflection API differs from its predecessors in such a way that JUnit now executes test methods in seemingly random order. This wreaks havoc when the order of tests is important.

To address this issue the @FixMethodOrder annotation has been introduced in JUnit 4.11. It can be used to force execution of test methods in alphabetical order.

Version 1.1.0 of crnickl-test uses this new annotation and renames some methods so that source order and alphabetical order agree. crnickl-test is a library providing common tests for all database drivers and is used by crnickl-jdbc and crnickl-mongodb.

The software can be found on GitHub and in Maven Central.

CrNiCKL project website

Tuesday, January 22, 2013

CrNiCKL driver for MongoDB released

A CrNiCKL driver for MongoDB was released yesterday. With this first NoSQL driver, developers have now the choice to run CrNiCKL services either on SQL or on NoSQL databases. A NoSQL database can be a good solution for accommodating huge datasets or to address replication or sharding requirements. On the other hand, when data integrity is paramount, it is better to stick with a good old SQL database and use the CrNiCKL driver for JDBC.

The drivers can be found on GitHub and in Maven Central.

CrNiCKL project website

Saturday, September 8, 2012

The Time2 Library and CrNiCKL now in Maven Central

The projects artifacts are now deployed to Maven Central. It is not necessary to specify a repository in the settings or POM files any more. Using this software with maven is now 100% straightforward.

Time2 Library
CrNiCKL database

Thursday, September 6, 2012

Is it broke? Can we fix it?

This is an update to a post from last year. The post itself has not been updated. You can find the complete article on

Experts met on January 19, 2012 at the International Telecommunication Union to decide whether to abolish leap seconds. Due to a lack of consensus among participants it was decided to postpone the decision (BBC News). It was a classical standoff between those who want sharp, systematic solutions and the advocates of if it ain't broke, don't fix it. A few months later, on June 30, 2012, yet another leap second was added, causing problems at some websites. Wired reported it under the dramatic sounding heading The Inside Story of the Extra Second That Crashed the Web. The discussion is open: is it broke? Can we fix it?

Wednesday, August 29, 2012

The Time2 Library and CrNiCKL support Maven

Yesterday, I moved some of my Java projects to Maven. There is no difference from a client point of view. The new JARs are plug-compatible but not identical, so checksums have changed. This is the only reason why minor version numbers have been +=1d.

The software is not yet available from The Central Repository, but can be found in a freely accessible maven repository on GitHub. To use it, specify this in your POM or settings:

  <id>jpvetterli on</id>
Time2 Library project
CrNiCKL database project

Tuesday, July 17, 2012

CrNiCKL 1.1.0 released with all delete methods renamed

There were quite a few methods named delete in the CrNiCKL software. This was a bad idea because such methods are useless when called from JavaScript. Indeed, delete is a reserved word in js.

All such methods have been renamed and a new version of the software has been released to the project website, to SourceForge and the GitHub repositories. The following scheme has been used for renaming. Parameterless delete methods are now named destroy. The others are now typically named deleteFoo where Foo is the type of (one of) the parameter(s).

I decided to completely eliminate the old methods rather than let them live a bit longer as deprecated. I did it because the software is not yet used out there. In case I misread the stats, please accept my apologies. In any case the previous version remains available on all the websites mentioned.

Friday, July 13, 2012

Source code sharing

Since a very long time I wanted to switch to the git version control system. It's now done. Compared to what I've used in the past: cvs, sccs, rcs, vss, sclm, Librarian, and maybe others I have forgotten, I like git better. I don't know why I waited so many years...

Although the source of the projects I discuss in this blog was already available for downloading via the project websites, it can now be browsed more comfortably at GitHub.

The relevant repositories are:

for the Time2 Library
for the CrNiCKL base system
for the JDBC support of CrNiCKL
for the CrNiCKL demos