Wednesday, March 3, 2010

Local programming

Each Fall and Winter semester at Memorial University's Computer Science Department an ACM rules programming competition is held. I've participated in these events for numerous years in various capacities, this year I wanted to boost student interest by providing some prizes. So after considering several options the first, second and third place students each received a text book on programming, and an Ubuntu mug, pen, and install disc. The remaining competitors each received an Ubuntu pen and install disc as a thank you for participating. I'd like to congratulate Chris Whalen, Tim Oram, and Megan O'Connor for their exemplary performances!


After presenting them with their prizes I took some time to discuss open source programming and getting involved early in their careers in projects such as those hosted by the Apache Software Foundation. Living in St John's, Newfoundland the opportunity to contribute to open source projects represents, in my humble opinion, the best exposure to world class development practices and technologies.

I'm looking forward to the next programming competition this Fall 2010, and seeing the competition levels increase as each semester passes.

Update: For anyone interested in reviewing the competition questions and sample solutions please visit here.

Tuesday, January 19, 2010

Setting up SMX4 failover with Oracle

In the tradition of posting articles regarding Servicemix 4 failover here is yet another blog entry. The functionality described below is currently available as a patch to Karaf, a future release should include this feature.

The following system.properties configuration will allow your Karaf based SMX4 instance to use an Oracle JDBC lock:

karaf.lock=true
karaf.lock.class=org.apache.
felix.karaf.main.OracleJDBCLock
karaf.lock.jdbc.url=jdbc:
oracle:thin:@hostname:1521:XE
karaf.lock.jdbc.driver=oracle.
jdbc.OracleDriver
karaf.lock.jdbc.user=user
karaf.lock.jdbc.password=
password
karaf.lock.jdbc.table=KARAF_
LOCK
karaf.lock.jdbc.clustername=
karaf
karaf.lock.jdbc.timeout=30

Please note that the Oracle JDBC driver will have to be added to your classpath, this can be easily done by coping the Oracle JDBC jar into the SMX/lib folder. Also note that the karaf.lock.jdbc.url requires an active SID, this means you must manually create a database instance before using this particular lock.

Friday, October 30, 2009

Setting up SMX4 failover with MySQL

This post is an update to my previous post on setting up SMX4 with high availability in mind.

Since the transition to Apache Felix Karaf the support for more database locking table back ends has expanded. Specifically you can now use Apache Derby, MySQL, or a generic JDBC connector. The Derby and Generic JDBC locks make use of the 'FOR UPDATE' feature common to many databases. The MySQL lock however makes use of the ' LOCK TABLES' directive, this is due to the 'FOR UPDATE' command not returning a ResultSet on more recent versions of MySQL (see some discussions on this here).

The following system.properties configuration will allow your Karaf based SMX4 instance to use a MySQL JDBC lock:

karaf.lock=true
karaf.lock.level=20
karaf.lock.delay=1000
karaf.lock.class=org.apache.felix.karaf.main.MySQLJDBCLock
karaf.lock.jdbc.url=jdbc:mysql://address:port/dbname
karaf.lock.jdbc.driver=com.mysql.jdbc.Driver
karaf.lock.jdbc.user=root
karaf.lock.jdbc.password=karaf
karaf.lock.jdbc.table=KARAF_LOCK
karaf.lock.jdbc.clustername=mycluster
karaf.lock.jdbc.timeout=30


Please note that the MySQL JDBC driver will have to be made available on the classpath.