Here are the options you can set in JAWS. Default values are provided in the standardjaws.xml file:
create-table: this tells JAWS whether it has to try and create the table for your beans at deployment time. It is turned on by default. If the table already exists, JAWS will tell it to you, and proceed.
remove-table: this tells JAWS whether it has to remove (drop) the table of your bean at undeployment time. It is turned off by default. You may want to turn it on to clean the database. Note that if you change a cmp-field in a bean, you will probably have to drop the table and create it again, since the schema will have changed.
select-for-update: when this option is turned on, JAWS will do a SQL "SELECT ... FOR UPDATE" when an entity bean is loaded creating a row lock in the datastore. This is very useful for synchronizing multiple instances of JBoss running against the same datastore. The default value for select-for-update is false and also false when the bean is read-only.
pk-constraint: when this option is turned on (off by default) JAWS will create an primary key constraint on the Primary Key fields : CREATE TABLE xxx (pk INTEGER,a VARCHAR(256),b VARCHAR(256),CONSTRAINT pkxxx PRIMARY KEY (pk)))
Each of these options can be set either generally (it will affect JAWS for your whole application) or on a per bean basis, or both of these. JAWS will always read the defaults in standardjaws.xml first, then override them with the defaults in jaws.xml if provided, and finally override them with bean-specific configuration if provided.
General settings: to set an option generally, you have to declare it in a <default-entity> tag in jaws.xml. Here is the section as in standardjaws.xml, you may want to override all or part of it:
<jaws> <default-entity> <create-table>true</create-table> <remove-table>false</remove-table> <tuned-updates>false</tuned-updates> <read-only>false</read-only> <time-out>300</time-out> <select-for-update>false</select-for-update> </default-entity> ... <jaws>
Settings for a bean: to set an option for a particular bean, do it in the corresponding <entity> section. For example, if you want JAWS to drop the table for your ClassBean only, your xml file will contain:
<jaws> ... <enterprise-beans> <entity> <ejb-name>ClassBean</ejb-name> <remove-table>true</remove-table> </entity> </enterprise-beans> ... <jaws>
Note that the <ejb-name> tag must match the one declared in ejb-jar.xml.