<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
<!--ArborText, Inc., 1988-1999, v.4002-->
<!ENTITY options-common SYSTEM "options-common.sgm">
<!ENTITY synopsis-common SYSTEM "synopsis-common.sgm">
<!ENTITY metainfo SYSTEM "metainfo.sgm">
<!ENTITY % commonents SYSTEM "smancommon.ent">
%commonents;
<!ENTITY % booktitles SYSTEM "booktitles.ent">
%booktitles;
<!ENTITY Dash "&ndash;">
]>
<?Pub UDT _bookmark _target>
<?Pub EntList brvbar bull cross dash diam diams frac12 frac13 frac14 hellip
 laquo lArr loz mdash nabla ndash para pound rArr raquo sect yen ne>
<?Pub Inc>
<refentry id="create-persistence-resource-1">
<refmeta><refentrytitle>create-persistence-resource</refentrytitle><manvolnum>
1</manvolnum>&metainfo;
</refmeta>
<refnamediv><indexterm><primary sortas="asadmin create-persistence-resource, create-persistence-resource">
create-persistence-resource, create-persistence-resource &mdash; registers
a persistence resource</primary></indexterm><indexterm><primary sortas="registers a persistence resource">
registers a persistence resource &mdash; <?Pub Caret>create-persistence-resource,
create-persistence-resource</primary></indexterm><refname>create-persistence-resource
</refname><refpurpose>registers a persistence resource</refpurpose></refnamediv>
<refsynopsisdiv><title>&synp-tt;</title>
<cmdsynopsis><command>create-persistence-resource</command>&synopsis-common;
<arg>&Dash;&Dash;enabled=<replaceable>true</replaceable></arg><arg><option
role="nodash">&Dash;&Dash;target <replaceable>target</replaceable></option></arg>
<group><arg choice="plain"><option role="nodash">&Dash;&Dash;jdbcjndiname <replaceable>
jndi_name</replaceable></option></arg><arg choice="plain"><option role="nodash">&Dash;&Dash;connectionpoolid <replaceable>
id</replaceable></option></arg></group><arg><option role="nodash">&Dash;&Dash;factoryclass <replaceable>
classname</replaceable></option></arg><arg><option role="nodash">&Dash;&Dash;description <replaceable>
text</replaceable></option></arg><arg><option role="nodash">&Dash;&Dash;property (<replaceable>
name</replaceable>=<replaceable>value</replaceable>)[:<replaceable>name</replaceable>=<replaceable>
value</replaceable>]*</option></arg><arg choice="plain"><replaceable>jndi_name
</replaceable></arg>
</cmdsynopsis></refsynopsisdiv>
<refsect1><title>&desc-tt;</title>
<para>The <command>create-persistence-resource</command> command registers
a persistence resource. This command is supported in remote mode only. </para>
<para>The options <option role="nodash">&Dash;&Dash;jdbcjndiname</option>
and <option role="nodash">&Dash;&Dash;connectionpoolid</option> are mutually
exclusive; only one should be used.</para>
</refsect1>
<refsect1><title>&opts-tt;</title>
<variablelist termlength="medium">&options-common;
<varlistentry><term><option role="nodash">&Dash;&Dash;enabled</option></term>
<listitem><para>Determines whether the resource is enabled at runtime.</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;&Dash;target</option></term>
<listitem><para>Specifies the target for which you are creating a persistence
resource. Valid targets are:<itemizedlist>
<listitem><para><literal>server</literal>, which deploys the component to
the default server instance. This is the default target.</para>
</listitem>
<listitem><para><literal>domain</literal>, which deploys the component to
the domain.</para>
</listitem>
<listitem><para><replaceable>cluster_name</replaceable>, which deploys the
component to every server instance in the cluster.</para>
</listitem>
<listitem><para><replaceable>instance_name</replaceable>, which deploys the
component to a particular sever instance.</para>
</listitem>
</itemizedlist></para>
<para>&se-ee-only;</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;&Dash;jdbcjndiname</option></term>
<listitem><para>Specifies the JDBC resource with which database connections
are obtained. It must be the name of an existing JDBC resource.</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;&Dash;connectionpoolid</option></term>
<listitem><para>This option and the option <option role="nodash">--jdbcjndiname
</option> are mutually exclusive.  If <option role="nodash">--connectionpoolid
</option> is specified, then a jdbc resource will be created  behind the scenes
with 'PM' suffixed to the persistence resource name.  See example.</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;&Dash;factoryclass</option></term>
<listitem><para>Deprecated, and not needed for the default CMP implementation.
Specifies the class that creates the persistence manager instance.</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;&Dash;description</option></term>
<listitem><para>Specifies a text description of the persistence resource.
</para>
</listitem></varlistentry>
<varlistentry><term><option role="nodash">&Dash;&Dash;property</option></term>
<listitem><para>Specifies optional name/value pairs for configuring the persistence
resource.</para>
</listitem></varlistentry>
</variablelist></refsect1>
<refsect1><title>&oper-tt;</title>
<variablelist termlength="medium">
<varlistentry><term><replaceable>jndi_name</replaceable></term><listitem>
<para>Specifies the JNDI name of the persistence resource.</para>
</listitem></varlistentry>
</variablelist></refsect1>
<refsect1><title>&exam-tt;</title>
<example>
<title>Using create-persistence-resource</title>
<screen>asadmin> <userinput>create-persistence-resource --user admin --passwordfile passwords.txt
--jdbcjndiname jdbc/sample sample_persistence_resource</userinput>
Command create-persistence-resource executed successfully</screen>
</example>
<example>
<title>Using create-persistence-resource</title>
<screen>asadmin> <userinput>create-persistence-resource --user admin --passwordfile passwords.txt
--connectionpoolid testPool testPersistence</userinput>
Command create-persistence-resource executed successfully</screen>
<para>This command creates a jdbc resource with the name <literal>testPersistencePM
</literal> referencing <literal>testPool</literal>. When you delete the persistence
resource, the jdbc resource created by this command is also removed.</para>
</example>
</refsect1>
<refsect1><title>&exit-tt;</title>
<variablelist termlength="medium">
<varlistentry><term>0</term><listitem><para>command executed successfully
</para>
</listitem></varlistentry>
<varlistentry><term>1</term><listitem><para>error in executing the command
</para>
</listitem></varlistentry>
</variablelist></refsect1>
<refsect1><title>&also-tt;</title>
<para><link linkend="delete-persistence-resource-1"><citerefentry><refentrytitle>
delete-persistence-resource</refentrytitle><manvolnum>1</manvolnum></citerefentry></link>, <link
linkend="list-persistence-resources-1"><citerefentry><refentrytitle>list-persistence-resources
</refentrytitle><manvolnum>1</manvolnum></citerefentry></link></para>
</refsect1>
</refentry>
<?Pub *0000007075>
