Speedo FAQ


Back to the Speedo documentation


How to build the speedo.jar file?

You have to run the default task ('archives') of the build.xml provided in the Speedo distribution.

How to create data structure ?

By default at runtime, the first time Speedo is asked to manage a persistent class, it tries to initialize the data structure (SQL tables) associated to the class.

Nevertheless when using Speedo in an application server, some databases do not support the creation of the data structure inside a XA transaction. In this case, the user must create the data structure before the launching the server. To do this, Speedo provides a class which initializes the the data structure of persistent classes, outside the scope of a transaction. This class is named 'org.objectweb.speedo.tools.DataStructureCreation'. The Speedo examples show usages of this class through the ant target 'createDataStruct' provided with their build.xml. In fact, the main method of the class expects, as arguments, the names of classes to initialize (white space as separator).

java org.objectweb.speedo.tools.DataStructureCreation com.foo.MyPersistentClass1 com.foo.MyPersistentClass2


How to compile Speedo?

The speedo project uses the version 1.5 of Jarkata Ant.
TargetDescription
compile compile the project in the ./output/build directory
dist create the speedo distribution in the ./output/dist directory
zip create the zip file corresponding to the project and the distribution. The zip file are created into the ./output/zip directory
test run all speedo tests


How to desactivate data prefetching?

Set the properties 'org.objectweb.speedo.query.prefetch.query' or 'org.objectweb.speedo.query.prefetch.extent' to 'off' in the speedo.properties configuration file.

Speedo and the database integrity constraints ?

Some database schemas contains definition of integrity constraints like a foreign key definition. As other persistence containers, Speedo cannot support that the integrity constraint have to be check at each database action. You have to defer the chekcing at commit time. Indeed the persistence containers cannot known the right order to flush modification on the database. A following way shows a declaration of a foreign key constraint which is checked at commit time.

#declaration of a first table TA
create table TA (
	A_ID NUMBER(30) not null,
	constraint PK_MESSAGE primary key (A_ID));

# declaration of a first table TB
create table TB (
	B_ID NUMBER(30) not null,
	AID NUMBER(30),
	constraint PK_MESSAGE primary key (B_ID));

# declaration of a foreign key contraint with the checking deferred at commit time
alter table TB
    add constraint MY_CONSTRAINT_NAME foreign key  (AID)
       references TA (A_ID)
       initially deferred deferrable;

The important thing to see is the last point initially deferred deferrable, because it is this option which specifies that the constraint is checked at commit time.