
Example Overview
================

This example shows how to use Speedo, an open source implementation of JDO, via a Resource Adapter.
It's the 'bank' Speedo example and it was copied as it is from the Speedo project.
See
	http://speedo.objectweb.org/
for more information.


Prerequisites
=============

1) Speedo Resource Adapter configuration in JOnAS:
- Check that the 'resource' service is present in the list of the JOnAS services
	(see the jonas.services property in the jonas.properties)
- Add the Speedo resource in the list of the resources to be used, in the jonas.properties:
	jonas.service.resource.resources	speedo_for_jonas_ra

!!!Note : The file JONAS_ROOT/lib/common/jorm/ow_jorm_compiler.jar must be copied in
JONAS_ROOT/lib/ext for the runtime of JOnAS else the deployment of the rar will
failed. Note that when using GenIC or another tool, the ow_jorm_compiler.jar must
be removed from JONAS_ROOT/lib/ext.
This is a workaround and it will be removed in next JOnAS versions.

2) Speedo configuration:
Update the Speedo configuration in speedo.properties.
For that, initialize the property
  org.objectweb.speedo.mapperName
Note that the property
  javax.jdo.option.ConnectionFactoryName
is already set with the correct value for this example: jdbc_1


Building this example
=====================

Under $JONAS_ROOT/examples/jdo, do
	$ ant install


Creating the data structure
===========================

The first time, you must create the tables in the data base used in this example.
For that, you can use a special ant target with some properties setted with correct values:
  $ ant -Dspeedo.dbconf=(${JONAS_BASE}|${JONAS_ROOT})/conf/<your-datasource>.properties
        -Djdbc.driver=<your-jdbc-driver>.jar
        createDataStruct

For example:
  $ ant -Dspeedo.dbconf=${JONAS_BASE}/conf/PostgreSQL1.properties
        -Djdbc.driver=/usr/share/pgsql/pg73b1jdbc2.jar
        createDataStruct


Running this example
====================
Commands are given for an Unix system, similar commands can be done on Windows.

1) Run a JOnAS server:
    $ jonas start

2) Load the ejb-jar file of this example
	$ jonas admin -a bank.jar

3) Run the client
	$ jclient -cp $JONAS_BASE/ejbjars/bank.jar:$JONAS_ROOT/lib/common/speedo/speedo_client.jar:$JONAS_ROOT/lib/jonas.jar Client

4) Stop the JOnAS server
	$ jonas stop



