Index: api2/src/java/javax/jdo/PersistenceManagerFactory.java
===================================================================
--- api2/src/java/javax/jdo/PersistenceManagerFactory.java (revision 577381)
+++ api2/src/java/javax/jdo/PersistenceManagerFactory.java (working copy)
@@ -356,6 +356,31 @@
*/
void setDetachAllOnCommit(boolean flag);
+ /** Gets the default copyOnAttach setting for all
+ * PersistenceManager instances obtained from this
+ * factory.
+ * @see #setCopyOnAttach(boolean)
+ * @since 2.1
+ * @return the copyOnAttach setting.
+ */
+ boolean getCopyOnAttach();
+
+ /** Sets the default copyOnAttach setting for all
+ * PersistenceManager instances obtained from this
+ * factory.
+ *
+ *
CopyOnAttach set to true specifies that during
+ * makePersistent, copies are made of detached parameter instances.
+ * With this flag set to false, detached parameter
+ * instances are attached directly and change their state from
+ * detached-clean to persistent-clean or from detached-dirty to
+ * persistent-dirty.
+ *
+ * @see #getCopyOnAttach()
+ * @since 2.1
+ */
+ void setCopyOnAttach(boolean flag);
+
/**
* Sets the name of this PersistenceManagerFactory.
* @since 2.1
Index: api2/src/java/javax/jdo/PersistenceManager.java
===================================================================
--- api2/src/java/javax/jdo/PersistenceManager.java (revision 577381)
+++ api2/src/java/javax/jdo/PersistenceManager.java (working copy)
@@ -912,6 +912,27 @@
*/
void setDetachAllOnCommit(boolean flag);
+ /** Gets the copyOnAttach setting.
+ * @see #setCopyOnAttach(boolean)
+ * @since 2.1
+ * @return the copyOnAttach setting.
+ */
+ boolean getCopyOnAttach();
+
+ /** Sets the copyOnAttach setting.
+ *
+ *
CopyOnAttach set to true specifies that during
+ * makePersistent, copies are made of detached parameter instances.
+ * With this flag set to false, detached parameter
+ * instances are attached directly and change their state from
+ * detached-clean to persistent-clean or from detached-dirty to
+ * persistent-dirty.
+ *
+ * @see #getCopyOnAttach()
+ * @since 2.1
+ */
+ void setCopyOnAttach(boolean flag);
+
/**
* Detach the specified instance from the PersistenceManager.
* The flags for detachment (DETACH_LOAD_FIELDS and DETACH_UNLOAD_FIELDS)
Index: api2/src/java/javax/jdo/Constants.java
===================================================================
--- api2/src/java/javax/jdo/Constants.java (revision 577381)
+++ api2/src/java/javax/jdo/Constants.java (working copy)
@@ -225,6 +225,14 @@
static String PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT
= "detach-all-on-commit";
/**
+ * The name of the persistence manager factory element's
+ * "copy-on-attach" attribute.
+ *
+ * @since 2.1
+ */
+ static String PMF_ATTRIBUTE_COPY_ON_ATTACH
+ = "copy-on-attach";
+ /**
* The name of the persistence manager factory element's "mapping"
* attribute.
*
@@ -595,6 +603,14 @@
static String PROPERTY_DETACH_ALL_ON_COMMIT
= "javax.jdo.option.DetachAllOnCommit";
/**
+ * "javax.jdo.option.CopyOnAttach"
+ *
+ * @see PersistenceManagerFactory#getCopyOnAttach()
+ * @since 2.1
+ */
+ static String PROPERTY_COPY_ON_ATTACH
+ = "javax.jdo.option.CopyOnAttach";
+ /**
* "javax.jdo.option.ConnectionDriverName"
*
* @see PersistenceManagerFactory#getConnectionDriverName()