<!--Arbortext, Inc., 1988-2007, v.4002-->
<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD SolBook 3.5//EN" [
<!ENTITY options-common SYSTEM "options-common.sgm">
<!ENTITY synopsis-common SYSTEM "synopsis-common.sgm">
<!ENTITY % commonents SYSTEM "common.ent">
%commonents;
]>
<?Pub UDT _bookmark _target>
<?Pub CX solbook(>
<refentry id="create-persistence-resource-1"><?Pub Tag atict:info tracking="off"
ref="2"><?Pub Tag atict:user user="hl34125" fullname=""><?Pub Tag atict:user
user="pmdavies" fullname=""><?Pub Tag atict:user user="ah95648" fullname="">
<!-- @(#)create-persistence-resource.1 1.9 07/04/25 SMI; -->
<refmeta><refentrytitle>create-persistence-resource</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="date">30 Jan 2007</refmiscinfo>
<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
<refmiscinfo class="software">&software;</refmiscinfo>
<refmiscinfo class="arch">generic</refmiscinfo>
<refmiscinfo class="copyright">Copyright (c) 2007, Sun Microsystems, Inc.
All Rights Reserved</refmiscinfo>
</refmeta>
<refnamediv><indexterm><primary>create-persistence-resource, create-persistence-resource
</primary></indexterm><indexterm><primary>registers a persistence resourcecreate-persistence-resource,
create-persistence-resource</primary></indexterm>
<refname>create-persistence-resource</refname><refpurpose>registers a persistence
resource</refpurpose></refnamediv>
<refsynopsisdiv><title></title>
<synopsis><command>create-persistence-resource</command> &synopsis-common; [<option
role="double-dash">enabled</option>=<replaceable>true</replaceable>]
 [<option role="double-dash">target</option> <replaceable>target</replaceable>] [<option
role="double-dash">jdbcjndiname</option> <replaceable>jndi_name</replaceable>
 |  <option role="double-dash">connectionpoolid</option> <replaceable>id</replaceable>] [<option
role="double-dash">factoryclass</option> <replaceable>classname</replaceable>]
 [<option role="double-dash">description</option> <replaceable>text</replaceable>] [<option
role="double-dash">property</option> (<replaceable>name</replaceable>=<replaceable>
value</replaceable>)[:<replaceable>name</replaceable>=<replaceable>value</replaceable>]*]
 <replaceable>jndi_name</replaceable></synopsis>
</refsynopsisdiv>
<refsect1 role="description"><title></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="double-dash">jdbcjndiname</option> and <option
role="double-dash">connectionpoolid</option> are mutually exclusive; only
one should be used.</para>
</refsect1>
<refsect1 role="options"><title></title>
<variablelist termlength="medium">&options-common;
<varlistentry><term><option role="double-dash">enabled</option></term>
<listitem><para>Determines whether the resource is enabled at runtime.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">target</option></term>
<listitem><para>Specifies the target for which you are creating a persistence
resource. Valid targets are:</para>
<itemizedlist>
<listitem><para><literal>server</literal>&hyphen; Specifies the default server
instance as the target.  <literal>server</literal> is the name of the default
server instance and is the default value.</para></listitem>
<listitem><para><literal>domain</literal>&hyphen; Specifies a certain domain
as the target.</para></listitem>
<listitem><para><replaceable>cluster_name</replaceable>&hyphen; Specifies
a certain cluster as the target.</para></listitem>
<listitem><para><replaceable>instance_name</replaceable>&hyphen; Specifies
a certain server instance as the target<?Pub Caret>.</para></listitem>
</itemizedlist>
<para>&se-ee-only;</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-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="double-dash">connectionpoolid</option></term>
<listitem><para>This option and the option <option>--jdbcjndiname</option> are
mutually exclusive.  If <option>--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="double-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="double-dash">description</option></term>
<listitem><para>Specifies a text description of the persistence resource.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">property</option></term>
<listitem><para>Specifies optional name/value pairs for configuring the persistence
resource.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="operands"><title></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 role="examples"><title></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 role="exit-status"><title></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 role="see-also"><title></title>
<para><olink targetdoc="ASREFMAN" targetptr="delete-persistence-resource-1">delete-persistence-resource(1)
</olink>, <olink targetdoc="ASREFMAN" targetptr="list-persistence-resources-1">list-persistence-resources(1)
</olink></para>
</refsect1>
</refentry>
<?Pub *0000006630 0>
