Friday, April 27, 2007

Continuum vs. Derby and how to...

... stop an invoked build on the build-server (Continuum) which seems to run in an endless loop. Yesterday, it was the first time we had a problem with one of our projects on the build-server. After a three hour build one of our core-developer came over to my place and told me to stop the project on Continuum because some of our India-colleagues checked in some bad code which caused an endless loop on the database-side of the application.

So how am I able to stop a running project on Continuum? After a ten minutes search on the web-interface of the build-server my second thought was to restart Continuum but despite of the restart the project still kept building so Continuum some how remebers the state of the project's build. *confused* The next thing I did was to find some threads on of developers who maybe already had the same problem as we had and finally I did.

So, after I have finished reading those threads it was clear that I had to handle this problem by manipulating Continuum's database (Derby). So how am I able to do this when the build-server is on a different machine and I'm not allowed to install any oder software on this machine.

I rememberd the fact that NetBeans had it's cool integrated database-ui, by the way this IDE has also integrated support for Derby-databases, so I tried to connect to my Continuum-database by using NetBeans. First I had to stop Continuum or NetBeans would not allow me to connect to the database. After I had stopped the build-server it finally was possible to connect to the Derby-database over NetBeans. So it was possible to connect with the following connection-string: jdbc:derby :\\server\D$\path\to\derby

But then I had the problem that I didn't know which schema I should use to connect to so I tried out every of it. Another problem was that I couldn't see the tables of the database schema so I had to guess the name of the table. In one of the threads there was a sample select-statement but this was only to change the role of an user.

From Maven

So after a while of studiing those threads I found a log-file and saw that Continuum creates all tables on start up and in this log-output I found some tables and one of it was the PROJECT-table and after a 'select * from SA.PROJECT' I saw all installed projects. A second table was the BUILDRESULT-table. The last entry in this table was the project which caused the problem. So I decided to delete this entry.

From Maven

After restarting Continuum the project wasn't building anymore and then I invoked a 'Build All' and today everything was fine. There is one thing I'd like to mention, in one of a thread that I didn't post was a suggestions to invoke a 'Build All' as solution to stop a project but an answer to this post was that this doesn't work so I'm not sure if my decision to delete the entry from the table was the right solution or the that I invoked the 'Build All'-command over the web-interface of Continuum.

But everything works fine now and maybe this may help you or will give you some ideas if you also run in such kind of problems with the Continuum build-server.


No comments: