Configuration of project
The project requires some configuration prior to building. In order to run the various tests a simple test table is required. I used PostgreSQL 9.3, but you should be able to use any JDBC 3 or 4 compliant driver. Also, since I make use of libraries (many of which are not in the public Maven repositories) it is best that you point to our Nexus repository. You can also just grab the libraries and place them in your third party repository.
- Download and install PostgresSQL database server.
- Configure PostgresSQL for XA Datasource
- If you get "javax.transaction.HeuristicMixedException: Heuristic Exception" edit postgresql.conf and set max_prepared_transactions to be at least as big as max_connections.
- After restarting postgresql service on Ubuntu you may get "Failed system call was shmget(key=xxxxxxx, size=xxxxxxxx, xxxxx)." Edit /etc/sysctl.conf and add/increase kernel.shmmax.
- Run the SQL script test.sql This script creates the user, database and tables. Read the comments on which parts need to be run separately and which database user to use. You can use pgAdmin or similar tool. You may wish to use another database. This is a simple matter of:
- Adding your JDBC driver JAR to test dependencies.
- Modifying app.properties db.* and xa.* properties.
- Modifying any SQL dialect differences in statements contained in sql.properties.
- Configure Maven to use the Codeferm's Nexus repository.
- Edit .m2/settings.xml to add repository.
- See Netbeans Nexus FAQ if you are using Netbeans.
- Build Maven project (I used Netbeans 8.0 for the project, but this is a standard Maven 3 project).
- Download latest build workspace.zip. Unzip and copy this trunk directory into NetBeansProjects (or whatever directory your IDE uses).
- Build project in Maven with mvn clean install or in Netbeans 8 you can open the project and do a Clean and Build. This should download all the dependencies, compile and run all the tests. The first time may take several minutes to download all the jars and run all the tests. Use mvn site to build Maven site.