db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [db-jdo] 03/43: Remove project not being released with JDO 2.0
Date Fri, 07 May 2021 23:11:45 GMT
This is an automated email from the ASF dual-hosted git repository.

clr pushed a commit to branch origin/2.0.1
in repository https://gitbox.apache.org/repos/asf/db-jdo.git

commit 96022f915eea089025506f19e5e13e6e491f74d8
Author: Craig L Russell <clr@apache.org>
AuthorDate: Fri Mar 31 03:53:56 2006 +0000

    Remove project not being released with JDO 2.0
---
 runtime20/maven.xml                                |   56 -
 runtime20/project.properties                       |   21 -
 runtime20/project.xml                              |   85 -
 runtime20/src/conf/commons-logging.properties      |   42 -
 runtime20/src/conf/logging.properties              |   62 -
 runtime20/src/conf/simplelog.properties            |   52 -
 .../src/java/org/apache/jdo/ejb/EJBHelper.java     |  130 -
 .../src/java/org/apache/jdo/ejb/EJBImplHelper.java |  138 --
 runtime20/src/java/org/apache/jdo/ejb/package.html |   26 -
 .../jdo/impl/model/java/runtime/Bundle.properties  |   59 -
 .../model/java/runtime/RegisterClassListener.java  |  178 --
 .../impl/model/java/runtime/RuntimeJavaModel.java  |  172 --
 .../java/runtime/RuntimeJavaModelFactory.java      |  147 --
 .../impl/model/java/runtime/RuntimeJavaType.java   |   70 -
 .../java/runtime/jdk5/ComponentTypeHelper.java     |  107 -
 .../java/runtime/jdk5/JDK5RuntimeJavaField.java    |   71 -
 .../java/runtime/jdk5/JDK5RuntimeJavaMethod.java   |   59 -
 .../java/runtime/jdk5/JDK5RuntimeJavaModel.java    |   58 -
 .../runtime/jdk5/JDK5RuntimeJavaModelFactory.java  |   88 -
 .../java/runtime/jdk5/JDK5RuntimeJavaProperty.java |   74 -
 .../java/runtime/jdk5/JDK5RuntimeJavaType.java     |   84 -
 .../jdo/impl/model/java/runtime/package.html       |   27 -
 .../apache/jdo/impl/model/jdo/xml/XMLExists.java   |  268 --
 .../java/org/apache/jdo/impl/pm/Bundle.properties  |  102 -
 .../org/apache/jdo/impl/pm/CacheManagerImpl.java   |  631 -----
 .../jdo/impl/pm/PersistenceManagerFactoryImpl.java | 1791 --------------
 .../apache/jdo/impl/pm/PersistenceManagerImpl.java | 2603 --------------------
 .../jdo/impl/pm/PersistenceManagerWrapper.java     | 1179 ---------
 .../org/apache/jdo/impl/pm/TransactionImpl.java    | 1181 ---------
 .../jdo/impl/pm/TransactionSynchronization.java    |   60 -
 .../src/java/org/apache/jdo/impl/pm/package.html   |   28 -
 .../java/org/apache/jdo/impl/sco/ArrayList.java    |  605 -----
 .../java/org/apache/jdo/impl/sco/Bundle.properties |   34 -
 .../src/java/org/apache/jdo/impl/sco/Date.java     |  247 --
 .../src/java/org/apache/jdo/impl/sco/Freezer.java  |  403 ---
 .../src/java/org/apache/jdo/impl/sco/HashMap.java  |  607 -----
 .../src/java/org/apache/jdo/impl/sco/HashSet.java  |  589 -----
 .../java/org/apache/jdo/impl/sco/Hashtable.java    |  614 -----
 .../java/org/apache/jdo/impl/sco/LinkedList.java   |  669 -----
 .../java/org/apache/jdo/impl/sco/SCOHelper.java    |  206 --
 .../src/java/org/apache/jdo/impl/sco/SqlDate.java  |  203 --
 .../src/java/org/apache/jdo/impl/sco/SqlTime.java  |  204 --
 .../java/org/apache/jdo/impl/sco/SqlTimestamp.java |  288 ---
 .../src/java/org/apache/jdo/impl/sco/TreeMap.java  |  603 -----
 .../src/java/org/apache/jdo/impl/sco/TreeSet.java  |  596 -----
 .../src/java/org/apache/jdo/impl/sco/Vector.java   |  737 ------
 .../src/java/org/apache/jdo/impl/sco/package.html  |   27 -
 .../apache/jdo/impl/state/AutoPersistentNew.java   |  118 -
 .../jdo/impl/state/AutoPersistentNewFlushed.java   |  118 -
 .../impl/state/AutoPersistentNewFlushedDirty.java  |  101 -
 .../jdo/impl/state/AutoPersistentPending.java      |   88 -
 .../org/apache/jdo/impl/state/Bundle.properties    |   67 -
 .../src/java/org/apache/jdo/impl/state/Hollow.java |  219 --
 .../org/apache/jdo/impl/state/LifeCycleState.java  |  573 -----
 .../org/apache/jdo/impl/state/PersistentClean.java |  148 --
 .../impl/state/PersistentCleanTransactional.java   |   70 -
 .../apache/jdo/impl/state/PersistentDeleted.java   |  110 -
 .../jdo/impl/state/PersistentDeletedFlushed.java   |   58 -
 .../org/apache/jdo/impl/state/PersistentDirty.java |  110 -
 .../jdo/impl/state/PersistentDirtyFlushed.java     |   92 -
 .../org/apache/jdo/impl/state/PersistentNew.java   |  108 -
 .../jdo/impl/state/PersistentNewDeleted.java       |  105 -
 .../jdo/impl/state/PersistentNewFlushed.java       |   92 -
 .../impl/state/PersistentNewFlushedDeleted.java    |   68 -
 .../jdo/impl/state/PersistentNewFlushedDirty.java  |   70 -
 .../jdo/impl/state/PersistentNonTransactional.java |  282 ---
 .../apache/jdo/impl/state/ReachabilityHandler.java |  255 --
 .../org/apache/jdo/impl/state/SCOProcessor.java    |  438 ----
 .../apache/jdo/impl/state/SimpleFieldManager.java  |  212 --
 .../apache/jdo/impl/state/StateFieldManager.java   |  207 --
 .../apache/jdo/impl/state/StateManagerFactory.java |   66 -
 .../apache/jdo/impl/state/StateManagerImpl.java    | 2599 -------------------
 .../org/apache/jdo/impl/state/TransientClean.java  |  127 -
 .../org/apache/jdo/impl/state/TransientDirty.java  |   96 -
 runtime20/src/java/org/apache/jdo/pm/Accessor.java |   37 -
 .../jdo/pm/PersistenceManagerFactoryInternal.java  |   78 -
 .../apache/jdo/pm/PersistenceManagerInternal.java  |  265 --
 runtime20/src/java/org/apache/jdo/pm/package.html  |   27 -
 .../org/apache/jdo/query/BasicQueryResult.java     |  310 ---
 .../java/org/apache/jdo/query/Bundle.properties    |   28 -
 .../src/java/org/apache/jdo/query/QueryResult.java |   42 -
 .../org/apache/jdo/query/QueryResultHelper.java    |   83 -
 .../org/apache/jdo/query/QueryResultIterator.java  |   40 -
 runtime20/src/java/org/apache/jdo/sco/SCO.java     |   64 -
 .../src/java/org/apache/jdo/sco/SCOCollection.java |  116 -
 runtime20/src/java/org/apache/jdo/sco/SCODate.java |   36 -
 runtime20/src/java/org/apache/jdo/sco/SCOMap.java  |  142 --
 runtime20/src/java/org/apache/jdo/sco/package.html |   26 -
 .../java/org/apache/jdo/state/FieldManager.java    |  137 --
 .../org/apache/jdo/state/StateManagerInternal.java |  283 ---
 .../src/java/org/apache/jdo/state/package.html     |   26 -
 .../java/org/apache/jdo/store/Bundle.properties    |   30 -
 .../src/java/org/apache/jdo/store/Connector.java   |   85 -
 .../java/org/apache/jdo/store/StoreManager.java    |  269 --
 .../org/apache/jdo/store/StoreManagerImpl.java     |  124 -
 .../src/java/org/apache/jdo/store/Transcriber.java |   26 -
 .../org/apache/jdo/store/TranscriberFactory.java   |   26 -
 .../src/java/org/apache/jdo/store/package.html     |   26 -
 98 files changed, 25204 deletions(-)

diff --git a/runtime20/maven.xml b/runtime20/maven.xml
deleted file mode 100644
index 3a85bfe..0000000
--- a/runtime20/maven.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Copyright 2005 The Apache Software Foundation
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-  
-       http://www.apache.org/licenses/LICENSE-2.0
-  
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-
-<project default="default"
-    xmlns:j="jelly:core"
-    xmlns:ant="jelly:ant"
-    xmlns:maven="jelly:maven"
-    >
-
-    <!-- ==================== -->
-    <!-- Default Global Goals -->
-    <!-- ==================== -->
-
-    <goal name="default">
-        <attainGoal name="jar:install"/>
-    </goal>
-
-    <goal name="build">
-        <attainGoal name="default"/>
-    </goal>
-
-    <goal name="rebuild">
-        <attainGoal name="clean"/>
-        <attainGoal name="build"/>
-    </goal>
-
-    <preGoal name="java:compile">
-        <available property="jdk5" classname="java.lang.reflect.ParameterizedType"/>
-        <!-- Compile with -source 1.5 and -target 1.5 in a JDK5 environment. -->
-        <j:if test="${jdk5}">
-            <j:set var="maven.compile.source" value="1.5"/>
-            <j:set var="maven.compile.target" value="1.5"/>
-        </j:if>
-    </preGoal>
-
-    <goal name="clobber" prereqs="clean">
-        <delete>
-            <fileset dir="." defaultexcludes="no" includes="**/*~"/>
-        </delete>
-    </goal>
-
-</project>
diff --git a/runtime20/project.properties b/runtime20/project.properties
deleted file mode 100644
index 9e67cd2..0000000
--- a/runtime20/project.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Copyright 2005 The Apache Software Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at 
-# 
-#     http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software 
-# distributed under the License is distributed on an "AS IS" BASIS, 
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-# See the License for the specific language governing permissions and 
-# limitations under the License.
-
-# Manifest seed file
-maven.jar.manifest = ${basedir}/../JDO20.MF
-
-# checkstyle settings
-maven.checkstyle.properties = ${basedir}/../jdo_checks.xml
-
diff --git a/runtime20/project.xml b/runtime20/project.xml
deleted file mode 100644
index 359c872..0000000
--- a/runtime20/project.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright 2005 The Apache Software Foundation
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-  
-       http://www.apache.org/licenses/LICENSE-2.0
-  
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-
-<project>
-    <pomVersion>3</pomVersion>
-    <extend>../project.xml</extend>
-    <!-- ============== -->
-    <!-- Identification -->
-    <!-- ============== -->
-    <name>JDO2 Implementation (Runtime)</name>
-    <groupId>org.apache.jdo</groupId>
-    <artifactId>jdo2-runtime</artifactId>
-    <currentVersion>SNAPSHOT</currentVersion>
-    <package>org.apache.jdo</package>
-    <shortDescription>Java Data Objects 2.0 (JDO) Runtime</shortDescription>
-    <description>The Java Data Objects 2.0 (JDO) API is a standard interface-based 
-Java model abstraction of persistence, developed as Java Specification 
-Request JSR 243 under the auspices of the Java Community Process.</description>
-    <repository />
-    <!-- ============ -->
-    <!-- Dependencies -->
-    <!-- ============ -->
-    <dependencies>
-        <dependency>
-            <groupId>javax.jdo</groupId>
-            <artifactId>jdo2-api</artifactId>
-            <version>SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.jdo</groupId>
-            <artifactId>jdo2-core</artifactId>
-            <version>SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <id>commons-logging</id>
-            <version>1.0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>geronimo-spec</groupId>
-            <artifactId>geronimo-spec-jta</artifactId>
-            <version>1.0.1B-rc2</version>
-        </dependency>
-    </dependencies>
-    <!-- =================== -->
-    <!-- Build Specification -->
-    <!-- =================== -->
-    <build>
-        <sourceDirectory>src/java</sourceDirectory>
-        <!-- Exclude JDK5 specific classes in a non JDK5 environment. -->
-        <sourceModifications>
-            <sourceModification>
-                <className>java.lang.reflect.ParameterizedType</className>
-                <excludes>
-                    <exclude>**/jdk5/*.java</exclude>
-                </excludes>
-            </sourceModification>
-        </sourceModifications>
-        <!-- J A R  R E S O U R C E S -->
-        <!-- Resources that are packaged up inside the JAR file -->
-        <resources>
-            <resource>
-                <directory>${basedir}/src/java</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                </includes>
-            </resource>
-        </resources>
-    </build>
-</project>
-
diff --git a/runtime20/src/conf/commons-logging.properties b/runtime20/src/conf/commons-logging.properties
deleted file mode 100644
index 76af441..0000000
--- a/runtime20/src/conf/commons-logging.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright 2005 The Apache Software Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at 
-# 
-#     http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software 
-# distributed under the License is distributed on an "AS IS" BASIS, 
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-# See the License for the specific language governing permissions and 
-# limitations under the License.
-
-#
-# This is a sample apache commons logging configuration file defining logging
-# properties for the JDO2 Implementation (Runtime) sources. It defines what
-# logging implementation the apache commons logging API should use by specifying
-# the property org.apache.commons.logging.Log (see below). Please note, that
-# there are separate property files for each logging implementation to set the
-# log level of the loggers:
-# - SimpleLog:      simplelog.properties 
-# - JDK1.4 logging: logging.properties
-#
-# The JDO2 Implementation (Runtime) sources use the following logger instances:
-# org.apache.jdo.impl.pm              PM and PMF implementation
-# org.apache.jdo.impl.sco             SCO implementation
-# org.apache.jdo.impl.state           StateManager implementation
-# org.apache.jdo.store                Generic StoreManager implementation
-# Dependent projects:
-# org.apache.jdo.util                 Utility classes
-# org.apache.jdo.impl.model.jdo       JDOModel implementation
-# org.apache.jdo.impl.model.jdo.xml   XML parser for JDO metadata files
-#
-
-# Uncomment the next line if you want to use the apache simple logger
-#org.apache.commons.logging.Log = org.apache.commons.logging.impl.SimpleLog
-
-# Uncomment the next two lines if you want to use JDK 1.4 logging
-#org.apache.commons.logging.Log = org.apache.jdo.util.JDOJdk14Logger
-
diff --git a/runtime20/src/conf/logging.properties b/runtime20/src/conf/logging.properties
deleted file mode 100644
index 654547e..0000000
--- a/runtime20/src/conf/logging.properties
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Copyright 2005 The Apache Software Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at 
-# 
-#     http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software 
-# distributed under the License is distributed on an "AS IS" BASIS, 
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-# See the License for the specific language governing permissions and 
-# limitations under the License.
-
-#
-# This is a sample properties file to configure standard JDK 1.4 logging for 
-# the JDO2 Implementation (Runtime) sources. 
-# Below you find an entry for each of the source logger instances. 
-# Please uncomment the line and adapt the log level to your needs, 
-# in case to want to enable a particular logger.
-#
-# The following describes the mapping between the log level of JDK 1.4 logging
-# and apache commns logging:
-#   JDK 1.4        Apache 
-#   FINEST         trace 
-#   FINE, FINER    debug 
-#   INFO, CONFIG   info
-#   WARNING        warn
-#   SEVERE         error, fatal
-#
-
-######################
-# Runtime source logger
-######################
-
-# PM and PMF logger
-#org.apache.jdo.impl.pm.level = FINE
-# SCO logger
-#org.apache.jdo.impl.sco.level = FINE
-# StateManager logger
-#org.apache.jdo.impl.state.level = FINE
-# Generic StoreManager logger
-#org.apache.jdo.store.level = FINE
-
-######################
-# Dependent projects
-######################
-
-# Utility class logger
-#org.apache.jdo.util.level = FINE
-# JDOModel logger
-#org.apache.jdo.impl.model.jdo.level = FINE
-# XML parser logger
-#org.apache.jdo.impl.model.jdo.xml.level = FINE
-
-######################
-# JDK 1.4 logging properties
-######################
-
-handlers = java.util.logging.ConsoleHandler
-java.util.logging.ConsoleHandler.level = FINEST
diff --git a/runtime20/src/conf/simplelog.properties b/runtime20/src/conf/simplelog.properties
deleted file mode 100644
index 4e6d347..0000000
--- a/runtime20/src/conf/simplelog.properties
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright 2005 The Apache Software Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at 
-# 
-#     http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software 
-# distributed under the License is distributed on an "AS IS" BASIS, 
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-# See the License for the specific language governing permissions and 
-# limitations under the License.
-
-#
-# This is a sample properties file to configure apache commons logging SimpleLog
-# implementation for the JDO2 Implementation (Runtime) sources.
-# Below you find an entry for each of the source logger instances. 
-# Please uncomment the line and adapt the log level to your needs, 
-# in case to want to enable a particular logger.
-#
-
-######################
-# Runtime source logger
-######################
-
-# PM and PMF logger
-#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.pm = debug
-# SCO logger
-#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.sco = debug
-# StateManager logger
-#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.state = debug
-# Generic StoreManager logger
-#org.apache.commons.logging.simplelog.log.org.apache.jdo.store = debug
-
-######################
-# Dependent projects
-######################
-
-# Utility class logger
-#org.apache.commons.logging.simplelog.log.org.apache.jdo.util = debug
-# JDOModel logger
-#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.model.jdo = debug
-# XML parser logger
-#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.model.jdo.xml = debug
-
-######################
-# Default logging level
-######################
-
-org.apache.commons.logging.simplelog.defaultlog = error
diff --git a/runtime20/src/java/org/apache/jdo/ejb/EJBHelper.java b/runtime20/src/java/org/apache/jdo/ejb/EJBHelper.java
deleted file mode 100644
index bfaa5ed..0000000
--- a/runtime20/src/java/org/apache/jdo/ejb/EJBHelper.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * EJBHelper.java
- *
- * Created on December 15, 2000, 10:06 AM
- */
-
-package org.apache.jdo.ejb;
-
-import javax.transaction.Transaction;
-import javax.transaction.UserTransaction;
-
-import javax.jdo.PersistenceManagerFactory;
-
-/** Provide a Forte for Java implementation with information about the distributed
- * transaction environment.  This is an interface that a helper class
- * implements that is specific to a managed environment.
- * <P><B>This interface is specific to Forte for Java, version 3.0,
- * and is subject to change without notice.  In particular, as additional
- * experience is gained with specific application servers, this interface
- * may have methods added and removed, even with patch releases.  
- * Therefore, this interface should be considered very volatile, and 
- * any class that implements it might have to be reimplemented whenever 
- * an upgrade to either the application server or Forte for Java occurs.</B></P>
- * The class that implements this interface must register itself
- * by a static method at class initialization time.  For example,
- * <blockquote><pre>
- * import org.apache.jdo.*;
- * class blackHerringEJBImplHelper implements EJBHelper {
- *    static EJBHelper.register(new blackHerringEJBImplHelper());
- *    ...
- * }
- * </pre></blockquote>
- *
- * @author Marina Vatkina
- */  
-public interface EJBHelper {
-
-    /** Returns the UserTransaction associated with the calling thread.  If there
-     * is no transaction currently in progress, this method returns null.
-     * @return the UserTransaction instance for the calling thread
-     */  
-    UserTransaction getUserTransaction();
-
-    /** Identify the Transaction context for the calling thread, and return a
-     * Transaction instance that can be used to register synchronizations,
-     * and used as the key for HashMaps. The returned Transaction must implement
-     * <code>equals()</code> and <code>hashCode()</code> based on the global transaction id.
-     * <P>All Transaction instances returned by this method called in the same
-     * Transaction context must compare equal and return the same hashCode.
-     * The Transaction instance returned will be held as the key to an
-     * internal HashMap until the Transaction completes. If there is no transaction 
-     * associated with the current thread, this method returns null.
-     * @return the Transaction instance for the calling thread
-     */  
-    Transaction getTransaction();
-
-    /** Translate local representation of the Transaction Status to
-     * javax.transaction.Status value if necessary. Otherwise this method
-     * should return the value passed to it as an argument.
-     * <P>This method is used during afterCompletion callbacks to translate
-     * the parameter value passed by the application server to the 
-     * afterCompletion method.  The return value must be one of:
-     * <code>javax.transaction.Status.STATUS_COMMITTED</code> or
-     * <code>javax.transaction.Status.STATUS_ROLLED_BACK</code>.
-     * @param 	st 	local Status value
-     * @return the javax.transaction.Status value of the status
-     */
-    int translateStatus(int st);
-
-    /** Replace newly created instance of internal PersistenceManagerFactory
-     * with the hashed one if it exists. The replacement is necessary only if 
-     * the JNDI lookup always returns a new instance. Otherwise this method 
-     * returns the object passed to it as an argument.
-     *
-     * PersistenceManagerFactory is uniquely identified by 
-     * ConnectionFactory.hashCode() if ConnectionFactory is 
-     * not null; otherwise by ConnectionFactoryName.hashCode() if 
-     * ConnectionFactoryName is not null; otherwise 
-     * by the combination of URL.hashCode() + userName.hashCode() + 
-     * password.hashCode() + driverName.hashCode();
-     *
-     * @param 	pmf 	PersistenceManagerFactory instance to be replaced
-     * @return 	the PersistenceManagerFactory known to the runtime
-     */
-    PersistenceManagerFactory replacePersistenceManagerFactory(
-        PersistenceManagerFactory pmf) ;
-
-    /** Called at the beginning of the Transaction.beforeCompletion() to
-     * register the component with the app server if necessary.
-     * The component argument is an array of Objects. 
-     * The first element is javax.jdo.Transaction object responsible for 
-     * transaction completion.
-     * The second element is javax.jdo.PersistenceManager object that has 
-     * been associated with the Transaction context for the calling thread.
-     * The third element is javax.transaction.Transaction object that has been 
-     * associated with the given instance of PersistenceManager.
-     * The return value is passed unchanged to the postInvoke method.
-     *
-     * @param 	component 	an array of Objects
-     * @return 	implementation-specific Object
-     */
-    Object enlistBeforeCompletion(Object component) ;
-
-    /** Called at the end of the Transaction.beforeCompletion() to
-     * de-register the component with the app server if necessary.
-     * The parameter is the return value from preInvoke, and can be any
-     * Object.
-     *
-     * @param 	im 	implementation-specific Object
-     */
-    void delistBeforeCompletion(Object im) ;
-
-}
-
diff --git a/runtime20/src/java/org/apache/jdo/ejb/EJBImplHelper.java b/runtime20/src/java/org/apache/jdo/ejb/EJBImplHelper.java
deleted file mode 100644
index 7367b33..0000000
--- a/runtime20/src/java/org/apache/jdo/ejb/EJBImplHelper.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * EJBImplHelper.java
- *
- * Created on December 15, 2000, 10:15 AM
- */
-package org.apache.jdo.ejb;
-
-import javax.transaction.*;
-
-import javax.jdo.PersistenceManagerFactory;
-
-/** Provides helper methods for a Forte for Java implementation with the
- * application server specific information in the distributed transaction
- * environment. Calls corresponding methods on the registered class which
- * implements EJBHelper interface.
- * 
- * @author Marina Vatkina
- */
-public class EJBImplHelper {
-    
-   /** Reference to a class that implements EJBHelper interface for this
-    * particular application server
-    */
-    static EJBHelper myHelper;
- 
-   /** Register class that implements EJBHelper interface
-    * Should be called by a static method at class initialization time.
-    *
-    * @param h application server specific implemetation of the
-    * EJBHelper interface.
-    */
-    public static void registerEJBHelper (EJBHelper h) {
-        myHelper = h;
-    }
-
-   /** Returns Transaction instance that can be used to register
-    * synchronizations. In a non-managed environment or if there is no
-    * transaction associated with the current thread, this method
-    * returns null.
-    *
-    * @see EJBHelper#getTransaction()
-    * @return the Transaction instance for the calling thread
-    */
-    public static Transaction getTransaction() {
-        return myHelper == null ? null : myHelper.getTransaction();
-    }
-
-   /** Returns the UserTransaction associated with the calling thread.
-    * In a non-managed environment or if there is no transaction
-    * currently in progress, this method returns null.
-    *
-    * @see EJBHelper#getUserTransaction()
-    * @return the UserTransaction instance for the calling thread
-    */
-    public static UserTransaction getUserTransaction() {
-        return myHelper == null ? null : myHelper.getUserTransaction();
-    }
-
-    /** Identifies the managed environment behavior.
-     * @return true if there is a helper class registered. 
-     */
-    public static boolean isManaged() {
-        return myHelper != null;
-    }
-
-   /** Translates local representation of the Transaction Status to 
-    * javax.transaction.Status value. In a non-managed environment
-    * returns the value passed to it as an argument.
-    *
-    * @see EJBHelper#translateStatus(int st)
-    * @param 	st 	Status value
-    * @return 	the javax.transaction.Status value of the status 
-    */ 
-    public static int translateStatus(int st) {
-        return myHelper == null ? st : myHelper.translateStatus(st);
-    }
-
-   /** Returns the hashed instance of internal PersistenceManagerFactory 
-    * that compares equal to the newly created instance or the instance 
-    * itself if it is not found. In a non-managed environment returns
-    * the value passed to it as an argument.
-    *
-    * @see EJBHelper#replacePersistenceManagerFactory(
-    * 	PersistenceManagerFactory pmf)
-    * @param 	pmf 	PersistenceManagerFactory instance to be replaced
-    * @return 	the PersistenceManagerFactory known to the runtime
-    */
-    public static PersistenceManagerFactory replacePersistenceManagerFactory(
-        PersistenceManagerFactory pmf) {
-        return myHelper == null ? pmf : 
-            myHelper.replacePersistenceManagerFactory(pmf);
-    }
-
-   /** Called at the beginning of the Transaction.beforeCompletion()
-    * to register the component with the app server if necessary. In a
-    * non-managed environment or if the delistBeforeCompletion method
-    * does not use the value, this method returns null. 
-    *
-    * @see EJBHelper#enlistBeforeCompletion(Object component)
-    * @param 	component 	an array of Objects
-    * @return implementation-specific Object
-    */
-    public static Object enlistBeforeCompletion(Object component) {
-        return myHelper == null ? null : 
-            myHelper.enlistBeforeCompletion(component);
-    }
-
-   /** Called a non-managed environment at the end of the
-    * Transaction.beforeCompletion() to de-register the component with
-    * the app server if necessary.
-    *
-    * @see EJBHelper#delistBeforeCompletion(Object im)
-    * @param im implementation-specific Object
-    */
-    public static void delistBeforeCompletion(Object im) {
-        if (myHelper != null) {
-            myHelper.delistBeforeCompletion(im);
-        }
-    }
-
-}
-
diff --git a/runtime20/src/java/org/apache/jdo/ejb/package.html b/runtime20/src/java/org/apache/jdo/ejb/package.html
deleted file mode 100644
index 5d303e0..0000000
--- a/runtime20/src/java/org/apache/jdo/ejb/package.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
- Copyright 2005 The Apache Software Foundation.
- 
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at 
- 
-     http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing, software 
- distributed under the License is distributed on an "AS IS" BASIS, 
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- See the License for the specific language governing permissions and 
- limitations under the License.
--->
-
-<html>
-<head>
-<title>Package org.apache.jdo.ejb</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
-</head>
-
-<body bgcolor="#FFFFFF">
-<p>This package contains classes and interfaces for EJB support.</p>
-</body>
-</html>
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/Bundle.properties b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/Bundle.properties
deleted file mode 100644
index 2ef9dea..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/Bundle.properties
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# Copyright 2005 The Apache Software Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at 
-# 
-#     http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software 
-# distributed under the License is distributed on an "AS IS" BASIS, 
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-# See the License for the specific language governing permissions and 
-# limitations under the License.
-
-#
-# RuntimeJavaModelFactory
-#
-
-EXC_CannotGetJDOImplHelper=A SecurityException was thrown when trying to get \
-the singleton JDOImplHelper instance. In order to get runtime metadata, you \
-must grant javax.jdo.spi.JDOPermission("getMetadata") to the codeBases \
-containing the JDO API and the JavaModel and JDOModel implementation.
-
-EXC_CannotGetRuntimeJavaModelFactory=A SecurityException was thrown when trying \
-to get the singleton RuntimeJavaModelFactory instance. In order to get runtime \
-metadata, you must grant javax.jdo.spi.JDOPermission("getMetadata") to the \
-codeBases containing the JDO API and the JavaModel and JDOModel implementation.
-
-#
-# RuntimeJavaModel
-#
-
-# {0} - class name
-# {1} - detailed message of the cause
-EXC_ClassLoadingError=Error during loading of class ''{0}'': {1}.
-
-# {0} - class name
-# {1} - class loader of class instance
-# {2} - class loader of JavaModel
-#NOI18N
-ERR_UnexpectedClassLoader=Unexpected class loader. The specified class \
-instance of class ''{0}'' was loaded by class loader ''{1}'', but the \
-JavaModel instance is bound to a different class loader ''{2}''.
-
-#
-# RuntimeJavaType
-#
-
-# {0} - error location (class.method)
-# {1} - implementation method name
-# {2} - field name
-#NOI18N
-ERR_MultipleJavaField={0}: multiple JavaField ''{1}'' for class ''{2}''.
-
-# {0} - class name
-# {1} - detailed message of the cause
-EXC_ClassLoadingError=Error during loading of class ''{0}'': {1}.
-
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RegisterClassListener.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RegisterClassListener.java
deleted file mode 100644
index 064b691..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RegisterClassListener.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import javax.jdo.spi.RegisterClassEvent;
-import javax.jdo.spi.JDOImplHelper;
-import javax.jdo.spi.PersistenceCapable;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jdo.model.ModelException;
-import org.apache.jdo.model.java.JavaField;
-import org.apache.jdo.model.java.JavaModel;
-import org.apache.jdo.model.java.JavaType;
-import org.apache.jdo.model.jdo.JDOClass;
-import org.apache.jdo.model.jdo.JDOField;
-import org.apache.jdo.model.jdo.JDOModel;
-import org.apache.jdo.model.jdo.PersistenceModifier;
-
-/**
- * The Model listener gets notified whenever a persistence-capable class gets 
- * registered with the JDOImplHelper at runtime.
- *
- * @author Michael Bouschen
- */
-public class RegisterClassListener
-    implements javax.jdo.spi.RegisterClassListener
-{
-    /** The corresponding JDOImplHelper instance. */
-    JDOImplHelper helper;
-
-    /** The JavaModel factory. */
-    RuntimeJavaModelFactory javaModelFactory;
-
-    /** Logger. */
-    private static Log logger =
-        LogFactory.getFactory().getInstance("org.apache.jdo.impl.model.jdo"); // NOI18N
-
-    /** 
-     * Constructor. 
-     * @param helper the JDOImplHelper instance.
-     * @param javaModelFactory the JavaModel factory.
-     */
-    public RegisterClassListener(JDOImplHelper helper, 
-                                 RuntimeJavaModelFactory javaModelFactory)
-    {
-        this.helper = helper;
-        this.javaModelFactory = javaModelFactory;
-    }
-
-    /**
-     * This method gets called when a persistence-capable class is registered.
-     * @param event a RegisterClassEvent instance describing the registered 
-     * class plus metatdata.
-     */
-    public void registerClass(RegisterClassEvent event)
-    {
-        if (logger.isDebugEnabled())
-            logger.debug("RegisterClassListener.registerClass " + //NOI18N
-                         event.getRegisteredClass());
-        try {
-            updateJDOClass(createJDOClass(event.getRegisteredClass()),
-                           event.getFieldNames(), 
-                           event.getFieldTypes(),
-                           event.getFieldFlags(),
-                           event.getPersistenceCapableSuperclass());
-        }
-        catch (ModelException ex) {
-            // ignore error message
-            logger.error("Problems updating JDOModel", ex); //NOI18N
-            System.out.println("caught " + ex); //NOI18N
-        }
-    }
-    
-    /** 
-     * Internal method to update the corresponding JDOClass instance with the 
-     * runtime meta data.
-     * @param pcClass the class object of the persistence-capable class
-     */
-    private JDOClass createJDOClass(Class pcClass)
-        throws ModelException
-    {
-        String pcClassName = pcClass.getName();
-        ClassLoader classLoader = 
-            javaModelFactory.getClassLoaderPrivileged(pcClass);
-        JavaModel javaModel = javaModelFactory.getJavaModel(classLoader);
-        JDOModel jdoModel = javaModel.getJDOModel();
-        // do not load XML here, this will be done on first request
-        JDOClass jdoClass = jdoModel.createJDOClass(pcClassName, false);
-        JavaType javaType = javaModel.getJavaType(pcClass);
-        jdoClass.setJavaType(javaType);
-        return jdoClass;
-    }
-
-    /** 
-     * Internal method to update the specified JDOClass instance with the 
-     * runtime meta data.
-     * @param jdoClass the jdoClass instance to be updated
-     * @param fieldNames the names of the managed fields
-     * @param fieldTypes the types of the managed fields
-     * @param fieldFlags the jdo field flags of the managed fields
-     * @param pcSuperclass the class object of the persistence-capable 
-     * superclass
-     */
-    private void updateJDOClass(JDOClass jdoClass,
-                                String[] fieldNames, 
-                                Class[] fieldTypes,
-                                byte[] fieldFlags,
-                                Class pcSuperclass)
-        throws ModelException
-    {
-        // handle superclass
-        if (pcSuperclass != null) {
-            ClassLoader classLoader = 
-                javaModelFactory.getClassLoaderPrivileged(pcSuperclass);
-            JavaModel superJavaModel = 
-                javaModelFactory.getJavaModel(classLoader);
-            JDOModel superJDOModel = superJavaModel.getJDOModel();
-            // do not load XML => last arg should be false
-            JDOClass superJDOClass = 
-                superJDOModel.getJDOClass(pcSuperclass.getName(), false);
-            jdoClass.setPersistenceCapableSuperclass(superJDOClass);
-        }
-        
-        // Iterate the field names and set the corresponding field type
-        RuntimeJavaType declaringClass = (RuntimeJavaType)jdoClass.getJavaType();
-        for (int i = 0; i < fieldNames.length; i++) {
-            JDOField jdoField = jdoClass.createJDOField(fieldNames[i]);
-            updateJDOField(jdoField, fieldTypes[i], fieldFlags[i],
-                           declaringClass);
-        }
-    }
-
-    /** 
-     * Internal method to update the specified JDOField instance with the 
-     * runtime meta data.
-     * @param jdoField the jdoField instance to be updated
-     * @param fieldType the type of the field
-     * @param fieldFlags the jdo field flags
-     */
-    private void updateJDOField(JDOField jdoField,
-                                Class fieldType,
-                                byte fieldFlags,
-                                RuntimeJavaType declaringClass)
-        throws ModelException
-    {
-        // handle JavaField
-        JavaField javaField = declaringClass.createJavaField(jdoField.getName(),
-            javaModelFactory.getJavaType(fieldType));
-        jdoField.setJavaField(javaField);
-        
-        // handle field flags
-        jdoField.setSerializable(
-            (fieldFlags & PersistenceCapable.SERIALIZABLE) > 0);
-    }
-}
-
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaModel.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaModel.java
deleted file mode 100644
index d1512ca..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaModel.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime;
-
-import org.apache.jdo.impl.model.java.PredefinedType; // for javadoc
-import org.apache.jdo.impl.model.java.reflection.ReflectionJavaModel;
-import org.apache.jdo.model.ModelFatalException;
-import org.apache.jdo.model.java.JavaType;
-import org.apache.jdo.util.I18NHelper;
-
-/**
- * A reflection based JavaModel implementation used at runtime.  
- * The implementation takes <code>java.lang.Class</code> and
- * <code>java.lang.reflect.Field</code> instances to get Java related
- * metadata about types and fields. 
- * <p>
- * The RuntimeJavaModelFactory caches JavaModel instances per ClassLoader.
- * The RuntimeJavaModel implementation will use this ClassLoader to lookup
- * any type by name. This makes sure that the type name is unique.
- * <p>
- * Any JavaType instance bound to a RuntimeJavaModel instance wraps a class
- * instance that is loaded by the ClassLoader that corresponds to this
- * RuntimeJavaModel. The only exception are PredefinedType instances 
- * (see {@link PredefinedType.getPredefinedTypes()} which are present in every
- * RuntimeJavaModel instance.
- *
- * @since 1.0.1
- * @version 2.0
- */
-public class RuntimeJavaModel
-    extends ReflectionJavaModel
-{
-    /** I18N support */
-    private final static I18NHelper msg =  
-        I18NHelper.getInstance("org.apache.jdo.impl.model.java.runtime.Bundle"); //NOI18N
-
-    /** Constructor. */
-    public RuntimeJavaModel(ClassLoader classLoader, 
-                            RuntimeJavaModelFactory declaringJavaModelFactory) 
-    {
-        super(classLoader, declaringJavaModelFactory);
-    }
-
-    /** 
-     * The method returns the JavaType instance for the specified type
-     * name. A type name is unique within one JavaModel instance. The
-     * method returns <code>null</code> if this model instance does not
-     * know a type with the specified name.
-     * <p>
-     * Note, this method calls Class.forName with the wrapped ClassLoader,
-     * if it cannot find a JavaType with the specified name in the cache.
-     * @param name the name of the type
-     * @return a JavaType instance for the specified name or
-     * <code>null</code> if not present in this model instance.
-     */
-    public JavaType getJavaType(String name) 
-    {
-        synchronized (types) {
-            JavaType javaType = (JavaType)types.get(name);
-            if (javaType == null) {
-                try {
-                    // Note, if name denotes a pc class that has not been
-                    // loaded, Class.forName will load the class which will
-                    // register the runtime metadata at the JDOImplHelper.
-                    // This will create a new JavaType entry in the cache.
-                    final boolean initialize = true; 
-                    Class clazz = RuntimeJavaModelFactory.forNamePrivileged(
-                        name, initialize, getClassLoader());
-                    // Get the class loader of the Class instance
-                    ClassLoader loader = RuntimeJavaModelFactory.
-                        getClassLoaderPrivileged(clazz);
-                    // and get the JavaModel instance for the class loader. 
-                    RuntimeJavaModel javaModel = (RuntimeJavaModel)
-                        declaringJavaModelFactory.getJavaModel(loader);
-                    // Delegate the JavaType lookup to the JavaModel instance.
-                    javaType = javaModel.getJavaTypeInternal(clazz);
-                }
-                catch (ClassNotFoundException ex) {
-                    // cannot find class => return null
-                }
-                catch (LinkageError ex) {
-                    throw new ModelFatalException(msg.msg(
-                        "EXC_ClassLoadingError", name, ex.toString())); //NOI18N
-                }
-            }
-            return javaType;
-        }
-    }
-
-    /** 
-     * The method returns the JavaType instance for the type name of the
-     * specified class object. This is a convenience method for 
-     * <code>getJavaType(clazz.getName())</code>. The major difference
-     * between this method and getJavaType taking a type name is that this 
-     * method is supposed to return a non-<code>null<code> value. The
-     * specified class object describes an existing type.
-     * <p>
-     * Note, this implementation does not call the overloaded getJavaType
-     * method taking a String, because this would retrieve the Class
-     * instance for the specified type again. Instead, it checks the cache 
-     * directly. If not available it creates a new ReflectionJavaType using
-     * the specified Class instance.
-     * @param clazz the Class instance representing the type
-     * @return a JavaType instance for the name of the specified class
-     * object or <code>null</code> if not present in this model instance.
-     */
-    public JavaType getJavaType(Class clazz)
-    {
-        if (clazz == null)
-            return null;
-        
-        String name = clazz.getName();
-        synchronized (types) {
-            JavaType javaType = (JavaType)types.get(name);
-            if (javaType == null) {
-                // Check whether the specified class object is loaded by the
-                // class loader bound to this JavaModel. Note, we never
-                // execute this check for any PredefinedType instance, because
-                // the cache lookup will always find a JavaType (the cache is
-                // initialized with all PredefinedTypes). The check would
-                // potentially fail for a PredefinedType, because it might be
-                // loaded by a different class loader.
-                ClassLoader loader = 
-                    RuntimeJavaModelFactory.getClassLoaderPrivileged(clazz);
-                if (loader != getClassLoader()) {
-                    throw new ModelFatalException(msg.msg(
-                        "ERR_UnexpectedClassLoader", //NOI18N
-                        clazz.getName(), loader, getClassLoader()));
-                }
-                try {
-                    // Make sure the class is initialized, because this will
-                    // register the runtime metadata at the JDOImplHelper. 
-                    final boolean initialize = true; 
-                    RuntimeJavaModelFactory.forNamePrivileged(
-                        clazz.getName(), initialize, loader);
-                }
-                catch (ClassNotFoundException ex) {
-                    // ignore, since class has already been loaded 
-                }
-                javaType = getJavaTypeInternal(clazz);
-            }
-            return javaType;
-        }
-    }
-
-    /** 
-     * Creates a new instance of the JavaType implementation class.
-     * <p>
-     * This implementation returns a RuntimeJavaType instance.
-     * @param clazz the Class instance representing the type
-     * @return a new JavaType instance
-     */
-    protected JavaType newJavaTypeInstance(Class clazz)
-    {
-        return new RuntimeJavaType(clazz, this);
-    }
-    
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaModelFactory.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaModelFactory.java
deleted file mode 100644
index 538fa22..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaModelFactory.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import javax.jdo.spi.JDOImplHelper;
-import javax.jdo.spi.JDOPermission;
-
-import org.apache.jdo.model.ModelFatalException;
-import org.apache.jdo.model.java.JavaModel;
-import org.apache.jdo.model.java.JavaModelFactory;
-import org.apache.jdo.impl.model.java.reflection.ReflectionJavaModelFactory;
-import org.apache.jdo.util.I18NHelper;
-
-/**
- * A reflection based JavaModelFactory implementation used at runtime. 
- * The implementation takes <code>java.lang.Class</code> and
- * <code>java.lang.reflect.Field</code> instances to get Java related
- * metadata about types and fields. This implementation caches JavaModel
- * instance sper ClassLoader.
- * <p>
- * RuntimeJavaModelFactory implements the singleton pattern; method 
- * {@link #getInstance()} provides access to the singleton factory
- * instance. This method also registers a model listener at the
- * JDOImplHelper to handle the runtime metadata as generated by the
- * enhancer. 
- * 
- * @since 1.0.1
- * @version 2.0
- */
-public class RuntimeJavaModelFactory
-    extends ReflectionJavaModelFactory
-{    
-    /** The singleton RuntimeJavaModelFactory instance. */    
-    private static final RuntimeJavaModelFactory runtimeJavaModelFactory = 
-        new RuntimeJavaModelFactory();
-
-    /** I18N support */
-    private final static I18NHelper msg =  
-        I18NHelper.getInstance(RuntimeJavaModelFactory.class);
-
-    /**
-     * Creates a new RuntimeJavaModelFactory. This constructor should not
-     * be called directly; instead, the singleton access method 
-     * {@link #getInstance()} should be used.
-     */
-    protected RuntimeJavaModelFactory()
-    {
-        registerFactory();
-    }
-    
-    /** 
-     * Returns the singleton instance of RuntimeJavaModelFactory. On first
-     * call it registers  a model listener at the JDOImplHelper.
-     * This method checks that the caller is authorized for 
-     * <code>JDOPermission("getMetadata")</code>, and if not, throws
-     * <code>ModelFatalException</code> wrapping the SecurityException.
-     * @return RuntimeJavaModelFactory instance
-     * @exception ModelFatalException if the caller does not have the
-     * getMetadata permission.
-     */    
-    public static RuntimeJavaModelFactory getInstance()
-        throws ModelFatalException
-    {
-        checkPermission();
-        return runtimeJavaModelFactory;
-    }
-
-    //========= Internal helper methods ==========
-
-    /**
-     * This method checks that the caller is authorized for
-     * <code>JDOPermission("getMetadata")</code>, and if not, throws 
-     * <code>ModelFatalException</code> wrapping the SecurityException.
-     * @throws ModelFatalException if the caller does not have the
-     * getMetadata permission.
-     */
-    protected static void checkPermission()
-        throws ModelFatalException
-    {
-        // check whether caller has the getMetadata permission
-        SecurityManager sec = System.getSecurityManager();
-        if (sec != null) { 
-            try {
-                // throws exception if caller is not authorized
-                sec.checkPermission(JDOPermission.GET_METADATA);
-            }
-            catch (SecurityException ex) {
-                throw new ModelFatalException(
-                    msg.msg("EXC_CannotGetRuntimeJavaModelFactory"), ex); // NOI18N
-            }
-        }
-    }
-    
-    /** 
-     * Registers this JavaModelFactory instance at the JDOImplHelper. 
-     */
-    protected void registerFactory()
-    {
-        // initialize RuntimeJavaModelFactory singleton instance
-        try {
-            JDOImplHelper helper = 
-                (JDOImplHelper) AccessController.doPrivileged(
-                    new PrivilegedAction () {
-                        public Object run () {
-                            return JDOImplHelper.getInstance();
-                        }
-                    }
-                    );
-            // register listener to JDOImplHelpers class registration
-            RegisterClassListener crl = new RegisterClassListener(
-                helper, this);
-            helper.addRegisterClassListener(crl);
-        }
-        catch (SecurityException ex) {
-            throw new ModelFatalException(
-                msg.msg("EXC_CannotGetJDOImplHelper"), ex); // NOI18N
-        }
-    }
-
-    /** 
-     * Creates a new instance of the JavaModel implementation class.
-     * <p>
-     * This implementation returns a <code>RuntimeJavaModel</code> instance.
-     * @return a new JavaModel instance.
-     */
-    protected JavaModel newJavaModelInstance(ClassLoader classLoader) {
-        return new RuntimeJavaModel(classLoader, this);
-    }
-
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaType.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaType.java
deleted file mode 100644
index efdc70e..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/RuntimeJavaType.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime;
-
-import org.apache.jdo.impl.model.java.reflection.ReflectionJavaType;
-import org.apache.jdo.model.ModelFatalException;
-import org.apache.jdo.model.java.JavaField;
-import org.apache.jdo.model.java.JavaModel;
-import org.apache.jdo.model.java.JavaType;
-import org.apache.jdo.util.I18NHelper;
-
-/**
- * A reflection based JavaType implementation used at runtime.  
- * The implementation takes <code>java.lang.Class</code> and
- * <code>java.lang.reflect.Field</code> instances to get Java related
- * metadata about types and fields. 
- *
- * @author Michael Bouschen
- * @since JDO 1.0.1
- * @version JDO 2.0
- */
-public class RuntimeJavaType
-    extends ReflectionJavaType
-{
-    /** I18N support */
-    private final static I18NHelper msg =  
-        I18NHelper.getInstance(RuntimeJavaType.class);
-
-    /** Constructor. */
-    public RuntimeJavaType(Class clazz, RuntimeJavaModel javaModel)
-    {
-        super(clazz, javaModel);
-    }
-
-    // ===== Methods not specified in JavaType =====
-
-    /**
-     * RegisterClassListener calls this method to create a ReflectionJavaField
-     * instance when processing the enhancer generated metadata.
-     * @param name the name of the field
-     * @param type the type of the field
-     * @return the ReflectionJavaField representation
-     */
-    public synchronized JavaField createJavaField(String name, JavaType type)
-    {
-        JavaField javaField = (JavaField)declaredJavaFields.get(name);
-        if (javaField != null) {
-            throw new ModelFatalException(msg.msg(
-                "ERR_MultipleJavaField", //NOI18N
-                "RuntimeJavaType.createJavaField", name, getName())); //NOI18N
-        }
-        javaField = newJavaFieldInstance(name, type);
-        declaredJavaFields.put(name, javaField);
-        return javaField;
-    }
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/ComponentTypeHelper.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/ComponentTypeHelper.java
deleted file mode 100644
index 084d8bd..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/ComponentTypeHelper.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime.jdk5;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.lang.reflect.ParameterizedType;
-
-import org.apache.jdo.impl.model.java.PredefinedType;
-import org.apache.jdo.model.java.JavaField;
-import org.apache.jdo.model.java.JavaMethod;
-import org.apache.jdo.model.java.JavaProperty;
-import org.apache.jdo.model.java.JavaType;
-
-/** 
- * Helper class to calculate the component type of he type of a field, method
- * or property in a J2SE5.0 environment. 
-*/
-public class ComponentTypeHelper
-{
-    /**
-     * Returns the Class instance representing the component type of the
-     * type of the specified field.
-     */
-    public static Class getComponentClass(JavaField javaField)
-    {
-        JavaType type = javaField.getType();
-        Field field = (Field) javaField.getUnderlyingObject();
-        return getComponentClass(type, field.getGenericType());
-    }
-
-    /**
-     * Returns the Class instance representing the component type of the
-     * return type of the specified method.
-     */
-    public static Class getComponentClass(JavaMethod javaMethod)
-    {
-        JavaType type = javaMethod.getReturnType();
-        if (type == PredefinedType.voidType)
-            // return null for void method
-            return null;
-        Method method = (Method) javaMethod.getUnderlyingObject();
-        return getComponentClass(type, method.getGenericReturnType());
-    }
-
-    /**
-     * Returns the Class instance representing the component type of the
-     * type of the specified property.
-     */
-    public static Class getComponentClass(JavaProperty javaProperty)
-    {
-        Class componentClass = null;
-        JavaMethod getter = javaProperty.getGetterMethod();
-        JavaMethod setter = javaProperty.getSetterMethod();
-        if (getter != null)
-            componentClass = getComponentClass(getter);
-        else if (setter != null) {
-            JavaType[] paramJavaTypes = setter.getParameterTypes();
-            assert(paramJavaTypes.length == 1);
-            Method method = (Method) setter.getUnderlyingObject();
-            Type[] genericParamTypes = method.getGenericParameterTypes();
-            assert(genericParamTypes.length == 1);
-            componentClass = 
-                getComponentClass(paramJavaTypes[0], genericParamTypes[0]);
-        }
-        return componentClass;
-    }
-
-    // ===== Internal helper methods =====
-
-    /** Helper method. */
-    private static Class getComponentClass(JavaType type, Type genericType)
-    {
-        Class componentClass = null;
-        if (type.isArray()) {
-            Class clazz = (Class) type.getUnderlyingObject();
-            componentClass = clazz.getComponentType(); 
-        }
-        else if (type.isJDOSupportedCollection()) {
-            if (genericType instanceof ParameterizedType) {
-                ParameterizedType pt = (ParameterizedType) genericType;
-                Type[] actualTypeArgs = pt.getActualTypeArguments();
-                assert(actualTypeArgs.length == 1);
-                assert(actualTypeArgs[0] instanceof Class);
-                componentClass = (Class) actualTypeArgs[0];
-            }
-        }
-        return componentClass;
-    }
-    
-    
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaField.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaField.java
deleted file mode 100644
index b0edef1..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaField.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime.jdk5;
-
-import java.lang.reflect.Field;
-
-import org.apache.jdo.impl.model.java.reflection.ReflectionJavaField;
-import org.apache.jdo.model.java.JavaType;
-
-/**
- * A reflection based JavaField implementation used at runtime in a
- * J2SE5.0 environment. 
- *
- * @author Michael Bouschen
- */
-public class JDK5RuntimeJavaField 
-        extends ReflectionJavaField
-{
-    /** 
-     * Constructor for fields w/o JDO metadata. 
-     * @param field the reflection field representation.
-     * @param declaringClass the JavaType of the class that declares the field.
-     */
-    public JDK5RuntimeJavaField(Field field, JavaType declaringClass)
-    {
-        super(field, declaringClass);
-    }
-        
-    /** 
-     * Constructor for fields having JDO metadata.
-     * @param name the name of the field.
-     * @param type the field type.
-     * @param declaringClass the JavaType of the class that declares the field.
-     */
-    public JDK5RuntimeJavaField(String name, JavaType type,
-            JavaType declaringClass)
-    {
-        super(name, type, declaringClass);
-    }
-    
-    // ===== methods specified in JavaMember =====
-    
-     /**
-     * Returns the JavaType representation of the component type of the type
-     * of the property, if the property type is an array or collection. The
-     * method returns <code>null</code>, if the property type is not an array
-     * or collection.
-     * @return the component type of the property type in case of an array or
-     * collection.
-     */
-    public JavaType getComponentType() 
-    {
-        Class componentClass = ComponentTypeHelper.getComponentClass(this);
-        return (componentClass == null) ? null : 
-            getJavaTypeForClass(componentClass);
-    }
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaMethod.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaMethod.java
deleted file mode 100644
index 3048bda..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaMethod.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime.jdk5;
-
-import org.apache.jdo.impl.model.java.reflection.ReflectionJavaMethod;
-import java.lang.reflect.Method;
-import org.apache.jdo.model.java.JavaType;
-
-/**
- * A reflection based JavaMethod implementation used at runtime in a
- * J2SE5.0 environment. 
- *
- * @author Michael Bouschen
- */
-public class JDK5RuntimeJavaMethod 
-        extends ReflectionJavaMethod
-{
-    /** 
-     * Constructor.
-     * @param method the reflection method representation.
-     * @param declaringClass the JavaType of the class that declares the
-     * method. 
-     */
-    public JDK5RuntimeJavaMethod(Method method, JavaType declaringClass)
-    {
-        super(method, declaringClass);
-    }
-        
-    // ===== methods specified in JavaMember =====
-    
-     /**
-     * Returns the JavaType representation of the component type of the return
-     * type of the method, if the method return type is an array or
-     * collection. The method returns <code>null</code>, if the property type
-     * is not an array or collection.
-     * @return the component type of the method return type in case of an
-     * array or collection. 
-     */
-    public JavaType getComponentType() 
-    {
-        Class componentClass = ComponentTypeHelper.getComponentClass(this);
-        return (componentClass == null) ? null : 
-            getJavaTypeForClass(componentClass);
-   }
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaModel.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaModel.java
deleted file mode 100644
index 9d18e27..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaModel.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime.jdk5;
-
-import org.apache.jdo.model.java.JavaType;
-import org.apache.jdo.impl.model.java.runtime.*;
-
-/**
- * A reflection based JavaModel implementation used at runtime in a J2SE5.0
- * environment. 
- * The implementation takes <code>java.lang.Class</code> and
- * <code>java.lang.reflect.Field</code> instances to get Java related
- * metadata about types and fields. 
- * <p>
- * The RuntimeJavaModelFactory caches JavaModel instances per ClassLoader.
- * The RuntimeJavaModel implementation will use this ClassLoader to lookup
- * any type by name. This makes sure that the type name is unique.
- *
- * @author Michael Bouschen
- * @since JDO 2.0
- */
-public class JDK5RuntimeJavaModel
-    extends RuntimeJavaModel
-{
-    /** Constructor. */
-    public JDK5RuntimeJavaModel(ClassLoader classLoader, 
-        JDK5RuntimeJavaModelFactory declaringJavaModelFactory) 
-    {
-        super(classLoader, declaringJavaModelFactory);
-    }
-    
-    /** 
-     * Creates a new instance of the JavaType implementation class.
-     * <p>
-     * This implementation returns a RuntimeJavaType instance.
-     * @param clazz the Class instance representing the type
-     * @return a new JavaType instance
-     */
-    protected JavaType newJavaTypeInstance(Class clazz)
-    {
-        return new JDK5RuntimeJavaType(clazz, this);
-    }
-    
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaModelFactory.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaModelFactory.java
deleted file mode 100644
index 9867543..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaModelFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime.jdk5;
-import org.apache.jdo.model.ModelFatalException;
-import org.apache.jdo.model.java.JavaModel;
-import org.apache.jdo.util.I18NHelper;
-import javax.jdo.spi.JDOPermission;
-import org.apache.jdo.impl.model.java.runtime.*;
-
-/**
- * A reflection based JavaModelFactory implementation used at runtime in a
- * J2SE5.0 environment. 
- * The implementation takes <code>java.lang.Class</code> and
- * <code>java.lang.reflect.Field</code> instances to get Java related
- * metadata about types and fields. This implementation caches JavaModel
- * instances per ClassLoader.
- * <p>
- * JDK5RuntimeJavaModelFactory implements the singleton pattern; method 
- * {@link #getInstance()} provides access to the singleton factory
- * instance. This method also registers a model listener at the
- * JDOImplHelper to handle the runtime metadata as generated by the
- * enhancer. 
- * 
- * @author Michael Bouschen
- * @since JDO 2.0
- */
-public class JDK5RuntimeJavaModelFactory
-    extends RuntimeJavaModelFactory
-{    
-    /** The singleton JDK5RuntimeJavaModelFactory instance. */    
-    private static final JDK5RuntimeJavaModelFactory runtimeJavaModelFactory = 
-        new JDK5RuntimeJavaModelFactory();
-
-    /** I18N support */
-    private final static I18NHelper msg =  
-        I18NHelper.getInstance(JDK5RuntimeJavaModelFactory.class); 
-
-    /**
-     * Creates a new RuntimeJavaModelFactory. This constructor should not
-     * be called directly; instead, the singleton access method 
-     * {@link #getInstance()} should be used.
-     */
-    protected JDK5RuntimeJavaModelFactory() {}
-
-    /** 
-     * Returns the singleton instance of JDK5RuntimeJavaModelFactory. On first
-     * call it registers  a model listener at the JDOImplHelper.
-     * This method checks that the caller is authorized for 
-     * <code>JDOPermission("getMetadata")</code>, and if not, throws
-     * <code>ModelFatalException</code> wrapping the SecurityException.
-     * @return RuntimeJavaModelFactory instance
-     * @exception ModelFatalException if the caller does not have the
-     * getMetadata permission.
-     */    
-    public static JDK5RuntimeJavaModelFactory getInstance()
-        throws ModelFatalException
-    {
-        checkPermission();
-        return runtimeJavaModelFactory;
-    }
-    
-    //========= Internal helper methods ==========
-
-    /** 
-     * Creates a new instance of the JavaModel implementation class.
-     * <p>
-     * This implementation returns a <code>JDK5RuntimeJavaModel</code> instance.
-     * @return a new JavaModel instance.
-     */
-    protected JavaModel newJavaModelInstance(ClassLoader classLoader) {
-        return new JDK5RuntimeJavaModel(classLoader, this);
-    }
-    
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaProperty.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaProperty.java
deleted file mode 100644
index bab8907..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaProperty.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime.jdk5;
-
-import org.apache.jdo.impl.model.java.JavaPropertyImpl;
-import org.apache.jdo.model.java.JavaMethod;
-import org.apache.jdo.model.java.JavaType;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import org.apache.jdo.impl.model.java.runtime.*;
-
-/**
- * Default implementation for the JavaProperty interfaces. A JavaProperty
- * represents a JavaBeans property.
- *
- * @author Michael Bouschen
- */
-public class JDK5RuntimeJavaProperty 
-        extends JavaPropertyImpl
-{
-    /** */
-    public JDK5RuntimeJavaProperty(String name, 
-        JavaMethod getter, JavaMethod setter,
-        JavaType type, JavaType declaringClass)
-    {
-        super(name, getter, setter, type, declaringClass);
-    }
- 
-    // ===== methods specified in JavaMember =====
-    
-    /**
-     * Returns the JavaType representation of the component type of the type
-     * of the property, if the property type is an array or collection. The
-     * method returns <code>null</code>, if the property type is not an array
-     * or collection.
-     * @return the component type of the property type in case of an array or
-     * collection.
-     */
-    public JavaType getComponentType() 
-    {
-        Class componentClass = ComponentTypeHelper.getComponentClass(this);
-        return (componentClass == null) ? null : 
-            getJavaTypeForClass(componentClass);
-    }
-    
-    // ===== Methods not specified in JavaProperty =====
-    
-    /** 
-     * Returns a JavaType instance for the specified Class object. 
-     * This method provides a hook such that ReflectionJavaField subclasses can
-     * implement their own mapping of Class objects to JavaType instances. 
-     */
-    public JavaType getJavaTypeForClass(Class clazz)
-    {
-        return ((JDK5RuntimeJavaType) getDeclaringClass()).
-                getJavaTypeForClass(clazz);
-    }
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaType.java b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaType.java
deleted file mode 100644
index 78b2e61..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/jdk5/JDK5RuntimeJavaType.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.java.runtime.jdk5;
-
-import org.apache.jdo.model.java.JavaField;
-import org.apache.jdo.model.java.JavaMethod;
-import org.apache.jdo.model.java.JavaProperty;
-import org.apache.jdo.model.java.JavaType;
-
-import java.lang.reflect.Field;
-import org.apache.jdo.impl.model.java.runtime.*;
-
-/**
-/**
- * A reflection based JavaType implementation used at runtime in a
- * J2SE5.0 environment.  
- * The implementation takes <code>java.lang.Class</code> and
- * <code>java.lang.reflect.Field</code> instances to get Java related
- * metadata about types and fields. 
- *
- * @author Michael Bouschen
- */
-public class JDK5RuntimeJavaType
-    extends RuntimeJavaType
-{
-    /** Constructor. */
-    public JDK5RuntimeJavaType(Class clazz, JDK5RuntimeJavaModel javaModel)
-    {
-        super(clazz, javaModel);
-    }
-
-   /**
-     * Creates a new instance of the JavaField implementation class.
-     * <p>
-     * This implementation returns a <code>JDK5RuntimeJavaField</code>
-     * instance.
-     * @return a new JavaField instance.
-     */
-    protected JavaField newJavaFieldInstance(String name, JavaType type) 
-    {
-        return new JDK5RuntimeJavaField(name, type, this);
-    }
-    
-    /**
-     * Creates a new instance of the JavaField implementation class.
-     * <p>
-     * This implementation returns a <code>ReflectionJavaField</code>
-     * instance.
-     * @return a new JavaField instance.
-     */
-
-    protected JavaField newJavaFieldInstance(Field field) 
-    {
-        return new JDK5RuntimeJavaField(field, this);
-    }
-    
-    /**
-     * Creates a new instance of the JavaProperty implementation class.
-     * <p>
-     * This implementation returns a <code>JavaPropertyImpl</code>
-     * instance.
-     * @return a new JavaProperty instance.
-     */
-    protected JavaProperty newJavaPropertyInstance(String name, 
-            JavaMethod getter, JavaMethod setter, JavaType type) 
-    {
-        return new JDK5RuntimeJavaProperty(name, getter, setter, type, this);
-    }
-    
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/package.html b/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/package.html
deleted file mode 100644
index 0fe21aa..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/java/runtime/package.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- Copyright 2005 The Apache Software Foundation.
- 
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at 
- 
-     http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing, software 
- distributed under the License is distributed on an "AS IS" BASIS, 
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- See the License for the specific language governing permissions and 
- limitations under the License.
--->
-
-<html>
-<head>
-<title>Runtime JavaModel implementation package.</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-</head>
-
-<body bgcolor="#FFFFFF">
-<p>This package contains a runtime specific JavaModel implementation 
-based on reflection.
-</body>
-</html>
diff --git a/runtime20/src/java/org/apache/jdo/impl/model/jdo/xml/XMLExists.java b/runtime20/src/java/org/apache/jdo/impl/model/jdo/xml/XMLExists.java
deleted file mode 100644
index 4a37f2d..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/model/jdo/xml/XMLExists.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-package org.apache.jdo.impl.model.jdo.xml;
-
-import java.util.*;
-
-import org.apache.jdo.impl.model.java.reflection.ReflectionJavaModelFactory;
-import org.apache.jdo.impl.model.jdo.util.PrintSupport;
-import org.apache.jdo.model.java.JavaModel;
-import org.apache.jdo.model.java.JavaModelFactory;
-import org.apache.jdo.model.jdo.JDOClass;
-import org.apache.jdo.model.jdo.JDOModel;
-
-/**
- * This class allows to check whether there is JDO metadata for a class with 
- * a given class name. There must be a class file (enhanced or not enhanced)
- * available in the classpath of the caller.
- * <p>
- * Usage: XMLExists &lt;options&gt; &lt;arguments&gt;...
- * <br>
- * Options:
- * <br>
- * <code>&nbsp;&nbsp;-h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>
- * print usage message
- * <br>
- * <code>&nbsp;&nbsp;-v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>
- * print verbose messages and JDO metadata
- * <br>
- * <code>&nbsp;&nbsp;-q&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code>
- * do not print any output; just set the exit code
- * <br>
- * <code>&nbsp;&nbsp;-xml&nbsp;&nbsp;&nbsp;&nbsp;</code>
- * expected to find JDO XML metadata for the specified class(es)
- * <br>
- * <code>&nbsp;&nbsp;-noxml&nbsp;&nbsp;</code>
- * expected to find no JDO XML metadata for the specified class(es)
- * <br>
- * Arguments:
- * <br>
- * <code>&nbsp;&nbsp;&lt;classname&gt;&nbsp;</code>
- * the fully qualified name of a class to be checked
- * <p>
- * The following sample call checks whether there is JDO XML metadata for the 
- * classes Emplyoe and Department from the com.xyz.hr package and dumps the 
- * JDOClass instances:
- * <br>
- * <code>&nbsp;&nbsp;java org.apache.jdo.impl.model.jdo.util.XMLExists -v 
- * com.xyz.hr.Employee com.xyz.hr.Department</code>
- * <p>
- * Method main will exit the JVM with an exit code 1 if the test fails for 
- * at least one class. Please note, the class dumps the JDOClass if the 
- * outputLevel is set to VERBOSE (e.g. by setting the -v option). This JDOClass 
- * info does NOT include runtime metadata, even if the class file is enhanced.
- * 
- * @author Michael Bouschen
- */
-public class XMLExists
-{
-    /** 
-     * Flag indicating whether the classes to be checked is expected to have 
-     * JDO XML metadata or not.
-     */
-    private boolean xmlExpected;
-    
-    /** Print verbose messages. */
-    public static final int VERBOSE = 1;
-
-    /** Normal output. */
-    public static final int NORMAL = 0;
-
-    /** No messages, just set the exit code. */
-    public static final int QUIET = -1;
-       
-    /** Output level.*/
-    private int outputLevel = NORMAL;
-
-    /** 
-     * The main method checks all classes specified as argument.
-     * It will exit the JVM with an exit code 1 if the test fails for 
-     * at least one class. 
-     * @param args arguments which are options followed by class names.
-     */
-    public static void main(String[] args)
-    {
-        final XMLExists test = new XMLExists();
-        final List classNames = test.processArgs(args);
-        if (!test.run(classNames))
-            System.exit(1);
-    }
-
-    /** 
-     * No arg constructor. The flags default to
-     * <ul>
-     * <li> <code>xmlExpected == true</code>
-     * <li> <code>outputLevel == NORMAL</code>
-     * </ul>
-     */
-    public XMLExists()
-    {
-        this(true, NORMAL);
-    }
-
-    /** Constructor taking checkXMLExists and outputLevel. */
-    public XMLExists(boolean xmlExpected, int outputLevel)
-    {
-        this.xmlExpected = xmlExpected;
-        this.outputLevel = outputLevel;
-    }
-
-    /**
-     * This method checks all classes from the specified list of class names.
-     * It uses the current classLoader to load the classes. The method returns 
-     * <code>false</code> if there is at least one class that fails on checking.
-     * @param classNames list of classes to be checked
-     * @return <code>true</code> if all classes are ok;
-     * <code>false</code> otherwise.
-     */
-    public boolean run(List classNames)
-    {
-        ClassLoader classLoader = getClass().getClassLoader();
-        JavaModelFactory factory = new JavaModelFactoryImpl();
-        JavaModel javaModel = factory.getJavaModel(classLoader);
-        JDOModel jdoModel = javaModel.getJDOModel();
-        boolean ok = true;
-        for (Iterator i = classNames.iterator(); i.hasNext(); ) {
-            final String className = (String)i.next();
-            try {
-                checkClass(className, classLoader, jdoModel, xmlExpected);
-                if ((outputLevel == NORMAL) && xmlExpected)
-                    System.out.println(
-                        "Found XML metadata for class " + className); //NOI18N
-                                       
-                else if ((outputLevel == NORMAL) && !xmlExpected)
-                    System.out.println(
-                        "No MXL metadata for class " + className); //NOI18N
-            }
-            catch (Exception ex) {
-                if (outputLevel > QUIET) {
-                    System.err.println(ex);
-                    ex.printStackTrace();
-                }
-                ok = false;
-            }
-        }
-        return ok;
-    }
-    
-    /** 
-     * The method checks the class with the specified class name.
-     * It first loads the class using the specified class loader.
-     * If the flag xmlExpected is <code>true</code> it expects to get a non-null
-     * JDOClass instance. If the flag xmlExpected is <code>false</code> it 
-     * expects to get a null JDOClass instance. 
-     * <p>
-     * The method indicates any failure by throwing an exception. 
-     * It dumps the JDOClass if the output level is VERBOSE.
-     * @param className the name of the class to be checked
-     * @param classLoader the class loader to be used to load the class
-     * @param jdoModel JDOModel for type info
-     * @param xmlExpected flag whether the class to be checked is expected to 
-     * have JDO XML metadata or not.
-     */
-    public void checkClass(String className, 
-                           ClassLoader classLoader,
-                           JDOModel jdoModel, 
-                           boolean xmlExpected)
-        throws Exception
-    {
-        Class clazz = Class.forName(className, true, classLoader);
-        if (outputLevel == VERBOSE)
-            System.out.println("Found " + clazz); //NOI18N
-        JDOClass jdoClass = jdoModel.getJDOClass(className);
-        if (xmlExpected && (jdoClass == null)) {
-            throw new Exception(
-                "Missing JDO XML metadata for class " + //NOI18N
-                className);
-        }
-        if (!xmlExpected && (jdoClass != null)) {
-            throw new Exception(
-                "Found JDO XML metadata for class " + className); //NOI18N
-        }
-        if ((outputLevel == VERBOSE) && (jdoClass != null)) {
-            PrintSupport.printJDOClass(jdoClass);
-        }
-    }
-    
-    // ==== Comand line processing helper method =====
-    
-    /**
-     * Helper method to do command line argument processing.
-     * @param args the arguments passed to main.
-     * @return the list of classes to be checked.
-     */
-    protected List processArgs(String[] args)
-    { 
-        List classNames = new ArrayList();
-        for (int i = 0; i < args.length; i++) {
-            final String arg = args[i];
-            if (arg.equals("-h")) { //NOI18N
-                usage();
-            }
-            else if (arg.equals("-v")) { //NOI18N
-                outputLevel = VERBOSE;
-            }
-            else if (arg.equals("-q")) { //NOI18N
-                outputLevel = QUIET;
-            }
-            else if (arg.equals("-xml")) { //NOI18N
-                xmlExpected = true;
-            }
-            else if (arg.equals("-noxml")) { //NOI18N
-                xmlExpected = false;
-            }
-            else if (arg.length() > 0 && arg.charAt(0) == '-') {
-                System.err.println("Unrecognized option:" + arg); //NOI18N
-                usage();
-            }
-            else if (arg.length() == 0) {
-                System.err.println("Ignoring empty command line argument."); //NOI18N
-            }
-            else {
-                classNames.add(arg);
-            }
-        }
-        return classNames;
-    }
-    
-    /**
-     * Print a usage message to System.err.
-     */
-    public void usage() 
-    {
-        System.err.println("Usage: main <options> <arguments>..."); //NOI18N
-        System.err.println("Options:"); //NOI18N
-        System.err.println("  -h      print usage message"); //NOI18N
-        System.err.println("  -v      print verbose messages and JDO metadata"); //NOI18N
-        System.err.println("  -q      do not print any messages; just set the exit code"); //NOI18N
-        System.err.println("  -xml    expected to find JDO XML metadata for the specified class(es)"); //NOI18N
-        System.err.println("  -noxml  expected to find no JDO XML metadata for the specified class(es)"); //NOI18N
-        System.err.println("Arguments:"); //NOI18N
-        System.err.println("  <classname>   the fully qualified name of a class to be checked"); //NOI18N
-    }
-    
-    /**
-     * JavaModelFactory implementation. 
-     * We cannot use the RuntimeJavaModelFactory, because it registers
-     * a JDOImplHelper event listener to populate enhancer generated
-     * metadata into the model. Since XMLExists checks whether JDO
-     * metadata is present from a .jdo we do not want to the enhancer
-     * generated metadata.
-     */
-    private static class JavaModelFactoryImpl
-        extends ReflectionJavaModelFactory { }
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/pm/Bundle.properties b/runtime20/src/java/org/apache/jdo/impl/pm/Bundle.properties
deleted file mode 100644
index 098f8a3..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/pm/Bundle.properties
+++ /dev/null
@@ -1,102 +0,0 @@
-#
-# Copyright 2005 The Apache Software Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at 
-# 
-#     http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software 
-# distributed under the License is distributed on an "AS IS" BASIS, 
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-# See the License for the specific language governing permissions and 
-# limitations under the License.
-
-# This file should conform to netbeans standards
-# (http://www.netbeans.org/i18n)
-
-# resource bundle for the messages
-# key consists of: <PREFIX_><description>
-# <PREFIX_> - any valid prefix like MSG_, EXC_, etc.
-# <description> - short description started with the upper case letter and used
-# upper case to represent each next word.
-
-# XXX TBD: this message is not used:
-notsupported=Operation {0} is not supported in this release.
-
-
-#
-# CacheManagerImpl
-#
-EXC_MetaDataNotAvailable=Metadata for the owning Class is not available.
-EXC_NonTransactional=Instance is not transactional.
-EXC_ObjectExistsInCache=Object exists. Instance with the same primary key is already in the PersistenceManager cache.
-EXC_NotOID=Given object is not a valid OID.
-# NOI18N
-EXC_ObjectIdExistsInCache=ObjectId {0} already exists in this PersistenceManager cache.
-# NOI18N
-EXC_ObjectIdNotExistsInCache=ObjectId {0} does not exist in this PersistenceManager cache.
-
-#
-# PersistenceManagerFactoryImpl
-#
-EXC_NotConfigurable=This instance of PersistenceManagerFactory is not configurable.
-EXC_IntegerInInvalidFormat=Integer found in invalid format: should not happen!
-EXC_IncompleteConfiguration=One of ConnectionURL, ConnectionFactory, or ConnectionFactoryName must be set before using this PersistenceManagerFactory.
-EXC_WrongUsernamePassword=Cannot use multiple combinations of username/password in the same transaction.
-# NOI18N
-EXC_WrongJTATransaction=This instance of javax.transaction.Transaction is registered with another PersistenceManager.
-EXC_PersistenceManagerFactoryClosed=This operation cannot be performed because this PersistenceManagerFactory is closed.
-EXC_ActivePersistenceManager=This PersistenceManagerFactory cannot be closed while a PersistenceManager has an active transaction.
-EXC_CannotAddShutdownHook=A SecurityException was thrown when trying \
-to add a JVM shudown hook. In order to register a shutdown hook, \
-you must grant java.lang.RuntimePermission("shutdownHooks") to the \
-codeBase containing the persistence manager factory implementation.
-
-#
-# PersistenceManagerImpl
-#
-EXC_CannotGetRuntimeJavaModelFactory=A SecurityException was thrown when trying \
-to get the singleton RuntimeJavaModelFactory instance. In order to get runtime \
-metadata, you must grant javax.jdo.spi.JDOPermission("getMetadata") to the \
-codeBase containing the persistence manager implementation.
-EXC_ActiveTransaction=Cannot close PersistenceManager while transaction is still active.
-EXC_WrongSCOType=Tracked SCO instances of type {0} are not supported.
-EXC_CannotConstructSCO=Exception during construction of type {0}.
-EXC_IllegalArguments=Wrong arguments for construction of type {0}.
-EXC_PersistenceManagerClosed=PersistenceManager was closed.
-EXC_TransactionNotActive=Transaction is not active.
-EXC_NotPersistenceCapable=Class {0} not PersistenceCapable. The class of the instance does not implement PersistenceCapable. Check to see that the class has been enhanced and that the class path is correct (the unenhanced version of the class should not be in the class path).
-EXC_CollectionType=Parameter is of a Collection type; use method {0}All(Collection).
-EXC_ArrayType=Parameter is of an array type; use method {0}All(Object[]).
-EXC_TransientInstance=Instance of class {0} is not persistent.
-EXC_AnotherPersistenceManager=Object owned by another PersistenceManager.
-EXC_ClassNotPersistenceCapable=Class given to getExtent, {0},  does not implement javax.jdo.spi.PersistenceCapable
-EXC_FailedToProcessAll=Failed to process all objects.
-EXC_CannotFindSM=Could not find a StateManager for the given PersistenceCapable of class {0}.
-# NOI18N
-EXC_NotNullJTATransaction=Attempt to replace not null javax.transaction.Transaction.
-EXC_UnsupportedQueryLanguage=Unsupported query language ''{0}''
-EXC_CannotFindPCClassForObjectIdClass=Cannot find persistence-capable class for ObjectId class ''{0}''
-
-#
-# TransactionImpl
-#
-EXC_CannotChangeType=Cannot change transaction type during an active transaction.
-EXC_CannotSetFlag=Cannot change flag value during commit or rollback processing.
-EXC_CannotSetFlagIfActive=Cannot change flag value if transaction is active.
-EXC_SynchronizationNotNull=A Synchronization object has already been set for this transaction.
-EXC_ErrorBegin=Transaction has already begun.
-EXC_TransactionRolledback=Transaction already rolled back or rollback in progress.
-EXC_TransactionCommitting=Transaction has already started to commit.
-EXC_MarkedRolledback=This transaction was marked rollback-only.
-EXC_WrongStateCommit=Transaction in wrong state to commit.
-EXC_WrongStateRollback=Transaction in wrong state to rollback.
-EXC_InvalidStatus=Invalid Transaction.{0}(). This transaction status is not {1} (status = {2}).
-EXC_WrongMgdOperation=Operation {0} is not allowed in managed environment.
-EXC_WrongNonMgdOperation=Operation {0} is not allowed in non-managed environment.
-EXC_NontransactionalRead=This operation requires that a transaction be active or the NontransactionalRead flag be true.
-# NOI18N
-EXC_ErrorRegister=Cannot register this instance with JTA Synchronization.
-
diff --git a/runtime20/src/java/org/apache/jdo/impl/pm/CacheManagerImpl.java b/runtime20/src/java/org/apache/jdo/impl/pm/CacheManagerImpl.java
deleted file mode 100644
index e6e6161..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/pm/CacheManagerImpl.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * CacheManagerImpl.java
- *
- * Created on December 1, 2000
- */
-
-package org.apache.jdo.impl.pm;
-
-import java.util.*;
-import java.lang.reflect.Field;
-import java.lang.reflect.Constructor;
-import java.lang.ref.WeakReference;
-
-import javax.jdo.*;
-import javax.jdo.spi.*;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jdo.impl.state.StateManagerFactory;
-import org.apache.jdo.pm.PersistenceManagerInternal;
-import org.apache.jdo.state.StateManagerInternal;
-import org.apache.jdo.store.StoreManager;
-import org.apache.jdo.util.I18NHelper;
-import org.apache.jdo.util.WeakValueHashMap;
-
-/*
- * This is the cache manager that is responsible for operation of
- * all types of caches (weak, transactional, flushed, transient)
- * associated with the referenced instance of a PersistenceManager.
- *
- * @author Marina Vatkina
- */
-class CacheManagerImpl {
-
-    // Reference to the corresponding PersistenceManagerImpl.
-    PersistenceManagerImpl pm = null;
-
-    /**
-     * Collection of Persistent instances created and/or updated
-     * in this Transaction
-     */
-    private Collection _txCache = Collections.synchronizedSet(new HashSet());
-
-    /**
-     * Collection of Transient-transactional instances registered
-     * with this Transaction
-     */
-    private Collection _transientCache = new Vector();
-
-    /**
-     * Collection of Persistent instances that will require state
-     * change at the transaction completion
-     */
-    private ArrayList _flushedCache = new ArrayList();
-
-    /**
-     * Collection of StateManager instances that represent Persistent
-     * instances that had been made newly persistent in the current
-     * transaction.
-     */
-    private ArrayList _newInstances = new ArrayList();
-
-    /** 
-     * Weak Hashtable of Persistent instances accessed by this PersistenceManager
-     */
-    private WeakValueHashMap _weakCache = new WeakValueHashMap();
-
-    /**
-     * Logger instance
-     */
-    private static final Log logger = LogFactory.getFactory().getInstance(
-        "org.apache.jdo.impl.pm"); // NOI18N
-
-    /**
-     * I18N message handler
-     */
-    private final static I18NHelper msg = 
-        I18NHelper.getInstance(CacheManagerImpl.class);
-
-    /**
-     * Constructs new instnstance of CacheManagerImpl
-     * 
-     * @param pm calling instance of PersistenceManagerImpl
-     */
-    CacheManagerImpl(PersistenceManagerImpl pm) {
-        this.pm = pm;
-    }
-
-    /**
-     * close the CacheManagerImpl
-     */
-    protected void close() {
-        // RELEASE THE CACHE...
-        // Nothing should be in _txCache and/or _flushedCache because
-        // PersistenceManager verified that transaction is not
-        // active. _transientCache can have transient transactional
-        // instances, but it is OK to clear them. 
-       _weakCache.clear();
-       _txCache.clear();
-       _flushedCache.clear();
-       _transientCache.clear();
-    }
-
-    
-
-    /** This method locates a persistent instance in the cache of instances
-     * managed by this PersistenceManager.
-     *   
-     * <P>If the validate flag is true: This method verifies that there
-     * is an instance in the data store with the same oid, constructs an
-     * instance, and returns it.  If there is no transaction active, then
-     * a hollow instance or persistent non-transactional instance is returned.
-     * If there is a transaction active, then
-     * a persistent clean instance is returned.
-     * <P>If the validate flag is false: If there is not already an instance
-     * in the cache with the same oid, then an instance is constructed and
-     * returned.  If the instance does not exist
-     * in the data store, then this method will
-     * not fail.  However, a request to access fields of the instance will
-     * throw an exception.
-     * @return the PersistenceCapable instance with the specified
-     * ObjectId
-     * @param oid an ObjectId
-     * @param validate if the existence of the instance is to be validated
-     */
-    protected Object getObjectById (Object oid, boolean validate) {
-        if (debugging())
-            debug ("getObjectById"); // NOI18N
-
-        StateManagerInternal sm = this.getStateManager(oid, validate);
-        return ((StateManagerInternal)sm).getObject();
-    }
-
-    /**
-     * Returns StateManager instance associated with this instance of ObjectId
-     * Creates a Hollow instance of a PersistenceCapable object, if it cannot be 
-     * found in the cache
-     * @param oid an ObjectId
-     * @param pcClass Class of a Hollow instance to be created.
-     * @return the StateManagerInternal 
-     */
-    protected StateManagerInternal getStateManager (Object oid, Class pcClass) {
-        if (debugging())
-            debug ("getStateManager " + oid + " for: " + pcClass.getName()); // NOI18N
-
-        StateManagerInternal sm = null;
-        // Check weak cache to find SM:
-        synchronized (_weakCache) {
-            // Need to keep a reference to the value in the cache as it is a weak
-            // cache and the value might be removed otherwise.
-            Object o = _weakCache.get(oid);
-            if (o == null) {
-                // Nothing found
-                sm  = createNewSM(null, oid, pcClass);
-            } else {
-                // Prepare Hollow instance if its class type was not
-                // known before. 
-                sm = (StateManagerInternal)o;
-                sm.setPCClass(pcClass);
-            }
-        }
-
-        if (debugging())
-            debug ("return from getStateManager: " + sm); // NOI18N
-
-        return sm;
-    }
-
-    /**
-    * The ObjectId returned by this method represents the JDO identity of
-    * the instance.  The ObjectId is a copy (clone) of the internal state
-    * of the instance, and changing it does not affect the JDO identity of
-    * the instance.
-    * Delegates actual execution to the internal method.
-    * @param pc the PersistenceCapable instance
-    * @param transactional true if transactional Id is requested
-    * @return the ObjectId of the instance
-    */
-    protected Object getExternalObjectId (PersistenceCapable pc,
-                                          boolean transactional) {
-        StateManagerInternal sm = pm.findStateManager(pc);
-
-        Object oid = null;
-        if (_weakCache.containsValue(sm)) {
-            if (transactional)
-                oid = sm.getTransactionalObjectId(pc);
-            else
-                oid = sm.getExternalObjectId();
-        }
-
-        return oid;
-    }
-
-    /** Make the transient instance persistent in this PersistenceManager.
-     * This method must be called in an active transaction.
-     * The PersistenceManager assigns an ObjectId to the instance and
-     * transitions it to persistent-new.
-     * The instance will be managed in the Extent associated with its Class.
-     * The instance will be put into the data store at commit.
-     * @param pc a transient instance of a Class that implements
-     * PersistenceCapable
-     */
-    protected Object makePersistent (PersistenceCapable pc) {
-
-        StateManagerInternal sm = pm.findStateManager(pc);
-        if (sm == null) {
-            sm = StateManagerFactory.newInstance(pc, pm);
-        }
-
-        sm.makePersistent();
-        return pc; // XXX fix this for detached objects
-    }
-
-    /** Make the transient or persistent instance transactional in
-     * this PersistenceManager.
-     * @see javax.jdo.PersistenceManager#makeTransactional(Object pc)
-     */
-    protected void makeTransactional(PersistenceCapable pc) {
-        StateManagerInternal sm = pm.findStateManager(pc);
-        if (sm == null) {
-            sm = StateManagerFactory.newInstance(pc, pm);
-        }
-        sm.makeTransactional();
-    }
-
-
-    /** Make the transient or persistent instance transactional in
-     * this PersistenceManager.
-     * @see javax.jdo.PersistenceManager#makeNontransactional(Object pc)
-     */
-    protected void makeNontransactional(PersistenceCapable pc) {
-        StateManagerInternal sm = pm.findStateManager(pc);
-        if (sm == null) {
-            throw new JDOUserException(msg.msg(
-                    "EXC_NonTransactional")); // NOI18N
-        }
-        sm.makeNontransactional();
-    }
-
-
-    /** Make the persistent instance transient in this PersistenceManager.
-     * @see javax.jdo.PersistenceManager#makeTransient(Object pc)
-     */
-    protected void makeTransient(PersistenceCapable pc) {
-        StateManagerInternal sm = pm.findStateManager(pc);
-        if (sm != null) {
-            sm.makeTransient();
-        }
-    }
-
-    /** Make persistent instance hollow in this PersistenceManager.
-     * @see javax.jdo.PersistenceManager#evict(Object pc)
-     */
-    protected void evict(PersistenceCapable pc) {
-        StateManagerInternal sm = pm.findStateManager(pc);
-        if (sm != null) {
-            sm.evictInstance();
-        }
-    }
-
-    /** Make all non-dirty persistent instances in the cache hollow in 
-     * this PersistenceManager.
-     * @see javax.jdo.PersistenceManager#evictAll()
-     */
-    protected void evictAll() {
-        StateManagerInternal sm = null;
-
-        Iterator it = _weakCache.entrySet().iterator();
-        while (it.hasNext()) {
-            sm = (StateManagerInternal) ((Map.Entry)it.next()).getValue();
-            sm.evictInstance();
-        }
-    }
-
-    /** Retrieve Hollow persistent instance in this PersistenceManager.
-     * @see javax.jdo.PersistenceManager#retrieve(Object pc)
-     */
-    protected void retrieve(PersistenceCapable pc) {
-        StateManagerInternal sm = pm.findStateManager(pc);
-        if (sm != null) {
-            sm.retrieve();
-        }
-    }
-
-    /** Refresh dirty persistent instance in this PersistenceManager.
-     * @see javax.jdo.PersistenceManager#refresh(Object pc)
-     */
-    protected void refresh(PersistenceCapable pc) {
-        StateManagerInternal sm = pm.findStateManager(pc);
-        if (sm != null) {
-            sm.refreshInstance();
-        }
-    }
-
-    /** Refresh dirty persistent instances in the transactional cache 
-     * of this PersistenceManager. Called in an active transaction.
-     * @see javax.jdo.PersistenceManager#refreshAll()
-     */
-    protected void refreshAllTransactional() {
-        StateManagerInternal sm = null;
-
-        Iterator it = _txCache.iterator();
-        while(it.hasNext()) {
-            sm = (StateManagerInternal)it.next();
-            sm.refreshInstance();
-        }
-    }
-
-    /** Refresh  nontransactional instances in the weak cache
-     * of this PersistenceManager. Called outside an active transaction.
-     * @see javax.jdo.PersistenceManager#refreshAll()
-     */
-    protected void refreshAllNontransactional() {
-        StateManagerInternal sm = null;
-
-        Iterator it = _weakCache.entrySet().iterator();
-        while (it.hasNext()) {
-            sm = (StateManagerInternal) ((Map.Entry)it.next()).getValue();
-            sm.refreshInstance();
-        }
-    }
-
-    /**
-     * Register transient instance in the transient cache
-     */
-    protected void registerTransient(StateManagerInternal sm) {
-        Iterator it = _transientCache.iterator();
-        while(it.hasNext()) {
-            Object o = ((WeakReference)it.next()).get();
-            if ((StateManagerInternal)o == sm) {
-                // The same SM is found - nothing to do.
-                return;
-            }
-        }
-        _transientCache.add(new WeakReference(sm));
-    }
-
-    /**
-     * Register persistent instance in the transactional cache
-     */
-    protected void register(StateManagerInternal sm, Object oid, 
-            boolean transactional, boolean throwDuplicateException) {
-        if (oid == null) {
-            oid = sm.getInternalObjectId();
-        }
-
-        //register in both caches for transactional instances only
-
-        if (! _weakCache.containsKey(oid)) {
-            deregisterTransient(sm);
-            _weakCache.put(oid, sm);  
-
-        } else if (throwDuplicateException) {
-            throw new JDOUserException(msg.msg(
-                "EXC_ObjectExistsInCache")); // NOI18N
-        }
-
-        if (pm.currentTransaction().isActive() && transactional) {
-            // Register in both caches for convenience.
-            if (! _flushedCache.contains(sm)) {
-                _flushedCache.add(sm); 
-            }
-            if (! _txCache.contains(sm)) {
-                _txCache.add(sm); 
-                if (sm.isNew()) 
-                    _newInstances.add(sm.getObject());
-            }
-        }
-
-        if (!transactional) {
-            // Remove from transactional caches if instance became
-            // nontransactional
-            _txCache.remove(sm); 
-            _flushedCache.remove(sm);
-        }
-    }
-
-    /**
-     * Remove transient instance from the transient cache
-     */
-    protected void deregisterTransient(Object sm) {
-        Iterator it = _transientCache.iterator();
-        while(it.hasNext()) {
-            WeakReference wr = (WeakReference)it.next();
-            if ((StateManagerInternal)wr.get() == sm) {
-                _transientCache.remove(wr);
-                break;
-            }
-        }
-    }
-
-    /**
-     * Remove persistent instance from all caches
-     */
-    protected void deregister(Object oid) {
-        if (oid != null) {
-            //deregister the instance from all the caches
-            Object o = _weakCache.remove(oid);
-
-            // No need to do anything outside an active transaction.
-            if (pm.currentTransaction().isActive()) {
-                _txCache.remove(o);
-                _flushedCache.remove(o);
-            }
-        }
-    }
-
-    /**  
-     * @see PersistenceManagerInternal#replaceObjectId(Object oldId,
-     * Object newId)
-     */  
-    protected void replaceObjectId(Object oldId, Object newId) {
-        if (debugging())
-            debug ("replaceObjectId"); // NOI18N
-
-        synchronized(_weakCache) {
-            if (_weakCache.containsKey(newId)) {
-                throw new JDOFatalInternalException(msg.msg(
-                    "EXC_ObjectIdExistsInCache", newId)); // NOI18N
-            }
-            Object o = _weakCache.remove(oldId);
-            if (o == null) {
-                throw new JDOFatalInternalException(msg.msg(
-                    "EXC_ObjectIdNotExistsInCache", newId)); // NOI18N
-            }
-            _weakCache.put(newId, o);
-        }
-    }
-
-    /**  
-     * @see PersistenceManagerInternal#markAsFlushed(StateManagerInternal sm)
-     */  
-    protected void markAsFlushed(StateManagerInternal sm) { 
-        _txCache.remove(sm);
-    }
-
-    /**
-     * Called by Transaction#commit(), Transaction#beforeCompletion(), or
-     * Transaction#internalFlush().
-     * Processes instances for the reachability algorithm, then calls
-     * StoreManager to iterate over transactional cache and to call flush() 
-     * for each StateManager in it.
-     */
-    protected void flushInstances() {
-        StateManagerInternal sm = null;
-
-        Object[] e = _txCache.toArray();
-        boolean commit = pm.insideCommit();
-
-        for (int i = 0; i < e.length; i++) {
-            sm = (StateManagerInternal)e[i];
-
-            //
-            // NOTE: handleRelationships has the side-effect of adding
-            // more objects to the transaction cache.
-            //
-            sm.handleReachability(commit);
-        }
-
-        StoreManager srm = pm.getStoreManager();
-        Iterator it = _txCache.iterator();
-
-        srm.flush(it, pm);
-
-        _txCache.clear();
-    }
-
-    /**
-     * Called by Transaction commit() or rollback()
-     * cleans up transactional cache
-     * @param    abort 
-     */
-    protected void afterCompletion(boolean abort) {
-        boolean retainValues = pm.currentTransaction().getRetainValues();
-        boolean restoreValues = pm.currentTransaction().getRestoreValues();
-
-        // Need to process transient instances also
-        Iterator it = _transientCache.iterator();
-        while(it.hasNext()) {
-            Object o = ((WeakReference)it.next()).get();
-
-            if (o == null) { 
-                // It has been GC'd and should be removed from _transientCache. 
-                it.remove(); 
-            } else {
-                _flushedCache.add(o);
-            }
-        }
-
-        int len = _flushedCache.size();
-        for ( int i = 0; i < len; i++) {
-            StateManagerInternal sm = (StateManagerInternal)_flushedCache.get(i);
-            sm.afterCompletion(abort, retainValues, restoreValues);
-        }
-
-        // Now clean the flushed cache
-        _flushedCache.clear();
-        _newInstances.clear();
-
-        // Just in case beforeCompletion failed or it was a rollback
-        _txCache.clear();
-    }
-
-    /**
-     * Returns a Collection of instances that has been made persistent
-     * or become persistent through persistence-by-reachability
-     * algorithm in this transaction. Called by the Extent.iterator.
-     * @see PersistenceManagerInternal#getInsertedInstances
-     * @return Collection of Persistent-New instances.
-     */
-    protected Collection getInsertedInstances() {
-        if (debugging())
-            debug("getInsertedInstances"); // NOI18N
-
-        return _newInstances;
-    }
-
-    /** --------------Private Methods--------------  */
-
-    /**
-     * Returns StateManager instance associated with this instance of ObjectId
-     * @see #getObjectById(Object oid, boolean validate)
-     * @param oid an ObjectId
-     * @param validate if the existence of the instance is to be validated
-     */
-    private StateManagerInternal getStateManager (Object oid, boolean validate) {
-
-        Object o = null;
-        StoreManager srm = pm.getStoreManager();
-        Class candidateClassType = srm.getPCClassForOid(oid, pm);
-        if (candidateClassType == null) {
-            // not found, report an error
-            throw new JDOUserException(msg.msg(
-                "EXC_NotOID"),// NOI18N
-                 oid);
-        }
-
-        Object internalOid = srm.getInternalObjectId(oid, pm);
-        if (debugging())
-            debug ("getStateManager internal oid: " + internalOid); // NOI18N
-
-        StateManagerInternal sm = null;
-
-        // Check weak cache to find SM:
-        synchronized (_weakCache) {
-            if((o = _weakCache.get(internalOid)) == null) {
-                // Nothing found
-                if (debugging())
-                    debug ("getStateManager oid not found."); // NOI18N
-
-                sm  = createNewSM(oid, internalOid, candidateClassType);
-                // Always reload from the DB to resolve actual classType
-                if (validate || !srm.hasActualPCClass(internalOid))
-                    sm.reload();
-                return sm;
-
-            } else  if (validate && !_flushedCache.contains(o)) {
-                // Found but NOT in the transactional cache. Reload.
-                if (debugging())
-                    debug ("getStateManager oid found - reload."); // NOI18N
-
-                sm = (StateManagerInternal)o;
-                sm.reload();
-                return sm;
-            }
-        }
-        return (StateManagerInternal)o;
-    }
-
-    /**
-     * Creates new StateManager instance associated with this instance
-     * of ObjectId.
-     * @see #getObjectById(Object oid, boolean validate)
-     * @param UserOid a user provided ObjectId
-     * @param internalOid an internal ObjectId
-     * @param candidateClassType super class of a Hollow instance to be created.
-     */
-    private StateManagerInternal createNewSM(Object UserOid, Object internalOid,
-                                                      Class candidateClassType) {
-        try {
-            return StateManagerFactory.newInstance(UserOid, internalOid, 
-                pm, candidateClassType);
-
-        } catch (JDOUserException e) {
-            throw e;
-            // XXX Possible jikes bug
-            //
-            // The following catch phrase causes jikes to complain (Caution:
-            // This try block cannot throw a "checked exception" (JLS section
-            // 14.7) that can be caught here. You may have intended to catch
-            // a RuntimeException instead of an Exception.)  But this try
-            // block is *not* here throwing any checked exceptions!  That's
-            // why I think it's a jikes bug (Sun's javac does not complain.)
-        } catch (Exception e) {
-            throw new JDOUserException(msg.msg("EXC_NotOID"), e, UserOid); // NOI18N
-        }
-    }
-
-    /**
-     * Tracing method
-     * @param msg String to display
-     */  
-    private void debug(String msg) {
-        logger.debug("In CacheManagerImpl " + msg); // NOI18N
-    }
-    /**
-     * Verifies if debugging is enabled.
-     * @return true if debugging is enabled.
-     */
-    private boolean debugging() {
-        return logger.isDebugEnabled();
-    }
-
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java b/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java
deleted file mode 100644
index c537e73..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerFactoryImpl.java
+++ /dev/null
@@ -1,1791 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * PersistenceManagerFactoryImpl.java
- *
- * Created on December 1, 2000
- */
- 
-package org.apache.jdo.impl.pm;
-
-import java.io.IOException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.jdo.FetchPlan;
-import javax.jdo.JDOException;
-import javax.jdo.JDOFatalInternalException;
-import javax.jdo.JDOFatalUserException;
-import javax.jdo.JDOUserException;
-import javax.jdo.PersistenceManager;
-import javax.jdo.Transaction;
-import javax.jdo.datastore.DataStoreCache;
-import javax.jdo.listener.InstanceLifecycleListener;
-import javax.jdo.spi.JDOPermission;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jdo.ejb.EJBImplHelper;
-import org.apache.jdo.impl.model.java.runtime.RuntimeJavaModelFactory;
-import org.apache.jdo.pm.Accessor;
-import org.apache.jdo.pm.PersistenceManagerFactoryInternal;
-import org.apache.jdo.util.I18NHelper;
-import org.apache.jdo.util.JDORIVersion;
-
-/** 
- * This is an abstract PersistenceManagerFactoryImpl class that provides the 
- * StoreManager independent implementation of javax.jdo.PersistenceManager
- * interface. 
- * <p>
- * Subclasses must override the following methods declared abstract:
- * <ul>
- * <li> {@link #getOptionArray()}
- * <li> {@link #createPersistenceManager(String userid, String password)}
- * <li> {@link #setPMFClassProperty (Properties props)}
- * <li> {@link #encrypt(String s)}
- * <li> {@link #decrypt(String s)}
- * <li> {@link #setCFProperties(Properties p)}
- * <li> {@link #getCFFromProperties(Properties p)}
- * <li> {@link #isConnectionFactoryConfigured()}
- * <li> and all methods from org.apache.jdo.pm.PersistenceManagerFactoryInternal.
- * </ul> 
- *
- * @author  Marina Vatkina
- * @version 0.1
- */
-
-abstract public class PersistenceManagerFactoryImpl implements 
-    PersistenceManagerFactoryInternal {
-
-    //
-    // PersistenceManagerFactory properties
-    //
-    private String URL = null;
-    private String userName = null;
-    protected String password = null;
-    private String driverName = null;
-
-    private Object connectionFactory = null;
-    private String connectionFactoryName = null;
-
-    private Object connectionFactory2 = null;
-    private String connectionFactory2Name = null;
-
-    private boolean multithreaded = false;
-
-    private boolean optimistic = true;
-    private boolean retainValues = true;
-    private boolean restoreValues = true;
-    private boolean nontransactionalRead = true;
-    private boolean nontransactionalWrite = false;
-    private boolean ignoreCache = true;
-    private boolean detachAllOnCommit = false;
-    
-    private int queryTimeout = 0;
-    private int updateTimeout = 0;
-
-    private int minPool = 1;
-    private int maxPool = 1;
-    private int msWait = 0;
-
-    /** Cached hashCode for this PMF.  Changes every time a property of this
-    * PMF is changed to a non-default value.  Fixed after setConfigured()
-    * (mostly).
-    * @see #setConfigured()
-    * @see #setNonconfigured()
-    */
-    private int myHashCode;
-
-    //
-    // Once false, attempts to change properties above will fail (see
-    // assertConfigurable).
-    //
-    private boolean configurable = true;
-    
-
-    //
-    // The PMF is serialized in one of 3 forms, depending on how it is
-    // configured.
-    //
-    private static final int PERSIST_CF = 1;
-    private static final int PERSIST_CF_NAME = 2;
-    private static final int PERSIST_PROPS = 3;
-
-    /** These are used for implementing close().
-     */
-    protected boolean closed = false;
-    
-    /** The closeLock protects the close flag and pmSet.
-     */
-    protected Object closeLock = new Object();
-    
-    /** The set of all PersistenceManagers that are not closed.  In order
-     * for this to work, it is important that PersistenceManager implement
-     * equals to be equivalent to Object.equals.
-     */
-    protected Set pmSet = new HashSet();
-    
-    /**
-     * Logger instance
-     */
-    private static final Log logger = LogFactory.getFactory().getInstance(
-        "org.apache.jdo.impl.pm"); // NOI18N
-
-    /**
-     * I18N message handler
-     */
-    private final static I18NHelper msg = 
-        I18NHelper.getInstance("org.apache.jdo.impl.pm.Bundle"); // NOI18N
-
-    /**
-     * Transactional cache of PersistenceManager instances
-     */
-    private Hashtable pmCache = new Hashtable();
-
-    /** RuntimeJavaModelFactory. */
-    private static final RuntimeJavaModelFactory javaModelFactory =
-        (RuntimeJavaModelFactory) AccessController.doPrivileged(
-            new PrivilegedAction () {
-                public Object run () {
-                    return RuntimeJavaModelFactory.getInstance();
-                }
-            }
-        );
- 
-    /** Collection of registered pmf instances. */
-    private static Collection registeredPMFs = new HashSet();
-    
-    /** Adds a JVM shutdown hook to close pmf instances left open by the
-     * user. 
-     */
-    static {
-        AccessController.doPrivileged(new PrivilegedAction () {
-            public Object run () {
-                try {
-                    Runtime.getRuntime().addShutdownHook(new ShutdownHook());
-                    return null;
-                }
-                catch (SecurityException ex) {
-                    throw new JDOFatalUserException(msg.msg(
-                        "EXC_CannotAddShutdownHook"), ex); // NOI18N
-                }
-            }});
-    }
-
-    /**
-     * Creates new <code>PersistenceManagerFactoryImpl</code> without
-     * any user info.
-     */
-    public PersistenceManagerFactoryImpl() { }
-
-    /**
-     * Creates new <code>PersistenceManagerFactoryImpl</code> with user info
-     * @param URL        URL for the data store connection
-     * @param userName    user name for the data store connection 
-     * @param password    password for the data store connection
-     * @param driverName    driver name for the data store connection
-     */
-    public PersistenceManagerFactoryImpl(
-            String URL, 
-            String userName, 
-            String password, 
-            String driverName) {
-        this.URL = URL;
-        this.userName = userName;
-        this.password = password;
-        this.driverName = driverName;
-        
-    }
-  
-    /** 
-     * Set the user name for the data store connection.
-     * @param userName the user name for the data store connection.
-     */
-    public void setConnectionUserName (String userName) {
-        assertConfigurable();
-        this.userName = userName;
-    }
-  
-    /**
-     * Get the user name for the data store connection.
-     * @return    the user name for the data store connection.
-     */
-    public String getConnectionUserName() {
-        return userName;
-    }
-  
-    /**
-     * Set the password for the data store connection.
-     * @param password the password for the data store connection.
-     */
-    public void setConnectionPassword (String password) {
-        assertConfigurable();
-        this.password = password;
-    }
-  
-    /**
-     * Get the password for the data store connection.  Protected so 
-     * not just anybody can get the password.
-     * @return password the password for the data store connection.
-     */
-    protected String getConnectionPassword () {
-        return this.password;
-    }
-  
-    /**
-     * Set the URL for the data store connection.
-     * @param URL the URL for the data store connection.
-     */
-    public void setConnectionURL (String URL) {
-        assertConfigurable();
-        this.URL = URL;
-    }
-  
-    /**
-     * Get the URL for the data store connection.
-     * @return the URL for the data store connection.
-     */
-    public String getConnectionURL() {
-        return URL;
-    }
-
-    /**
-     * Set the driver name for the data store connection.
-     * @param driverName the driver name for the data store connection.
-     */
-    public void setConnectionDriverName (String driverName) {
-        assertConfigurable();
-        this.driverName = driverName;
-    }
-  
-    /**
-     * Get the driver name for the data store connection.
-     * @return the driver name for the data store connection.
-     */
-    public String getConnectionDriverName() {
-        return driverName;
-    }
-
-    /**
-     * Set the name for the data store connection factory.
-     * @param connectionFactoryName the name of the data store
-     * connection factory.
-     */
-    public void setConnectionFactoryName (String connectionFactoryName) {
-        assertConfigurable();
-        this.connectionFactoryName = connectionFactoryName;
-    }
-  
-    /**
-     * Get the name for the data store connection factory.
-     * @return the name of the data store connection factory.
-     */
-    public String getConnectionFactoryName () {
-        return connectionFactoryName;
-    }
-
-    /**
-     * Set the data store connection factory.  JDO implementations
-     * will support specific connection factories.  The connection
-     * factory interfaces are not part of the JDO specification.
-     * @param connectionFactory the data store connection factory.
-     */
-    public void setConnectionFactory (Object connectionFactory) {
-        assertConfigurable();
-        this.connectionFactory = connectionFactory;
-    }
-  
-    /**
-     * Get the data store connection factory.
-     * @return the data store connection factory.
-     */
-    public Object getConnectionFactory() {
-        return connectionFactory;
-    }
-    
-    /** Set the name of the connection factory for non-transactional connections.
-     * @see javax.jdo.PersistenceManagerFactory#setConnectionFactory2Name
-     * @param connectionFactoryName the name of the connection factory
-     * for non-transactional connections.
-     */
-    public void setConnectionFactory2Name(String connectionFactoryName)     {
-        assertConfigurable();
-        this.connectionFactory2Name = connectionFactory2Name;
-    }
-    
-    /** Get the name of the connection factory for non-transactional connections.
-     * @see javax.jdo.PersistenceManagerFactory#getConnectionFactory2Name
-     * @return the name of the connection factory for 
-     * non-transactional connections.
-     */
-    public String getConnectionFactory2Name() {
-        return connectionFactory2Name;
-    }
-
-    /** Set the non-transactional connection factory
-     * for optimistic transactions.
-     * @see javax.jdo.PersistenceManagerFactory#setConnectionFactory2
-     * @param connectionFactory the non-transactional connection factory.
-     */
-    public void setConnectionFactory2(Object connectionFactory) {
-        assertConfigurable();
-        this.connectionFactory2 = connectionFactory2;
-    }
-  
-    /** Return the non-transactional connection factory
-     * for optimistic transactions.
-     * @see javax.jdo.PersistenceManagerFactory#getConnectionFactory2
-     * @return the non-transactional connection factory for optimistic
-     * transactions
-     */
-    public Object getConnectionFactory2() {
-        return connectionFactory2;
-    }
-  
-    /** Set the default Multithreaded setting for all
-     * PersistenceManager instances obtained from this factory.
-     *
-     * @param flag the default Multithreaded setting.
-     */
-    public void setMultithreaded (boolean flag) {
-         assertConfigurable();
-         multithreaded = flag;
-    }
-
-    /** Get the default Multithreaded setting for all
-     * PersistenceManager instances obtained from this factory.  
-     *
-     * @return the default Multithreaded setting.
-     */
-    public boolean getMultithreaded() {
-        return multithreaded;
-    }
-
-    /** Set the Mapping setting for this factory. This is used to find the 
-     * object-datastore mapping file(s).
-     *
-     * @param mapping the Mapping setting.
-     */
-    public void setMapping (String mapping) {
-        throw new UnsupportedOperationException(
-            "Method setMapping(String) is not yet implemented.");
-    }
-  
-    /** Get the Mapping setting for this factory.  This is used to find the 
-     * object-datastore mapping file(s).
-     *
-     * @return the Mapping setting.
-     */
-    public String getMapping () {
-        throw new UnsupportedOperationException(
-            "Method getMapping() is not yet implemented.");
-    }
-
-    /**
-     * Set the default Optimistic setting for all PersistenceManager instances
-     * obtained from this factory.  Setting Optimistic to true also sets
-     * NontransactionalRead to true.
-     * @param flag the default Optimistic setting.
-     */
-    public void setOptimistic (boolean flag) {
-        assertConfigurable();
-        optimistic = flag;
-    }
-
-    /**
-     * Get the default Optimistic setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default Optimistic setting.
-     */
-    public boolean getOptimistic () {
-        return optimistic;
-    }
-
-
-    /**
-     * Set the default RetainValues setting for all PersistenceManager instances
-     * obtained from this factory.  Setting RetainValues to true also sets
-     * NontransactionalRead to true.
-     * @param flag the default RetainValues setting.
-     */
-    public void setRetainValues (boolean flag) {
-        assertConfigurable();
-        retainValues = flag;    
-    }
-
-    /**
-     * Get the default RetainValues setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default RetainValues setting.
-     */
-     public boolean getRetainValues () {
-         return retainValues;
-     }
-
-    /**
-     * Set the default RestoreValues setting for all PersistenceManager instances
-     * obtained from this factory.  Setting RestoreValues to true also sets
-     * NontransactionalRead to true.
-     * @param flag the default RestoreValues setting.
-     */
-    public void setRestoreValues (boolean flag) {
-        assertConfigurable();
-        restoreValues = flag;    
-    }
-
-    /**
-     * Get the default RestoreValues setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default RestoreValues setting.
-     */
-     public boolean getRestoreValues () {
-         return restoreValues;
-     }
-
-
-     /**
-      * Set the default NontransactionalRead setting for all
-      * PersistenceManager instances obtained from this factory.
-      * @param flag the default NontransactionalRead setting.
-      */   
-     public void setNontransactionalRead (boolean flag) {
-         assertConfigurable();
-         nontransactionalRead = flag; 
-     }
-
-     /**
-      * Get the default NontransactionalRead setting for all
-      * PersistenceManager instances obtained from this factory.
-      * @return the default NontransactionalRead setting.
-      */   
-     public boolean getNontransactionalRead () {
-         return nontransactionalRead;
-     }
-
-     /**
-      * Set the default NontransactionalWrite setting for all
-      * PersistenceManager instances obtained from this factory.
-      * @param flag the default NontransactionalWrite setting.
-      */   
-     public void setNontransactionalWrite (boolean flag) {
-         assertConfigurable();
-         nontransactionalWrite = flag; 
-     }
-
-    /**
-     * Get the default NontransactionalWrite setting for all
-     * PersistenceManager instances obtained from this factory.
-     * @return the default NontransactionalWrite setting.
-     */   
-    public boolean getNontransactionalWrite () {
-        return nontransactionalWrite;
-    }
-
-
-    /**
-     * Set the default IgnoreCache setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @param flag the default IgnoreCache setting.
-     */
-    public void setIgnoreCache (boolean flag) {
-        assertConfigurable();
-        ignoreCache = flag;
-    }
-
-    /**
-     * Get the default IgnoreCache setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default IngoreCache setting.
-     */
-    public boolean getIgnoreCache () {
-        return ignoreCache;
-    }
-
-    /**
-     * Set the default DetachAllOnCommit setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @param flag the default DetachAllOnCommit setting.
-     */
-    public void setDetachAllOnCommit(boolean flag) {
-        assertConfigurable();
-        detachAllOnCommit = flag;
-    }
-
-    /**
-     * Get the default DetachAllOnCommit setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default DetachAllOnCommit setting.
-     */
-    public boolean getDetachAllOnCommit() {
-        return detachAllOnCommit;
-    }
-
-    /** Set the default MsWait setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @param msWait the default MsWait setting.
-     */
-    public void setMsWait(int msWait) {
-        assertConfigurable();
-        this.msWait = msWait;
-    }
-    
-    /** Get the default MsWait setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default MsWait setting.
-     */
-    public int getMsWait() {
-        return msWait;
-    }
-    
-    /** Set the default MinPool setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @param minPool the default MinPool setting.
-     */
-    public void setMinPool(int minPool) {
-        assertConfigurable();
-        this.minPool = minPool;
-    }
-    
-    /** Get the default MinPool setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default MinPool setting.
-     */
-    public int getMinPool() {
-        return minPool;
-    }
-    
-    /** Set the default MaxPool setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @param maxPool the default MaxPool setting.
-     */
-    public void setMaxPool(int maxPool) {
-        assertConfigurable();
-        this.maxPool = maxPool;
-    }
-    
-    /** Get the default MaxPool setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default MaxPool setting.
-     */
-    public int getMaxPool() {
-        return maxPool;
-    }
-    
-    /** Set the default QueryTimeout setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @param queryTimeout the default QueryTimeout setting.
-     */
-    public void setQueryTimeout(int queryTimeout) {
-        assertConfigurable();
-        this.queryTimeout = queryTimeout;
-    }
-    
-    /** Get the default QueryTimeout setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default QueryTimeout setting.
-     */
-    public int getQueryTimeout() {
-        return queryTimeout;
-    }
-    
-    /** Set the default UpdateTimeout setting for all
-     * PersistenceManager instances obtained from this factory.
-     * @param updateTimeout the default UpdateTimeout setting.
-     */
-    public void setUpdateTimeout(int updateTimeout) {
-        assertConfigurable();
-        this.updateTimeout = updateTimeout;
-    }
-    
-    /** Get the default UpdateTimeout setting for all PersistenceManager instances
-     * obtained from this factory.
-     * @return the default UpdateTimeout setting.
-     */
-    public int getUpdateTimeout() {
-        return updateTimeout;
-    }
-    
-    
-    /**
-     * Return "static" properties of this PersistenceManagerFactory.
-     * Properties with keys VendorName and VersionNumber are required.  Other
-     * keys are optional.
-     * @return the non-operational properties of this PersistenceManagerFactory.
-     */
-    public Properties getProperties () {
-        return JDORIVersion.getVendorProperties();
-    }
-
-    /** The application can determine from the results of this
-     * method which optional features are supported by the
-     * JDO implementation.
-     * <P>Each supported JDO optional feature is represented by a
-     * String with one of the following values:
-     *
-     * <P>javax.jdo.option.TransientTransactional
-     * <P>javax.jdo.option.NontransactionalRead
-     * <P>javax.jdo.option.NontransactionalWrite
-     * <P>javax.jdo.option.RetainValues
-     * <P>javax.jdo.option.Optimistic
-     * <P>javax.jdo.option.ApplicationIdentity
-     * <P>javax.jdo.option.DatastoreIdentity
-     * <P>javax.jdo.option.NonDatastoreIdentity
-     * <P>javax.jdo.option.ArrayList
-     * <P>javax.jdo.option.HashMap
-     * <P>javax.jdo.option.Hashtable
-     * <P>javax.jdo.option.LinkedList
-     * <P>javax.jdo.option.TreeMap
-     * <P>javax.jdo.option.TreeSet
-     * <P>javax.jdo.option.Vector
-     * <P>javax.jdo.option.Map
-     * <P>javax.jdo.option.List
-     * <P>javax.jdo.option.Array     
-     * <P>javax.jdo.option.NullCollection  
-     *
-     *<P>The standard JDO query language is represented by a String:
-     *<P>javax.jdo.query.JDOQL   
-     * @return the Set of String representing the supported Options
-     */    
-    public Collection supportedOptions() {
-        return Collections.unmodifiableList(Arrays.asList(getOptionArray()));
-    }
-
-    /**
-     * Return the {@link DataStoreCache} that this factory uses for
-     * controlling a second-level cache. If this factory does not use
-     * a second-level cache, the returned instance does nothing. This
-     * method never returns <code>null</code>.
-     * @since 2.0
-     */
-    public DataStoreCache getDataStoreCache () {
-        throw new UnsupportedOperationException(
-            "Method getDataStoreCache() not yet implemented");
-    }
-
-    /**
-     * Add the parameter listener to the list of
-     * instance lifecycle event listeners set as the initial listeners
-     * for each PersistenceManager created by this PersistenceManagerFactory. 
-     * The <code>addInstanceLifecycleListener</code> and 
-     * <code>removeInstanceLifecycleListener</code>
-     * methods are considered to be configuration methods and
-     * can only be called when the PersistenceManagerFactory
-     * is configurable (before the first time {@link #getPersistenceManager}
-     * is called).
-     * <p>The <code>classes</code> parameter identifies all
-     * of the classes of interest. If the <code>classes</code>
-     * parameter is specified as <code>null</code>, events for all
-     * persistent classes and interfaces will be sent to the listener.</p>
-     * <p>The listener will be called for each event for which it
-     * implements the corresponding {@link InstanceLifecycleListener}
-     * interface.</p>
-     * @param listener the lifecycle listener
-     * @param classes the classes of interest to the listener
-     * @since 2.0
-     */
-    public void addInstanceLifecycleListener (
-        InstanceLifecycleListener listener, Class[] classes) {
-        throw new UnsupportedOperationException(
-            "Method addInstanceLifecycleListener(InstanceLifecycleListener, Class[]) not yet implemented");
-    }
-
-    /**
-     * Remove the parameter listener instance from the list of
-     * instance lifecycle event listeners set as the initial listeners
-     * for each PersistenceManager created by this PersistenceManagerFactory. 
-     * The <code>addInstanceLifecycleListener</code> and 
-     * <code>removeInstanceLifecycleListener</code>
-     * methods are considered to be configuration methods and
-     * can only be called when the PersistenceManagerFactory
-     * is configurable (before the first time {@link #getPersistenceManager}
-     * is called).
-     * @param listener the listener instance to be removed
-     * @since 2.0
-     */
-    public void removeInstanceLifecycleListener (InstanceLifecycleListener listener) {
-        throw new UnsupportedOperationException(
-            "Method removeInstanceLifecycleListener(InstanceLifecycleListener) not yet implemented");
-    }
-
-    /**
-     * Returns an array of Strings indicating which options are supported by
-     * this PersistenceManagerFactory.
-     * @return the option array.
-     */
-    abstract protected String[] getOptionArray();
-
-    /** Creates a new instance of PersistenceManager from this factory.
-     * Called by getPersistenceManager(String userid, String password))
-     * if there is no pooled instance that satisfies the request.
-     *
-     * @return a PersistenceManager instance with default options.
-     * @param userid The user id of the connection factory.
-     * @param password The password of the connection factory.
-     */
-    protected abstract PersistenceManager createPersistenceManager(
-        String userid, String password);
-
-    /** Get an instance of PersistenceManager from this factory.  The
-     * instance has default values for options.
-     *
-     * <P>If pooling of PersistenceManager instances is supported by
-     * this factory, the instance might have been returned to the pool
-     * and is being reused. 
-     *
-     * <P>After the first use of getPersistenceManager, no "set" methods will
-     * succeed.
-     *
-     * @return a PersistenceManager instance with default options.
-     */
-    public PersistenceManager getPersistenceManager() {
-        return getPersistenceManager(null, null);
-    }
-        
-    /** Get an instance of PersistenceManager from this factory.  The
-     * instance has default values for options.  The parameters userid
-     * and password are used when obtaining datastore connections from
-     * the connection pool.
-     *
-     * <P>If pooling of PersistenceManager instances is supported by
-     * this factory, the instance might have been returned to the pool
-     * and is being reused.
-     *
-     * <P>After the first use of getPersistenceManager, no "set"
-     * methods will succeed.
-     *
-     * @return a PersistenceManager instance with default options.
-     * @param userid The user id of the connection factory.
-     * @param password The password of the connection factory.
-     */
-    public PersistenceManager getPersistenceManager(
-        String userid, String password){
-
-        if (debugging())
-            debug("getPersistenceManager"); // NOI18N
-
-        if (configurable) {
-            verifyConfiguration();
-        }
-
-        // Remember if it was configurable. We will need to restore it if
-        // it was and createPersistenceManager failed.
-        boolean wasConfigurable = configurable;
-
-        try {
-            if (wasConfigurable) {
-                
-                // if successful, the state of this PMF becomes configured
-                setConfigured();
-
-                // Replace this PersistenceManagerFactory with the one
-                // known to the appserver, if it is the first request
-                // to getPersistenceManager in this instance of the
-                // PersistenceManagerFactory. 
-                // This is a no-op in a non-managed environment, and
-                // if an appserver does not need any extra code here.
-                PersistenceManagerFactoryImpl pmf = 
-                    (PersistenceManagerFactoryImpl)EJBImplHelper.
-                        replacePersistenceManagerFactory(this);
-
-                if (pmf != this) {
-                    // Was replaced. Mark this PersistenceManagerFactory as 
-                    // configurable.
-                    setNonconfigured();
-                }
-                else {
-                    // register this PMF
-                    registeredPMFs.add(pmf);
-                }
-                
-                return pmf.getPersistenceManagerInternal(userid, password);
-            } 
-            // This PersistenceManagerFactory has been already configured.
-            return getPersistenceManagerInternal(userid, password);
-
-        } catch (javax.jdo.JDOException e) {
-            if (wasConfigurable) {
-                setNonconfigured();
-            }
-            throw e;
-        }
-    }
-
-    /**
-     * Returns PersistenceManager instance with default options.
-     * @see #getPersistenceManager(String userid, String password)
-     */
-    private PersistenceManager getPersistenceManagerInternal(
-        String userid, String password){
-
-        if (debugging())
-            debug("getPersistenceManagerInternal"); // NOI18N
-
-        // Check if we are in managed environment and
-        // PersistenceManager is cached
-        PersistenceManagerImpl pm = null;
-        javax.transaction.Transaction t = EJBImplHelper.getTransaction();
- 
-        if (t != null) {
-            pm = (PersistenceManagerImpl)pmCache.get(t);
-            if (pm == null) {
-                // Not found
-                synchronized(pmCache) {
-                    pm = (PersistenceManagerImpl)pmCache.get(t);
-                    if (pm == null) {
-                        pm = getFromPool(userid, password);
-                        pmCache.put(t, pm);
-                        pm.setJTATransaction(t);
-                    }
-
-                    // We know we are in the managed environment and
-                    // JTA transaction is  active. We need to start
-                    // JDO Transaction internally if it is not active.
-    
-                    Transaction tx = pm.currentTransaction();
-                    if (!tx.isActive()) {
-                        ((TransactionImpl)tx).begin(t);
-                    }
-                }
-            }      
-            if (!(pm.verify(userid, password))) {
-                throw new JDOUserException(msg.msg(
-                    "EXC_WrongUsernamePassword")); //NOI18N
-            }
-        } else {
-            // We don't know if we are in the managed environment or not
-            // If Yes, it is BMT with JDO Transaction and it will register
-            // itself when user calls begin().
-            pm = getFromPool(userid, password);
-        }
-
-        // Always return a wrapper
-        return new PersistenceManagerWrapper(pm);
-    }
-
-
-    /**
-     * Registers PersistenceManager in the transactional cache in
-     * managed environment in case of BMT with JDO Transaction.
-     * There is no javax.transaction.Transaction
-     * available before the user starts the transaction.
-     * @param pm the PersistenceManager
-     * @param t the Transaction used as the hashmap key
-     */
-    protected void registerPersistenceManager(
-        PersistenceManagerImpl pm,
-        Object t) {
-
-        if (debugging())
-            debug("registerPersistenceManager"); // NOI18N
-
-        PersistenceManagerImpl pm1 = (PersistenceManagerImpl)pmCache.get(t);
-        if (pm1 == null) {
-            synchronized (pmCache) {
-                pm1 = (PersistenceManagerImpl)pmCache.get(t);
-                if (pm1 == null) {
-                    pmCache.put(t, pm);
-                    pm.setJTATransaction(t);
-                    return;
-                }
-            }
-        }
-
-        if (pm1 != pm){
-            throw new JDOFatalInternalException(msg.msg(
-                "EXC_WrongJTATransaction")); //NOI18N
-
-        } else {
-            // do nothing ???
-        }
-    }
-
-    /** Deregisters PersistenceManager that is not associated with
-     * a JTA transaction any more.
-     * @param pm the PersistenceManager
-     * @param t the Transaction used as the hashmap key
-     */
-    protected void deregisterPersistenceManager(PersistenceManagerImpl pm,
-        Object t) {
-        if (debugging())
-            debug("deregisterPersistenceManager"); // NOI18N
-
-        if (t != null) {        // Managed environment
-            // Deregister 
-            PersistenceManagerImpl pm1 = (PersistenceManagerImpl)pmCache.get(t);
-            if (pm1 == null || pm1 != pm) {
-                throw new JDOFatalInternalException(msg.msg(
-                    "EXC_WrongJTATransaction")); //NOI18N
-            } else {
-                pmCache.remove(t);
-            }
-        }
-    }
-
-    /** Releases closed PersistenceManager that is not in use
-     * @param pm the PersistenceManager
-     * @param t the Transaction used as the hashmap key
-     */
-    protected void releasePersistenceManager(PersistenceManagerImpl pm,
-        Object t) {
-        if (debugging())
-            debug("releasePersistenceManager"); // NOI18N
-
-        deregisterPersistenceManager(pm, t);
-        releaseStoreManager(pm);
-        returnToPool(pm);
-    }
-
-    //
-    // Internal methods
-    //
-    
-    /**
-     * Finds PersistenceManager for this combination of userid and password
-     * in the free pool, or creates new one if not found.
-     */
-    private synchronized PersistenceManagerImpl getFromPool(
-        String userid, String password) {
-
-        if (debugging())
-            debug("getFromPool"); // NOI18N
-
-        // We do not have pooling yet...
-
-        // create new PersistenceManager object and set its atributes
-        PersistenceManagerImpl pm = 
-        (PersistenceManagerImpl)createPersistenceManager(userid, password);
-        synchronized(closeLock) {
-            if (closed) {
-                throw new JDOUserException(
-                    msg.msg("EXC_PersistenceManagerFactoryClosed")); // NOI18N
-            }
-            pmSet.add(pm);
-        }
-
-        return pm;
-    }
-
-    /**
-     * Returns unused PersistenceManager to the free pool
-     */
-    private void returnToPool(PersistenceManagerImpl pm) {
-        if (debugging())
-            debug("returnToPool"); // NOI18N
-
-        // do nothing for now except remove from set of PersistenceManagers.
-        synchronized(closeLock) {
-            pmSet.remove(pm);
-        }
-    }
-
-    /**
-     * Asserts that change to the property is allowed
-     */
-    private void assertConfigurable() {
-        synchronized(closeLock) {
-            if (!configurable) {
-                throw new JDOUserException (msg.msg("EXC_NotConfigurable")); // NOI18N
-            }
-        }
-    }
-
-    /**
-     * Tracing method
-     * @param msg String to display
-     */
-    private void debug(String msg) {
-        logger.debug("In PersistenceManagerFactoryImpl " + msg); //NOI18N
-    }
-
-    /**
-     * Verifies if debugging is enabled.
-     * @return true if debugging is enabled.
-     */
-    private boolean debugging() {
-        return logger.isDebugEnabled();
-    }
-
-
-    //
-    // Explicit {read, write}Object support for java.io.Serializable so that
-    // we can en/de-crypt the password
-    //
-
-    // The PMF is serialized in one of 3 forms, depending on how it is
-    // configured.
-    private int getSerializedForm() {
-        int rc = 0;
-        if (null != connectionFactory) {
-            rc = PERSIST_CF;
-        } else if (null != connectionFactoryName) {
-            rc = PERSIST_CF_NAME;
-        } else {
-            rc = PERSIST_PROPS;
-        }
-        return rc;
-    }
-
-    /**The PMF is serialized in one of 3 forms, depending on how it is
-     * configured.  This method examines a properties instance to determine
-     * which form it is.
-     */
-    private int getSerializedForm(Properties props) {
-        int rc = 0;
-        if (null == props.get("javax.jdo.option.ConnectionURL")) { // NOI18N
-            rc = PERSIST_CF;
-        } else if (null != props.get("javax.jdo.option.ConnectionFactoryName")) { // NOI18N
-            rc = PERSIST_CF_NAME;
-        } else {
-            rc = PERSIST_PROPS;
-        }
-        return rc;
-    }
-
-    /**
-     * Write this object to a stream.  This method is provided so it
-     * can be called from outside the class (explicitly by a subclass).
-     * @param oos the ObjectOutputStream
-     * @throws IOException on errors writing to the stream
-     */    
-    protected void doWriteObject(java.io.ObjectOutputStream oos)
-        throws java.io.IOException {
-
-        writeObject(oos);
-    }
-    
-    private void writeObject(java.io.ObjectOutputStream oos)
-        throws java.io.IOException {
-        int kind = getSerializedForm();
-        oos.writeInt(kind);
-
-        switch(kind) {
-            case PERSIST_CF:
-                oos.writeObject(connectionFactory);
-                break;
-
-            case PERSIST_CF_NAME:
-                oos.writeUTF(connectionFactoryName);
-                oos.writeUTF(connectionFactory2Name);
-                break;
-
-            case PERSIST_PROPS:
-                oos.writeObject(URL);
-                oos.writeObject(userName);
-                oos.writeObject(encrypt(password));
-                oos.writeObject(driverName);
-                break;
-        }                                        
-        oos.writeBoolean(multithreaded);
-        oos.writeBoolean(optimistic);
-        oos.writeBoolean(retainValues);
-        oos.writeBoolean(restoreValues);
-        oos.writeBoolean(nontransactionalRead);
-        oos.writeBoolean(nontransactionalWrite);
-        oos.writeBoolean(ignoreCache);
-        
-        oos.writeInt(queryTimeout);
-        oos.writeInt(updateTimeout);
-    }
-
-    /**
-     * Read this object from a stream.  This method is provided so it
-     * can be called from outside the class (explicitly by a subclass).
-     * @param ois the ObjectInputStream
-     * @throws IOException on errors reading from the stream
-     * @throws ClassNotFoundException if a referenced class cannot be loaded
-     */    
-    protected void doReadObject(java.io.ObjectInputStream ois)
-        throws java.io.IOException, ClassNotFoundException {
-
-        readObject(ois);
-    }
-
-    private void readObject(java.io.ObjectInputStream ois)
-        throws java.io.IOException, ClassNotFoundException {
-
-        int kind = ois.readInt();
-        switch (kind) {
-          case PERSIST_CF:
-              connectionFactory = ois.readObject();
-              break;
-              
-          case PERSIST_CF_NAME:
-              connectionFactoryName = ois.readUTF();
-              connectionFactory2Name = ois.readUTF();
-              break;
-              
-          case PERSIST_PROPS:
-              URL = (String)ois.readObject();
-              userName = (String)ois.readObject();
-              password = decrypt((String)ois.readObject());
-              driverName = (String)ois.readObject();
-              break;
-        }
-        multithreaded = ois.readBoolean();
-        optimistic = ois.readBoolean();
-        retainValues = ois.readBoolean();
-        restoreValues = ois.readBoolean();
-        nontransactionalRead = ois.readBoolean();
-        nontransactionalWrite = ois.readBoolean();
-        ignoreCache = ois.readBoolean();
-        
-        queryTimeout = ois.readInt();
-        updateTimeout = ois.readInt();
-    }
-
-    /**
-     * The preferred way of getting & restoring a PMF in JNDI is to do so via
-     * a Properties object.
-     *
-     * Accessor instances allow copying values to/from a PMF and a
-     * Properties.  They do the proper type translation too.
-     * The PMFAccessor extends the Accessor interface which provides only
-     * the getDefault method which is type-independent.  The PMFAccessor
-     * provides type-specific accessor properties.
-     */
-    public interface PMFAccessor extends Accessor {
-        
-        /** Returns a value from a PMF, turned into a String.
-         * @param pmf the PersistenceManagerFactory to get the property from
-         * @return  the property value associated with the Accessor key
-         */
-        public String get(PersistenceManagerFactoryImpl pmf);
-        
-        /** Returns a value from a PMF, turned into a String, only if the
-         * current value is not the default.
-         * @param pmf the PersistenceManagerFactory to get the property from
-         * @return  the non-default property value associated with the
-         * Accessor key
-         */
-        public String getNonDefault(PersistenceManagerFactoryImpl pmf);
-        
-        /** Sets a value in a PMF, translating from String to the PMF's
-         * representation.
-         * @param pmf the PersistenceManagerFactory to set the property into
-         * @param s the property value associated with the Accessor key 
-         */
-        public void set(PersistenceManagerFactoryImpl pmf, String s);
-    }
-    
-    /**
-     * Tables which map from names to PMFAccessors.  The names are the same as
-     * the PMF's property names.
-     *
-     * These PMFAccessors are particular to the case when the connection
-     * properties are configured as PersistenceManagerFactory properties;
-     * neither a connection
-     * factory nor connection factory name has been configured.
-     */
-    protected static HashMap pmfAccessors = new HashMap(4);
-    
-    /**
-     *These PMFAccessors are for configuring non-connection properties.
-     */
-    protected static HashMap propsAccessors = new HashMap(10);
-    
-    /** Get JDO implementation-specific properties
-     * (not specified by JDO specification).
-     * @return a hashmap of accessors
-     */    
-    protected HashMap getLocalAccessors() {
-        return new HashMap();
-    }
-
-    /** Initialize the Accessor hashmaps for
-    * connection and non-connection properties.
-    * <br>
-    * XXX: Jikes bug
-    * <br>
-    * If this is protected, FOStorePMF.initPropsAccessors cannot invoke it,
-    * due to a bug in jikes
-    * (http://www-124.ibm.com/developerworks/bugs/?func=detailbug&bug_id=213&group_id=10)
-     */
-    //protected static void initPropsAccessors() {
-    public static void initPropsAccessors() {
-        if (pmfAccessors.size() != 0)
-            return;
-        synchronized (pmfAccessors) {
-            if (pmfAccessors.size() != 0)
-                return;
-            //
-            // PMF accessors
-            //
-
-            pmfAccessors.put(
-                "javax.jdo.option.ConnectionURL", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return pmf.getConnectionURL(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return pmf.getConnectionURL(); }
-                public String getDefault() {return null;}
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setConnectionURL(s); }
-            });
-            pmfAccessors.put(
-                "javax.jdo.option.ConnectionUserName", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return pmf.getConnectionUserName(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return pmf.getConnectionUserName(); }
-                public String getDefault() {return null;}
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setConnectionUserName(s); }
-            });
-            pmfAccessors.put(
-                "javax.jdo.option.ConnectionPassword", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return pmf.encrypt(pmf.getConnectionPassword()); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return pmf.encrypt(pmf.getConnectionPassword()); }
-                public String getDefault() {return null;}
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setConnectionPassword(pmf.decrypt(s)); }
-            });
-            pmfAccessors.put(
-                "javax.jdo.option.ConnectionDriverName", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return pmf.getConnectionDriverName(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return pmf.getConnectionDriverName(); }
-                public String getDefault() {return null;}
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setConnectionDriverName(s); }
-            });
-
-            //
-            // Props accessors
-            //
-
-            propsAccessors.put(
-                "javax.jdo.option.Multithreaded", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return new Boolean(pmf.getMultithreaded()).toString(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (!pmf.getMultithreaded())?null:"true"; } // NOI18N
-                public String getDefault() { return "false"; } // NOI18N
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setMultithreaded(Boolean.valueOf(s).booleanValue()); }
-            });
-            propsAccessors.put(
-                "javax.jdo.option.Optimistic", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return new Boolean(pmf.getOptimistic()).toString(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (pmf.getOptimistic())?null:"false"; } // NOI18N
-                public String getDefault() { return "true"; } // NOI18N
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setOptimistic(Boolean.valueOf(s).booleanValue()); }
-            });
-            propsAccessors.put(
-                "javax.jdo.option.RetainValues", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return new Boolean(pmf.getRetainValues()).toString(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (pmf.getRetainValues())?null:"false"; } // NOI18N
-                public String getDefault() { return "true"; } // NOI18N
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setRetainValues(Boolean.valueOf(s).booleanValue()); }
-            });
-            propsAccessors.put(
-                "javax.jdo.option.RestoreValues", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return new Boolean(pmf.getRestoreValues()).toString(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (pmf.getRestoreValues())?null:"false"; } // NOI18N
-                public String getDefault() { return "true"; } // NOI18N
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setRestoreValues(Boolean.valueOf(s).booleanValue()); }
-            });
-            propsAccessors.put(
-                "javax.jdo.option.NontransactionalRead", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return new Boolean(pmf.getNontransactionalRead()).toString(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (pmf.getNontransactionalRead())?null:"false"; } // NOI18N
-                public String getDefault() { return "true"; } // NOI18N
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setNontransactionalRead(Boolean.valueOf(s).booleanValue()); }
-            });
-            propsAccessors.put(
-                "javax.jdo.option.NontransactionalWrite", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return new Boolean(pmf.getNontransactionalWrite()).toString(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (!pmf.getNontransactionalWrite())?null:"true"; } // NOI18N
-                public String getDefault() { return "false"; } // NOI18N
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setNontransactionalWrite(Boolean.valueOf(s).booleanValue()); }
-            });
-            propsAccessors.put(
-                "javax.jdo.option.IgnoreCache", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return new Boolean(pmf.getIgnoreCache()).toString(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (pmf.getIgnoreCache())?null:"false"; } // NOI18N
-                public String getDefault() { return "true"; } // NOI18N
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setIgnoreCache(Boolean.valueOf(s).booleanValue()); }
-            });
-            propsAccessors.put(
-                "javax.jdo.option.ConnectionFactoryName", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return pmf.getConnectionFactoryName(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (pmf.getConnectionFactoryName()==null)?null:pmf.getConnectionFactoryName(); }
-                public String getDefault() { return null; }
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setConnectionFactoryName(s); }
-            });
-            propsAccessors.put(
-                "javax.jdo.option.ConnectionFactory2Name", // NOI18N
-                new PMFAccessor() {
-                public String get(PersistenceManagerFactoryImpl pmf) { return pmf.getConnectionFactory2Name(); }
-                public String getNonDefault(PersistenceManagerFactoryImpl pmf) { return (pmf.getConnectionFactory2Name()==null)?null:pmf.getConnectionFactory2Name(); }
-                public String getDefault() { return null; }
-                public void set(PersistenceManagerFactoryImpl pmf, String s) { pmf.setConnectionFactory2Name(s); }
-            });
-        }
-    }
-
-    /**
-     * It should *never* be the case that our translation process encounters
-     * a NumberFormatException.  If so, tell the user in the JDO-approved
-     * manner.
-     * @param s the input String
-     * @return the int representation of the String
-     */ 
-    protected static int toInt(String s) {
-        int rc = 0;
-        try {
-            rc = Integer.parseInt(s);
-        } catch (NumberFormatException ex) {
-            throw new JDOFatalInternalException(msg.msg(
-                    "EXC_IntegerInInvalidFormat")); // NOI18N
-        }
-        return rc;
-    }
-
-    /**
-     * Returns a Properties representation of this PMF.
-     * Only allow Properties representation if the caller configured
-     * this PersistenceManagerFactory.  Otherwise, this is a security
-     * exposure.
-     * @return the Properties representing the non-default properties
-     */
-    public Properties getAsProperties() {
-        assertConfigurable();
-        return getAsPropertiesInternal();
-    }
-
-    /** 
-     * Does not do assertConfigurable validation
-     * @see #getAsProperties()
-     */
-    protected Properties getAsPropertiesInternal() {
-        initPropsAccessors();
-        Properties p = new Properties();
-
-        int kind = getSerializedForm();
-
-        switch (kind) {
-          case PERSIST_CF:
-              // XXX need to handle the case of ConnectionFactory2
-              setCFProperties(p);
-              break;
-
-          case PERSIST_CF_NAME:
-              p.setProperty ("javax.jdo.option.ConnectionFactoryName",
-                             connectionFactoryName); // NOI18N
-              if (connectionFactory2Name != null) {
-                  p.setProperty ("javax.jdo.option.ConnectionFactory2Name",
-                                 connectionFactory2Name); // NOI18N
-              }
-              break;
-
-          case PERSIST_PROPS:
-              setProps(p, pmfAccessors);
-              break;
-        }
-        setProps(p, propsAccessors);
-        setPMFClassProperty(p);
-        // add the properties from the implementation class
-        setProps(p, getLocalAccessors());
-        return p;
-    }
-    
-    /** Set the PMF class property for this PMF.
-     * @param props the Properties to which to add the PMF class property
-     */
-    abstract protected void setPMFClassProperty (Properties props);
-
-    /**
-     * For each PMFAccessor in the given HashMap, gets the corresponding value
-     * from the PMF and puts it in the given Properties object.
-     */
-    void setProps(Properties p, HashMap accessors) {
-        Set s = accessors.entrySet();
-        for (Iterator i = s.iterator(); i.hasNext();) {
-            Map.Entry e = (Map.Entry)i.next();
-            String key = (String)e.getKey();
-            PMFAccessor a = (PMFAccessor)e.getValue();
-            String value = (String)a.getNonDefault(this);
-            if (null != value) {
-                p.setProperty (key, value);
-            }
-        }
-    }
-
-    /**
-     * Configures a PMF from the given Properties.
-     * @param p the Properties used to configure this PMF
-     */
-    public void setFromProperties(Properties p) {
-        initPropsAccessors();
-        assertConfigurable();
-        int kind = getSerializedForm (p);
-
-        switch (kind) {
-          case PERSIST_CF:
-              getCFFromProperties(p);
-              break;
-
-          case PERSIST_CF_NAME:
-              connectionFactoryName = p.getProperty(
-                  "javax.jdo.option.ConnectionFactoryName"); // NOI18N
-              connectionFactory2Name = p.getProperty(
-                  "javax.jdo.option.ConnectionFactory2Name"); // NOI18N
-              break;
-
-          case PERSIST_PROPS:
-              getProps(p, pmfAccessors);
-              break;
-        }
-        getProps(p, propsAccessors);
-        getProps(p, getLocalAccessors());
-    }
-
-    /**
-     * For each PMFAccessor in the given HashMap, gets the corresponding value
-     * from the Properties and sets that value in the PMF.
-     */
-    private void getProps(Properties p, HashMap accessors) {
-        Set s = accessors.entrySet();
-        for (Iterator i = s.iterator(); i.hasNext();) {
-            Map.Entry e = (Map.Entry)i.next();
-            String key = (String)e.getKey();
-            String value = p.getProperty(key);
-            if (null != value) {
-//                System.out.println("PersistenceManagerFactoryImpl setting property: " + key + " to: " + value); // NOI18N
-                PMFAccessor a = (PMFAccessor)e.getValue();
-                a.set(this, value);
-            }
-        }
-    }
-
-    /**
-     * Provides an encrypted version of the given string.
-     * <b>NOTE:</b>
-     * Be very sure that you implement this method using the kind of
-     * security that is appropriate for your JDO implementation!!!
-     * Note that this method is not static, because it must be overridden
-     * by the specialized subclass.  But it should be written as if it were
-     * static.  That is, it should not use any state in the
-     * PersistenceManagerFactoryImpl instance.
-     * @param s the String to be encrypted
-     * @return the encrypted String
-     */
-    abstract protected String encrypt(String s);
-
-    /**
-     * Provides a decrypted version of the given (encrypted) string.
-     * <b>NOTE:</b>
-     * Be very sure that you implement this method using the kind of
-     * security that is appropriate for your JDO implementation!!!
-     * @param s the String to be decrypted
-     * @return the decrypted String
-     */
-    abstract protected String decrypt(String s);
-
-    /**
-     * Set the PMF-specific ConnectionFactory's properties.
-     * @param p Properties object in which the PMF's ConnectioFactory's
-     * properties are to be set.
-     */
-    abstract protected void setCFProperties(Properties p);
-
-    /**
-     * Create a ConnectionFactory for this PMF.  The method's implementation
-     * should set the PMF's connection factory with the newly created object.
-     * @param p Properties from which the ConnectionFactory is to be created.
-     */
-        // XXX The method name contains "get" but this does not "get"
-        // anything.  It should be changed to "setup" or ???
-    abstract protected void getCFFromProperties(Properties p);
-
-    /**
-     * Returns if a connection factory is configured for this
-     * PersistenceManagerFactory. This is used to determine whether
-     * this PersistenceManagerFactory has been configured with a
-     * ConnectionFactory, a ConnectionFactoryName, or a ConnectionURL.
-     * @return if a connection factory is configured
-     */
-    abstract protected boolean isConnectionFactoryConfigured();
-    
-    /** The String representation of this PMF.
-     * @return the String representation of this PMF
-     */    
-    public String toString() {
-        return "" + // NOI18N
-            "URL: " + URL + "\n" + // NOI18N
-            "userName: " + userName + "\n" + // NOI18N
-            "password: " + password + "\n" + // NOI18N
-            "driverName: " + driverName + "\n" + // NOI18N
-
-            "connectionFactory: " + connectionFactory + "\n" + // NOI18N
-            "connectionFactoryName: " + connectionFactoryName + "\n" + // NOI18N
-
-            "connectionFactory2: " + connectionFactory2 + "\n" + // NOI18N
-            "connectionFactory2Name: " + connectionFactory2Name + "\n" + // NOI18N
-
-            "multithreaded: " + multithreaded + "\n" + // NOI18N
-            "optimistic: " + optimistic + "\n" + // NOI18N
-            "retainValues: " + retainValues + "\n" + // NOI18N
-            "restoreValues: " + restoreValues + "\n" + // NOI18N
-            "nontransactionalRead: " + nontransactionalRead + "\n" + // NOI18N
-            "nontransactionalWrite: " + nontransactionalWrite + "\n" + // NOI18N
-            "ignoreCache: " + ignoreCache + "\n" + // NOI18N
-            "queryTimeout: " + queryTimeout + "\n" + // NOI18N
-            "updateTimeout: " + updateTimeout + "\n"; // NOI18N
-    }
-    
-    /** Verify that the connection URL has been configured.
-     * This might be done by the PMF property ConnectionURL,
-     * or by the connection factory property URL, or
-     * by configuring a connection factory name.
-     */    
-    protected void verifyConfiguration() {
-        if ((!isConnectionFactoryConfigured()) &&
-            (connectionFactoryName == null) &&
-            (URL == null)) {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_IncompleteConfiguration")); // NOI18N
-        }
-    }
-        
-    /**
-     * Set the configurable flag false so this
-     * PersistenceManagerFactory can no longer be configured.  No value is
-     * provided, because a PersistenceManagerFactory can never become
-     * re-configurable.  Once invoked, the hashCode() of this PMF will never
-     * change, except if setNonconfigured is called.
-     * @see #hashCode()
-     * @see #setNonconfigured()
-     */        
-    protected void setConfigured() {
-        configurable = false;
-        myHashCode = hashCode();
-    }
-
-    /**
-     * Set the configurable flag true so this
-     * PersistenceManagerFactory can be again configured.  Called only
-     * if the action caused change to be non-configurable failed.
-     */        
-    protected void setNonconfigured() {
-        configurable = true;
-        myHashCode = 0;
-    }
-
-    /** Given an input Properties instance, add to the output Properties instance
-     * only the non-default entries of the input Properties, based on the
-     * Accessor map provided.  The output instance can be used as the key
-     * for the PersistenceManagerFactory hashMap.
-     *
-     * <P>A properties instance will typically be filtered a number of times:
-     * once for the JDO standard PersistenceManagerFactory properties, another
-     * for the JDO implementation properties, and another for the implementation
-     * ConnectionFactory properties.
-     *
-     * <P>A properties accessor map is passed as an argument.  The map
-     * contains the PMFAccessors, keyed by property name.
-     * @param props the input Properties
-     * @param filtered the output properties
-     * @param accessors the hashmap of accessors to filter for
-     */
-    public static void filterProperties (Properties props, Properties filtered,
-                                         Map accessors) {
-        Set s = accessors.entrySet();
-        for (Iterator i = s.iterator(); i.hasNext();) {
-            // for each accessor defined
-            Map.Entry e = (Map.Entry)i.next();
-            String key = (String)e.getKey();
-            // if the key in the accessor matches a property in the properties
-            String value = props.getProperty(key);
-            // and if the property is not null
-            if (null != value) {
-                Accessor a = (Accessor)e.getValue();
-                // and the value is not the default value for the accessor
-                if (a.getDefault() != value) {
-                    // set the property in the filtered properties
-                    filtered.setProperty (key, value);
-                }
-            }
-        }
-        return;
-    }
-
-    public synchronized boolean equals(Object o) {
-        if (o == this)
-            return true;
-
-        if (!(o instanceof PersistenceManagerFactoryImpl))
-            return false;
-
-	return (this.getAsPropertiesInternal().equals(
-            ((PersistenceManagerFactoryImpl)o).getAsPropertiesInternal()));
-    }
-
-    /** The returned value can change before this PMF is configured.  Once
-    * configured it will never change (well...)
-    * @see #setConfigured()
-    * @see #setNonconfigured()
-    */
-    public synchronized int hashCode() {
-        if (0 == myHashCode) {
-            return this.getAsPropertiesInternal().hashCode();
-        } else {
-            return myHashCode;
-        }
-    }
-    
-    /** Close this PersistenceManagerFactory. Check for
-     * JDOPermission("closePersistenceManagerFactory") and if not authorized,
-     * throw SecurityException.
-     * <P>If the authorization check succeeds, check to see that all
-     * PersistenceManager instances obtained from this PersistenceManagerFactory
-     * have no active transactions. If any PersistenceManager instances have
-     * an active transaction, throw a JDOUserException, with one nested
-     * JDOUserException for each PersistenceManager with an active Transaction.
-     * <P>If there are no active transactions, then close all PersistenceManager
-     * instances obtained from this PersistenceManagerFactory, mark this
-     * PersistenceManagerFactory as closed, disallow getPersistenceManager
-     * methods, and allow all other get methods. If a set method or
-     * getPersistenceManager method is called after close, then
-     * JDOUserException is thrown.
-     */
-    public void close() {
-        synchronized(closeLock) {
-            if (closed) {
-                return;
-            }
-            SecurityManager secmgr = System.getSecurityManager();
-            if (secmgr != null) {
-                // checkPermission will throw SecurityException if not authorized
-                secmgr.checkPermission(JDOPermission.CLOSE_PERSISTENCE_MANAGER_FACTORY);
-            }
-            List activePersistenceManagers = getActivePersistenceManagers();
-            int size = activePersistenceManagers.size();
-            if (size != 0) {
-                Throwable[] thrown = new Throwable[size];
-                for (int i = 0; i < size; ++i) {
-                    PersistenceManagerImpl pm = 
-                        (PersistenceManagerImpl)activePersistenceManagers.get(i);
-                    thrown[i] = new JDOUserException(
-                        msg.msg("EXC_ActivePersistenceManager"), // NOI18N
-                        pm.getCurrentWrapper());
-                    }
-                throw new JDOUserException(
-                    msg.msg("EXC_ActivePersistenceManager"), thrown); // NOI18N
-            }
-            closeOpenPersistenceManagers();
-            // pmf is closed => remove it from collection of registered pmfs
-            registeredPMFs.remove(this);
-            setConfigured();
-            closed = true;
-        }
-    }
-    
-    /** 
-     * A <code>PersistenceManagerFactory</code> instance can be used 
-     * until it is closed.
-     * @return <code>true</code> if this <code>PersistenceManagerFactory</code>
-     * has been closed.
-     * @see #close()
-     * @since 2.0
-     */
-    public boolean isClosed() {
-        synchronized(closeLock) {
-            return closed;
-        }
-    }
-
-    /** Assert that this PersistenceManagerFactory is not closed.  This
-     * assertion precedes all getPersistenceManager calls.  "set" methods
-     * are already protected by the configured flag.
-     * This method is synchronized so if another thread is calling
-     * close at the same time, this thread will wait for the close to complete.
-     */
-    protected void assertNotClosed() {
-        synchronized(closeLock) {
-            if (closed) {
-                throw new JDOUserException(
-                    msg.msg("EXC_PersistenceManagerFactoryClosed")); // NOI18N
-            }
-        }
-    }
-    
-    /** Get all active PersistenceManagers.  This is all 
-     * PersistenceManagers that have active transactions.
-     */
-    protected List getActivePersistenceManagers() {
-        List pms = new ArrayList();
-        for (Iterator it=pmSet.iterator(); it.hasNext();) {
-            PersistenceManager pm = (PersistenceManager)it.next();
-            if (pm.currentTransaction().isActive()) {
-                pms.add(pm);
-            }
-        }
-        return pms;
-    }
-    
-    /** Close all open PersistenceManagers.  Only the PersistenceManagers
-     * in the non-transactional set are considered; there cannot be any
-     * inactive PersistenceManagers in the transactional cache.
-     * We do forceClose because we don't care if there are active wrappers.
-     */
-    protected void closeOpenPersistenceManagers() {
-        // copy to avoid concurrent modification; forceClose changes pmSet.
-        List toClose = Arrays.asList(pmSet.toArray()); 
-        for (Iterator it=toClose.iterator(); it.hasNext();) {
-            PersistenceManagerImpl pm = (PersistenceManagerImpl)it.next();
-            pm.forceClose();
-        }
-    }
-    
-
-    /** Method called by the shudown hook to close pmf instances left open 
-     * when the JVM exits.
-     */
-    protected void shutdown() {
-        closeOpenPersistenceManagers();
-    }
-
-    /** Shutdown hook to close pmf instances left open when the JVM
-     * exits. 
-     */ 
-    static class ShutdownHook extends Thread {
-        public void run() {
-            for (Iterator i = registeredPMFs.iterator(); i.hasNext();) {
-                try {
-                    ((PersistenceManagerFactoryImpl)i.next()).shutdown();
-                }
-                catch (JDOException ex) {
-                    // ignore
-                }
-            }
-        }
-    }
-}
-
diff --git a/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java b/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java
deleted file mode 100644
index 2656578..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerImpl.java
+++ /dev/null
@@ -1,2603 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * PersistenceManagerImpl.java
- *
- * Created on December 1, 2000
- */
-
-package org.apache.jdo.impl.pm;
-
-import java.lang.reflect.Constructor;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.jdo.Extent;
-import javax.jdo.FetchPlan;
-import javax.jdo.JDOException;
-import javax.jdo.JDOFatalInternalException;
-import javax.jdo.JDOFatalUserException;
-import javax.jdo.JDOUserException;
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
-import javax.jdo.Query;
-import javax.jdo.Transaction;
-import javax.jdo.datastore.JDOConnection;
-import javax.jdo.datastore.Sequence;
-import javax.jdo.listener.InstanceLifecycleListener;
-import javax.jdo.spi.PersistenceCapable;
-import javax.transaction.Status;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jdo.impl.model.java.runtime.RuntimeJavaModelFactory;
-import org.apache.jdo.model.java.JavaModel;
-import org.apache.jdo.model.java.JavaType;
-import org.apache.jdo.model.jdo.JDOClass;
-import org.apache.jdo.pm.PersistenceManagerFactoryInternal;
-import org.apache.jdo.pm.PersistenceManagerInternal;
-import org.apache.jdo.sco.SCOCollection;
-import org.apache.jdo.sco.SCOMap;
-import org.apache.jdo.state.StateManagerInternal;
-import org.apache.jdo.store.StoreManager;
-import org.apache.jdo.util.I18NHelper;
-import org.apache.jdo.util.JDORIVersion;
-
-/** 
- * This is the StoreManager independent implemetation of the 
- * org.apache.jdo.pm.PersistenceManagerInternal interface. Delegates most of 
- * the method execution to the corresponding instance of the CacheManagerImpl.
- * 
- * @author Marina Vatkina
- */ 
-public abstract class PersistenceManagerImpl implements PersistenceManagerInternal {
-    
-    /**
-     * True if this PersistenceManager is closed
-     */
-    private boolean _isClosed = true;
-
-    /**
-     * Associated Transaction
-     */
-    private TransactionImpl _transaction = null;
-
-    /**
-     *  Reference to the associated JTA Transaction if any
-     */
-    private Object _jta = null;
-
-    /**
-     * Current PersistenceManagerWrapper as PersistenceManagerInternal
-     */
-    private PersistenceManagerWrapper current = null;
-
-    /**
-     * PersistenceManagerFactory that created (and could be pooling)
-     * this PersistenceManager
-     */
-    private PersistenceManagerFactoryImpl pmf = null;
-
-    /**
-     * Reference to the CacheManager
-     */
-    private CacheManagerImpl _txCache = null;
-
-    /**
-     * Reference to the StoreManager
-     */
-    private StoreManager _storeManager = null;
-    
-    /**
-     * Flag for Query. 
-     * Constructor defaults it to the PMF setting.
-     */
-    private boolean _ignoreCache;
-
-    /**
-     * Flag for detaching all objects upon PM commit. 
-     * Constructor defaults it to the PMF setting.
-     */
-    private boolean _detachAllOnCommit;
-
-    /**
-     * Flag for active transaction
-     */
-    private boolean _activeTransaction = false;
-
-    /**
-     * Flag for optimistic transaction
-     */
-    private boolean optimistic = true;
-    
-    /**
-     * Flag for multithreaded support.
-     */
-    private boolean multithreaded = true;
-
-    /**
-     * User Object
-     */
-    private Object _userObject = null;
-
-    /**
-     * Flag for flushing process
-     */
-    private boolean _flushing = false;
-
-    /**
-     * This is the ClassLoader that was the
-     *     Thread.currentThread().getContextClassLoader()
-     * at the time this PersistenceManagerImpl was created.
-     */
-    private final ClassLoader myClassLoader;
-
-    /**
-     * Constructor signatures 
-     */
-    private static final Class[] sigSCO_Short = new Class []{
-        java.lang.Object.class,
-        java.lang.String.class};
-
-        /** The signature for SCO  Collections.
-         */        
-    private static final Class[] sigSCO_Collection = new Class []{
-        java.lang.Class.class,
-        boolean.class,
-        int.class};
-
-        /** The signature for SCO  Maps.
-         */        
-    private static final Class[] sigSCO_Map = new Class []{
-        java.lang.Class.class,
-        java.lang.Class.class,
-        boolean.class,
-        int.class};
-
-        /** The signature for SCO HashSet.
-         */        
-    private static final Class[] sigSCO_HashSet = new Class []{
-        java.lang.Class.class,
-        boolean.class,
-        int.class,
-        float.class};
-
-        /** The signature for SCO TreeSet.
-         */        
-    private static final Class[] sigSCO_TreeSet = new Class []{
-        java.lang.Class.class,
-        boolean.class,
-        java.util.Comparator.class};
-
-        /** The signature for SCO HashMap.
-         */        
-    private static final Class[] sigSCO_HashMap = new Class []{
-        java.lang.Class.class,
-        java.lang.Class.class,
-        boolean.class,
-        int.class,
-        float.class};
-
-        /** The signature for SCO TreeMap.
-         */        
-    private static final Class[] sigSCO_TreeMap = new Class []{
-        java.lang.Class.class,
-        java.lang.Class.class,
-        boolean.class,
-        java.util.Comparator.class};
-
-        /** Default initialCapacity values.
-         */        
-    private static final Integer int11 = new Integer(11);
-    private static final Integer int10 = new Integer(10);
-
-    /** RuntimeJavaModelFactory. */
-    private static final RuntimeJavaModelFactory javaModelFactory =
-        (RuntimeJavaModelFactory) AccessController.doPrivileged(
-            new PrivilegedAction () {
-                public Object run () {
-                    return RuntimeJavaModelFactory.getInstance();
-                }
-            }
-        );
- 
-    /**
-     * Logger support
-     */
-    private static final Log logger = LogFactory.getFactory().getInstance(
-        "org.apache.jdo.impl.pm"); // NOI18N
-
-    /**
-     * I18N message handler
-     */
-    protected final static I18NHelper msg = 
-        I18NHelper.getInstance(PersistenceManagerImpl.class);
-
-    /**
-     * Helper objects to identify StateManager associated with the given 
-     * PersistenceCapable instance
-     */
-    private StateManagerInternal lookingFor = null;
-    private PersistenceCapable pc = null;
-
-    /**
-     * Constructs new instance of PersistenceManagerImpl for this
-     * PersistenceManagerFactoryInternal and particular combination of 
-     * username and password.
-     *
-     * @param pmf calling PersistenceManagerFactory as PersistenceManagerFactoryInternal
-     * @param username user name used for accessing Connector or null if none 
-     *      is provided.
-     * @param password user password used for accessing Connector or null if 
-     *      none is provided.
-     */
-    public PersistenceManagerImpl(PersistenceManagerFactoryInternal pmf,
-        String username, String password) {
-
-        if (debugging())
-            debug("constructor"); // NOI18N
-
-        if (javaModelFactory == null)
-            throw new JDOUserException(
-                msg.msg("EXC_CannotGetRuntimeJavaModelFactory")); // NOI18N
-
-        this.pmf = (PersistenceManagerFactoryImpl)pmf;
-        _transaction = new TransactionImpl(this, this.pmf, username, password);
-        _txCache = new CacheManagerImpl(this);
-
-        optimistic = pmf.getOptimistic();
-        _ignoreCache = pmf.getIgnoreCache();
-        _detachAllOnCommit = pmf.getDetachAllOnCommit();
-
-        _isClosed = false;
-
-        myClassLoader = getContextClassLoaderPrivileged();
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#setIgnoreCache(boolean flag)
-     * @param flag the ignoreCache value
-     */
-    public void setIgnoreCache(boolean flag) {
-        assertIsOpen();
-        _ignoreCache = flag;
-    }
-
-    /** Get the value of the ignoreCache flag.
-     * @see javax.jdo.PersistenceManager#getIgnoreCache()
-     * @return the IgnoreCache flag
-     */
-    public boolean getIgnoreCache() {
-        assertIsOpen();
-        return _ignoreCache;
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#setDetachAllOnCommit(boolean flag)
-     * @param flag the detachAllOnCommit value
-     */
-    public void setDetachAllOnCommit(boolean flag) {
-        assertIsOpen();
-        _detachAllOnCommit = flag;
-    }
-
-    /** Get the value of the detachAllOnCommit flag.
-     * @see javax.jdo.PersistenceManager#getDetachAllOnCommit()
-     * @return the DetachAllOnCommit flag
-     */
-    public boolean getDetachAllOnCommit() {
-        assertIsOpen();
-        return _detachAllOnCommit;
-    }
-
-    /** Set the Multithreaded flag for this PersistenceManager.  Applications
-     * that use multiple threads to invoke methods or access fields from 
-     * instances managed by this PersistenceManager must set this flag to true.
-     * Instances managed by this PersistenceManager include persistent or
-     * transactional instances of PersistenceCapable classes, as well as 
-     * helper instances such as Query, Transaction, or Extent.
-     *
-     * @param flag the Multithreaded setting.
-     */
-    public void setMultithreaded(boolean flag) {
-        assertIsOpen();
-        multithreaded = flag;
-    }
-    
-    /** Get the current Multithreaded flag for this PersistenceManager.  
-     * @see #setMultithreaded
-     * @return the Multithreaded setting.
-     */
-    public boolean getMultithreaded() {
-        assertIsOpen();
-        return multithreaded;
-    }
-
-    /** Return whether this PersistenceManager is closed.
-     * @see javax.jdo.PersistenceManager#isClosed()
-     */
-    public boolean isClosed() {
-        return _isClosed;
-    }
-
-    /**
-     * Close this persistence manager
-     * @see javax.jdo.PersistenceManager#close()
-     */
-    public synchronized void close() {
-        if (debugging())
-            debug("close"); // NOI18N
-
-        assertIsOpen();
-
-        if (_activeTransaction) {
-            throw new JDOUserException(msg.msg(
-                "EXC_ActiveTransaction"));// NOI18N
-        }
-
-        if (current == null){
-            forceClose();
-        }
-
-    }
-
-    /**
-     * Returns transaction associated with this persistence manager
-     * @return transaction    current transaction
-     */
-    public Transaction currentTransaction() {
-        assertIsOpen();
-        return (Transaction) _transaction;
-    }
-
-    //
-    // -------- ObjectId related methods --------
-    //
-
-    /** This method locates a persistent instance in the cache of instances
-    * managed by this PersistenceManager.
-    *   
-    * <P>If the validate flag is true: This method verifies that there
-    * is an instance in the data store with the same oid, constructs an
-    * instance, and returns it.  If there is no transaction active, then
-    * a hollow instance or persistent non-transactional instance is returned.
-    * If there is a transaction active, then
-    * a persistent clean instance is returned.
-    * <P>If the validate flag is false: If there is not already an instance
-    * in the cache with the same oid, then an instance is constructed and
-    * returned.  If the instance does not exist
-    * in the data store, then this method will
-    * not fail.  However, a request to access fields of the instance will
-    * throw an exception.
-    * @return the PersistenceCapable instance with the specified
-    * ObjectId
-    * @param oid an ObjectId
-    * @param validate if the existence of the instance is to be validated
-    */
-    public Object getObjectById (Object oid, boolean validate) {
-        if (debugging())
-            debug("getObjectById " + oid); // NOI18N
-
-        assertIsOpen();
-        if (oid == null)
-            return null;
-
-        return _txCache.getObjectById(oid, validate);
-    }
-    /**
-     * Looks up the instance of the given type with the given key.
-     * @param cls The type of object to load
-     * @param key either the string representation of the object id, or
-     * an object representation of a single field identity key
-     * @return the corresponding persistent instance
-     * @since 2.0
-     */
-    public Object getObjectById (Class cls, Object key) {
-        throw new UnsupportedOperationException(
-            "Method getObjectById(Class,Object) not yet implemented");
-    }
-
-    /**
-     * Looks up the instance corresponding to the specified oid. This is
-     * equivalent to <code>getObjectById(oid, true);
-     * @param oid The object id of the object to load
-     * @return the corresponding persistent instance
-     * @since 2.0
-     */
-    public Object getObjectById (Object oid) {
-        return getObjectById(oid, true);
-    }
-
-    /** The ObjectId returned by this method represents the JDO identity of
-    * the instance.  The ObjectId is a copy (clone) of the internal state
-    * of the instance, and changing it does not affect the JDO identity of
-    * the instance.
-    * Delegates actual execution to the internal method.
-    * @param pc the PersistenceCapable instance
-    * @return the corresponding ObjectId of the instance. Returns null
-    * if pc is null, not persistence-capable, or not persistent.
-    */
-    public Object getObjectId (Object pc) {
-        if (debugging())
-            debug("getObjectId"); // NOI18N
-
-        return getExternalObjectId(pc, false);
-    }
-
-
-    /**
-    * @see org.apache.jdo.pm.PersistenceManagerInternal#loadClass
-    */
-    public Class loadClass(String name, ClassLoader given)
-        throws ClassNotFoundException {
-
-        Class rc = null;
-
-        if (null != given) {
-            try {
-                rc = Class.forName(name, true, given);
-            } catch (ClassNotFoundException ex) {
-            }
-        }
-
-        if (null == rc) {
-            try {
-                rc = Class.forName(
-                    name, true,
-                    getContextClassLoaderPrivileged());
-            } catch (ClassNotFoundException ex) {
-            }
-        }
-
-        if (null == rc) {
-            rc = Class.forName(name, true, myClassLoader);
-        }
-
-        return rc;            
-    }
-
-    /**
-     * @see org.apache.jdo.pm.PersistenceManagerInternal#loadPCClassForObjectIdClass
-     */
-    public Class loadPCClassForObjectIdClass(Class objectIdClass) 
-        throws ClassNotFoundException
-    {
-        if (debugging())
-            debug("loadPCClassForObjectIdClass: " + objectIdClass.getName()); //NOI18N
-
-        JavaModel javaModel = null;
-        JDOClass jdoClass = null;
-        JavaType objectIdJavaType = javaModelFactory.getJavaType(objectIdClass);
-        // try Model of objectId's class loader
-        ClassLoader classLoader = 
-            javaModelFactory.getClassLoaderPrivileged(objectIdClass);
-        javaModel = javaModelFactory.getJavaModel(classLoader);
-        jdoClass = javaModel.getJDOModel().
-            getJDOClassForObjectIdClass(objectIdJavaType);
-        
-        if (null == jdoClass) {
-            // try Model of thread context class loader
-            classLoader = getContextClassLoaderPrivileged();
-            javaModel = javaModelFactory.getJavaModel(classLoader);
-            jdoClass = javaModel.getJDOModel().
-                getJDOClassForObjectIdClass(objectIdJavaType);
-        }
-
-        if (null == jdoClass) {
-            // try Model of the pm's thead context class loader
-            javaModel = javaModelFactory.getJavaModel(myClassLoader);
-            jdoClass = javaModel.getJDOModel().
-                getJDOClassForObjectIdClass(objectIdJavaType);
-        }
-
-        if (jdoClass == null) 
-            // persistence-capable class not found => ClassNotFoundException
-            throw new ClassNotFoundException(msg.msg(
-                "EXC_CannotFindPCClassForObjectIdClass", // NOI18N
-                objectIdClass.getName())); //NOI18N
-        return javaModelFactory.getJavaClass(jdoClass.getJavaType());
-    }
-
-    /**
-     * Gets the internal object id for this instance. Returns null
-     * if it is not a PersistenceCapable instance.
-     * @param pc
-     * @return the internal object id
-     */
-    public Object getInternalObjectId(Object pc) {
-        if (debugging())
-            debug("getInternalObjectId for " + pc.getClass().getName()); // NOI18N
-
-        assertIsOpen();
-
-        Object rc = null;
-        if ( pc instanceof PersistenceCapable ) {
-            PersistenceCapable p = (PersistenceCapable)pc;
-            if( !(p.jdoIsPersistent()) ) {
-                throw new JDOFatalInternalException(msg.msg(
-                    "EXC_TransientInstance", pc.getClass().getName()));// NOI18N
-            }
-
-            StateManagerInternal sm = findStateManager(p);
-            if (sm == null) {
-                throw new JDOFatalInternalException(
-                    msg.msg("EXC_CannotFindSM", pc.getClass().getName())); // NOI18N
-            }
-            rc = sm.getInternalObjectId();
-        }
-        return rc;
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#getTransactionalObjectId
-     */
-    public Object getTransactionalObjectId (Object pc) {
-        if (debugging())
-            debug("getTransactionalObjectId"); // NOI18N
-
-        return getExternalObjectId(pc, true);
-    }
-
-    /** 
-     * This method returns an object id instance corresponding to the pcClass
-     * and key arguments.
-     * @param pcClass the <code>Class</code> of the persistence-capable instance
-     * @param key the value of the key field for single-field identity.
-     * @return an instance of the object identity class
-     */
-    public Object newObjectIdInstance (Class pcClass, Object key) {
-        if (debugging())
-            debug("newObjectIdInstance for: " + pcClass + ", and " + key); // NOI18N
-
-        assertIsOpen();
-        return this.getStoreManager().newObjectIdInstance (pcClass, key);
-    }
-    
-    /**
-     * Return the objects with the given oids.
-     * @param oids the oids of the objects to return
-     * @param validate if true, the existance of the objects in
-     *     the datastore will be validated.
-     * @return the objects that were looked up, in the
-     *     same order as the oids parameter.
-     * @see #getObjectById(Object,boolean)
-     * @since 2.0
-     */
-    public Collection getObjectsById (Collection oids, boolean validate) {
-        throw new UnsupportedOperationException(
-            "Method getObjectsById(Collection,boolean) not yet implemented");
-    }
-
-    /**
-     * Return the objects with the given oids. This method is equivalent 
-     * to calling {@link #getObjectsById(Collection, boolean)}
-     * with the validate flag true.
-     * @param oids the oids of the objects to return
-     * @return the objects that were looked up, in the
-     *     same order as the oids parameter.
-     * @see #getObjectsById(Collection,boolean)
-     * @since 2.0
-     */
-    public Collection getObjectsById (Collection oids) {
-        return getObjectsById(oids, true);
-    }
-
-    /**
-     * Return the objects with the given oids.
-     * @param oids the oids of the objects to return
-     * @param validate if true, the existance of the objects in
-     *     the datastore will be validated.
-     * @return the objects that were looked up, in the
-     *     same order as the oids parameter.
-     * @see #getObjectById(Object,boolean)
-     * @since 2.0
-     */
-    public Object[] getObjectsById (Object[] oids, boolean validate) {
-        throw new UnsupportedOperationException(
-            "Method getObjectsById(Object[],boolean) not yet implemented");
-    }
-
-    /**
-     * Return the objects with the given oids. This method is equivalent
-     * to calling {@link #getObjectsById(Object[],boolean)} 
-     * with the validate flag true.
-     * @param oids the oids of the objects to return
-     * @return the objects that were looked up, in the
-     *     same order as the oids parameter.
-     * @see #getObjectsById(Object[],boolean)
-     * @since 2.0
-     */
-    public Object[] getObjectsById (Object[] oids) {
-        return getObjectsById(oids, true);
-    }
-
-    /** Return the Class that implements the JDO Identity for the
-    * specified PersistenceCapable Class.  The application can use the
-    * returned Class to construct a JDO Identity instance for
-    * application identity PersistenceCapable classes.  This JDO Identity
-    * instance can then be used to get an instance of the
-    * PersistenceCapable class for use in the application.
-    *   
-    * <P>In order for the application to construct an instance of the ObjectId class
-    * it needs to know the class being used by the JDO implementation.
-    * @param cls the PersistenceCapable Class
-    * @return the Class of the ObjectId of the parameter
-    * @see #getObjectById
-    */  
-    public Class getObjectIdClass(Class cls) {
-        if (debugging())
-            debug("getObjectIdClass for: " + cls); // NOI18N
-
-        assertIsOpen();
-        return pmf.getObjectIdClass(cls);
-    }
-    
-    //
-    // -------- Query and Extent methods --------
-    //
-
-    /** Create a new Query with no elements.
-     * @return a new Query instance with no elements.
-     */  
-     public abstract Query newQuery();
-
-     /** Create a new Query using elements from another Query.  The other Query
-     * must have been created by the same JDO implementation.  It might be active
-     * in a different PersistenceManager or might have been serialized and
-     * restored.
-     * @return the new Query
-     * @param compiled another Query from the same JDO implementation
-     */  
-     public abstract Query newQuery (Object compiled);
-
-    /** Create a Construct a new query instance using the specified String 
-     * as the single-string representation of the query.
-     * @param query the single-string query
-     * @return the new <code>Query</code>
-     * @since 2.0
-     */
-    public abstract Query newQuery (String query);
-
-     /** Create a new Query using the specified language.
-      * @param language the language of the query parameter
-      * @param query the query, which is of a form determined by the language
-      * @return the new Query
-      */    
-     public abstract Query newQuery (String language, Object query);
-     
-     /** Create a new Query specifying the Class of the results.
-     * @param cls the Class of the results
-     * @return the new Query
-     */
-     public abstract Query newQuery (Class cls);
-
-     /** Create a new Query with the candidate Extent; the class is taken
-      * from the Extent.
-      * @return the new Query
-      * @param cln the Extent of candidate instances */  
-     public abstract Query newQuery(Extent cln);
-
-     /** Create a new Query with the Class of the results and candidate Collection.
-     * @param cls the Class of results
-     * @param cln the Collection of candidate instances
-     * @return the new Query
-     */
-     public abstract Query newQuery (Class cls, Collection cln);
-
-     /** Create a new Query with the Class of the results and Filter.
-     * @param cls the Class of results
-     * @param filter the Filter for candidate instances
-     * @return the new Query
-     */
-     public abstract Query newQuery (Class cls, String filter);
-
-     /** Create a new Query with the Class of the results, candidate Collection,
-     * and Filter.
-     * @param cls the Class of results
-     * @param cln the Collection of candidate instances
-     * @param filter the Filter for candidate instances
-     * @return the new Query
-     */
-     public abstract Query newQuery (Class cls, Collection cln, String filter);
-
-     /** Create a new Query with the candidate Extent and Filter.
-      * The class is taken from the Extent.
-      * @return the new Query
-      * @param cln the Extent of candidate instances
-      * @param filter the Filter for candidate instances */  
-     public abstract Query newQuery(Extent cln, String filter);
-     
-    /**
-     * Create a new <code>Query</code> with the given candidate class
-     * from a named query. The query name given must be the name of a
-     * query defined in metadata.
-     * @param cls the <code>Class</code> of candidate instances
-     * @param queryName the name of the query to look up in metadata
-     * @return the new <code>Query</code>
-     * @since 2.0
-     */
-    public abstract Query newNamedQuery (Class cls, String queryName);
-
-    /** The PersistenceManager may manage a collection of instances in the data
-     * store based on the class of the instances.  This method returns an
-     * Extent of instances in the data store that might be iterated or
-     * given to a Query as the Extent of candidate instances.
-     * @param persistenceCapableClass Class of instances
-     * @param subclasses whether to include instances of subclasses
-     * @return an Extent of instances.
-     * @see StoreManager#getExtent
-     * @see javax.jdo.Query
-     */
-    public Extent getExtent (Class persistenceCapableClass, boolean subclasses) {
-        if (debugging())
-            debug("getExtent for: " + persistenceCapableClass + // NOI18N
-            ", subclasses: " + subclasses); // NOI18N
-
-        assertIsOpen();
-        Extent rc = null;
-        if (PersistenceCapable.class.isAssignableFrom(persistenceCapableClass)) {
-            rc = this.getStoreManager().getExtent(persistenceCapableClass, subclasses, this);
-        } else {
-            throw new JDOUserException(msg.msg(
-                "EXC_ClassNotPersistenceCapable", persistenceCapableClass.getName())); // NOI18N
-        }
-        if (null == rc) {
-            // Protect against bogus store managers that return null.
-            rc = new EmptyExtent(persistenceCapableClass, subclasses);
-        }
-        return rc;
-    }
-
-    /**
-     * Equivalent to <code>getExtent (persistenceCapableClass,
-     * true)</code>.
-     * @see #getExtent(Class,boolean)
-     * @since 2.0
-     */
-    public Extent getExtent (Class persistenceCapableClass) {
-        return getExtent(persistenceCapableClass, true);
-    }
-
-    class EmptyExtent implements Extent {
-        private final Class cls;
-        private final boolean subclasses;
-        EmptyExtent(Class cls, boolean subclasses) {
-            this.cls = cls;
-            this.subclasses = subclasses;
-        }
-        public Iterator iterator() {
-            return new Iterator() {
-                public boolean hasNext() { return false; }
-                public Object next() { return null; }
-                public void remove() { }
-            };}
-        public boolean hasSubclasses() { return false; }
-        public Class getCandidateClass() { return cls; }
-        public boolean subclasses() { return subclasses; }
-        public PersistenceManager getPersistenceManager() {
-            return PersistenceManagerImpl.this.current;
-        }
-        public void closeAll() { }
-        public void close(Iterator it) { }
-        public FetchPlan getFetchPlan() {
-            throw new UnsupportedOperationException(
-                "Method getFetchPlan not yet implemented");
-        }
-    }
-
-    //
-    // -------- State transition methods --------
-    //
-
-    /** Make the transient instance persistent in this PersistenceManager.
-    * This method must be called in an active transaction.
-    * The PersistenceManager assigns an ObjectId to the instance and
-    * transitions it to persistent-new.
-    * The instance will be managed in the Extent associated with its Class.
-    * The instance will be put into the data store at commit.
-    * @param pc a transient instance of a Class that implements
-    * PersistenceCapable
-    */
-    public Object makePersistent (Object pc) {
-        if (debugging())
-            debug("makePersistent"); // NOI18N
-
-        assertIsOpen();
-        assertActiveTransaction(false);
-
-        return makePersistentInternal(pc);
-    }
-
-    /** Make an array of instances persistent.
-    * @param pcs an array of transient instances
-    * @see #makePersistent(Object pc)
-    */
-    public Object[] makePersistentAll(Object[] pcs) {
-        if (debugging())
-            debug("makePersistentAll"); // NOI18N
-
-        assertIsOpen();
-        assertIsOpen();
-        assertActiveTransaction(false);
-        return makePersistentAllInternal(pcs);
-    }
-
-    /** Make an collection of instances persistent.
-    * @param pcs an collection of transient instances
-    * @see #makePersistent(Object pc)
-    */
-    public Collection makePersistentAll(Collection pcs) {
-        if (debugging())
-            debug("makePersistentAll"); // NOI18N
-
-        assertIsOpen();
-        assertActiveTransaction(false);
-        return Arrays.asList(makePersistentAllInternal(pcs.toArray()));
-    }
-
-    /** Delete the persistent instance from the data store.
-     * This method must be called in an active transaction.
-     * The data store object will be removed at commit.
-     * Unlike makePersistent, which makes the closure of the instance persistent,
-     * the closure of the instance is not deleted from the data store.
-     * This method has no effect if the instance is already deleted in the
-     * current transaction.
-     * This method throws an exception if the instance is transient or is managed by another
-     * PersistenceManager.
-     *   
-     * @param pc a persistent instance
-     */ 
-    public void deletePersistent (Object pc) {
-        if (debugging())
-            debug("deletePersistent"); // NOI18N
-
-        assertIsOpen();
-        assertActiveTransaction(false);
-        deletePersistentInternal(pc);
-    }
-
-    /** Delete an array of instances from the data store.
-     * @param pcs a Collection of persistent instances
-     * @see #deletePersistent(Object pc)
-     */
-    public void deletePersistentAll(Object[] pcs) {
-        if (debugging())
-            debug("deletePersistentAll"); // NOI18N
-
-        assertIsOpen();
-        assertActiveTransaction(false);
-        deletePersistentAllInternal(pcs);
-
-    }
-
-    /** Delete a Collection of instances from the data store.
-     * @param pcs a Collection of persistent instances
-     * @see #deletePersistent(Object pc)
-     */  
-    public void deletePersistentAll(Collection pcs) {
-        if (debugging())
-            debug("deletePersistentAll"); // NOI18N
-
-        assertIsOpen();
-        assertActiveTransaction(false);
-        deletePersistentAllInternal(pcs.toArray());
-    }
-
-    /** Make an instance transient, removing it from management by this
-    * PersistenceManager.
-    *   
-    * <P>The instance loses its JDO identity and it is no longer associated
-    * with any PersistenceManager.  The state of fields is preserved unchanged.
-    * @param pc the instance to make transient.
-    */  
-    public void makeTransient(Object pc) {
-        if (debugging())
-            debug("makeTransient"); // NOI18N
-
-        assertIsOpen();
-        makeTransientInternal(pc);
-    }
-    
-    /** Make an array of instances transient, removing them from management by this
-    * PersistenceManager.
-    *   
-    * <P>The instances lose their JDO identity and they are no longer associated
-    * with any PersistenceManager.  The state of fields is preserved unchanged.
-    * @param pcs the instances to make transient.
-    */  
-    public void makeTransientAll(Object[] pcs) {
-        if (debugging())
-            debug("makeTransientAll"); // NOI18N
-
-        assertIsOpen();
-        makeTransientAllInternal(pcs);
-    }
-    
-    /** Make a Collection of instances transient, removing them from management by this
-    * PersistenceManager.
-    *   
-    * <P>The instances lose their JDO identity and they are no longer associated
-    * with any PersistenceManager.  The state of fields is preserved unchanged.
-    * @param pcs the instances to make transient.
-    */  
-    public void makeTransientAll(Collection pcs) {
-        if (debugging())
-            debug("makeTransientAll"); // NOI18N
-
-        assertIsOpen();
-        makeTransientAll(pcs.toArray());
-    }
-
-    /** Make an instance transient, removing it from management by this 
-     * <code>PersistenceManager</code>. Because FOStore doesn't
-     * support the notion of a fetch plan, this method behaves exactly as
-     * makeTransient(Object pc).
-     * @see javax.jdo.PersistenceManager#makeTransient(Object, boolean);
-     */
-    public void makeTransient(Object pc, boolean useFetchPlan) {
-        makeTransient(pc);
-    }
-
-    /** Make instances transient, removing them from management
-     * by this <code>PersistenceManager</code>. Because FOStore doesn't
-     * support the notion of a fetch plan, this method behaves exactly as
-     * makeTransientAll(Object[] pcs).
-     * @see javax.jdo.PersistenceManager#makeTransientAll(Object[], boolean);
-     */
-    public void makeTransientAll(Object[] pcs, boolean useFetchPlan) {
-        makeTransientAll(pcs);
-    }
-    
-    /** Make instances transient, removing them from management
-     * by this <code>PersistenceManager</code>. Because FOStore doesn't
-     * support the notion of a fetch plan, this method behaves exactly as
-     * makeTransientAll(Collection pcs).
-     * @see javax.jdo.PersistenceManager#makeTransientAll(Collection, boolean);
-     */
-    public void makeTransientAll(Collection pcs, boolean useFetchPlan) {
-        makeTransientAll(pcs);
-    }
-
-    /** Make an instance subject to transactional boundaries.
-    *   
-    * <P>Transient instances normally do not observe transaction boundaries.
-    * This method makes transient instances sensitive to transaction completion.
-    * If an instance is modified in a transaction, and the transaction rolls back,
-    * the state of the instance is restored to the state before the first change
-    * in the transaction.
-    *   
-    * <P>For persistent instances read in optimistic transactions, this method
-    * allows the application to make the state of the instance part of the
-    * transactional state.  At transaction commit, the state of the instance in
-    * cache is compared to the state of the instance in the data store.  If they
-    * are not the same, then an exception is thrown.
-    * @param pc the instance to make transactional.
-    */  
-    public void makeTransactional(Object pc) {
-        if (debugging())
-            debug("makeTransactional"); // NOI18N
-
-        assertIsOpen();
-        makeTransactionalInternal(pc);
-    }
-      
-    /** Make an array of instances subject to transactional boundaries.
-    * @param pcs the array of instances to make transactional.
-    * @see #makeTransactional(Object pc)
-    */
-    public void makeTransactionalAll(Object[] pcs) {
-        if (debugging())
-            debug("makeTransactionalAll"); // NOI18N
-
-        assertIsOpen();
-        makeTransactionalAllInternal(pcs);
-    }
-    
-    /** Make a Collection of instances subject to transactional boundaries.
-    * @param pcs the Collection of instances to make transactional.
-    * @see #makeTransactional(Object pc)
-    */
-    public void makeTransactionalAll(Collection pcs) {
-        if (debugging())
-            debug("makeTransactionalAll"); // NOI18N
-
-        assertIsOpen();
-        makeTransactionalAllInternal(pcs.toArray());
-    }
-
-    /** Make an instance non-transactional after commit.
-    *
-    * <P>Normally, at transaction completion, instances are evicted from the
-    * cache.  This method allows an application to identify an instance as
-    * not being evicted from the cache at transaction completion.  Instead,
-    * the instance remains in the cache with nontransactional state.
-    *
-    * @param pc the instance to make nontransactional.
-    */
-    public void makeNontransactional(Object pc) {
-        if (debugging())
-            debug("makeNontransactional"); // NOI18N
-
-        assertIsOpen();
-        makeNontransactionalInternal(pc);
-    }
-    
-    /** Make an array of instances non-transactional after commit.
-    *
-    * @param pcs the array of instances to make nontransactional.
-    * @see #makeNontransactional(Object pc)
-    */
-    public void makeNontransactionalAll(Object[] pcs){
-        if (debugging())
-            debug("makeNontransactionalAll"); // NOI18N
-
-        assertIsOpen();
-        makeNontransactionalAllInternal(pcs);
-    }
-
-    /** Make a Collection of instances non-transactional after commit.
-    *
-    * @param pcs the Collection of instances to make nontransactional.
-    * @see #makeNontransactional(Object pc)
-    */
-    public void makeNontransactionalAll(Collection pcs) {
-        if (debugging())
-            debug("makeNontransactionalAll"); // NOI18N
-
-        assertIsOpen();
-        makeNontransactionalAllInternal(pcs.toArray());
-    }
-
-    /** Mark an instance as no longer needed in the cache.
-    * Eviction is normally done automatically by the PersistenceManager
-    * at transaction completion.  This method allows the application to
-    * explicitly provide a hint to the PersistenceManager that the instance
-    * is no longer needed in the cache.
-    * @param pc the instance to evict from the cache.
-    */  
-    public  void evict(Object pc) {
-        if (debugging())
-            debug("evict"); // NOI18N
-
-        assertIsOpen();
-        evictInternal(pc);
-    }
-
-   /** Mark an array of instances as no longer needed in the cache.
-    * @see #evict(Object pc)
-    * @param pcs the array of instances to evict from the cache.
-    */  
-    public void evictAll(Object[] pcs) {
-        if (debugging())
-            debug("evictAll"); // NOI18N
-
-        assertIsOpen();
-        evictAllInternal(pcs);
-    }
-
-    /** Mark a Collection of instances as no longer needed in the cache.
-    * @param pcs the Collection of instance to evict from the cache.
-    */  
-    public void evictAll(Collection pcs) {
-        if (debugging())
-            debug("evictAll"); // NOI18N
-
-        assertIsOpen();
-        evictAllInternal(pcs.toArray());
-    }
-
-    /** Mark all persistent-nontransactional instances as no longer needed
-    * in the cache.  It transitions
-    * all persistent-nontransactional instances to hollow.  Transactional
-    * instances are subject to eviction based on the RetainValues setting.
-    * @see #evict(Object pc)
-    */  
-    public void evictAll() {
-        if (debugging())
-            debug("evictAll()"); // NOI18N
-
-        assertIsOpen();
-        _txCache.evictAll();
-    }
-
-
-    /** Refresh the state of the instance from the data store.
-    *   
-    * <P>In an optimistic transaction, the state of instances in the cache
-    * might not match the state in the data store.  This method is used to
-    * reload the state of the instance from the data store so that a subsequent
-    * commit is more likely to succeed.
-    * <P>Outside a transaction, this method will refresh nontransactional state.
-    * @param pc the instance to refresh.
-    */  
-    public void refresh(Object pc) { 
-        if (debugging())
-            debug("refresh"); // NOI18N
-
-        assertIsOpen();
-        refreshInternal(pc);
-    }
-     
-    /** Refresh the state of an array of instances from the data store.
-    *   
-    * @see #refresh(Object pc)
-    * @param pcs the array of instances to refresh.
-    */  
-    public void refreshAll(Object[] pcs) {
-        if (debugging())
-            debug("refreshAll"); // NOI18N
-
-        assertIsOpen();
-        refreshAllInternal(pcs);
-    }
-         
-    /** Refresh the state of a Collection of instances from the data store.
-    *
-    * @see #refresh(Object pc)
-    * @param pcs the Collection of instances to refresh.
-    */
-    public void refreshAll(Collection pcs) {
-        if (debugging())
-            debug("refreshAll"); // NOI18N
-
-        assertIsOpen();
-        refreshAllInternal(pcs.toArray());
-    }
-         
-    /** Refresh the state of all applicable instances from the data store.
-    * <P>If called with an active transaction, all transactional instances
-    * will be refreshed.  If called outside an active transaction, all
-    * nontransactional instances will be refreshed.
-    * @see #refresh(Object pc)
-    */
-    public void refreshAll() {
-        if (debugging())
-            debug("refreshAll()"); // NOI18N
-
-        assertIsOpen();
-        if (_activeTransaction) {
-            _txCache.refreshAllTransactional(); 
-        } else {
-            _txCache.refreshAllNontransactional(); 
-        }
-    }
-
-    /**
-     * Refreshes all instances in the exception that failed verification.
-     *
-     * @since 2.0
-     */
-    public void refreshAll(JDOException jdoe) {
-        throw new UnsupportedOperationException(
-            "Method refreshAll(JDOException) not yet implemented");
-    }
-
-    /** Retrieve field values of an instance from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instance, and its field values must be retrieved.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pc the instance
-     */
-    public void retrieve(Object pc) {
-        if (debugging())
-            debug("retrieve"); // NOI18N
-
-        assertIsOpen();
-        retrieveInternal(pc, false);
-    }
-    
-    /** Retrieve field values of an instance from the store.  
-     * <P>The <code>PersistenceManager</code> might use policy information 
-     * about the class to retrieve associated instances.
-     * @param pc the instance
-     * @param FGOnly whether to retrieve only the fields in the fetch plan
-     */
-    public void retrieve(Object pc, boolean FGOnly) {
-        if (debugging())
-            debug("retrieve, FGOnly: " + FGOnly); // NOI18N
-
-        assertIsOpen();
-        retrieveInternal(pc, FGOnly);
-    }
-    
-    /** Retrieve field values of instances from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instances, and all field values must be retrieved.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pcs the instances
-     */
-    public void retrieveAll(Object[] pcs) {
-        retrieveAll(pcs, false);
-    }
-    
-    /** Retrieve field values of instances from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instances, and their field values should be retrieved.  The fields
-     * in the default fetch group must be retrieved, and the implementation
-     * might retrieve more fields than the default fetch group.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pcs the instances
-     * @param FGOnly whether to retrieve only the fields in the fetch plan
-     * @since 1.0.1
-     */
-    public void retrieveAll (Object[] pcs, boolean FGOnly) {
-        if (debugging())
-            debug("retrieveAll, FGOnly: " + FGOnly); // NOI18N
-
-        assertIsOpen();
-        retrieveAllInternal(pcs, FGOnly);
-    }
-
-           
-    /** Retrieve field values of instances from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instances, and all field values must be retrieved.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pcs the instances
-     */
-    public void retrieveAll(Collection pcs) {
-        retrieveAll(pcs, false);
-    }
-    
-    /** Retrieve field values of instances from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instances, and their field values should be retrieved.  The fields
-     * in the default fetch group must be retrieved, and the implementation
-     * might retrieve more fields than the default fetch group.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pcs the instances
-     * @param FGOnly whether to retrieve only the fields in the fetch plan
-     * @since 1.0.1
-     */
-    public void retrieveAll (Collection pcs, boolean FGOnly) {
-        if (debugging())
-            debug("retrieveAll, DFGOnly: " + FGOnly); // NOI18N
-
-        assertIsOpen();
-        retrieveAllInternal(pcs.toArray(), FGOnly);
-    }
-
-    //
-    // -------- Other public methods --------
-    //
-
-    /** This method returns the PersistenceManagerFactory used to create
-    * this PersistenceManager.  It returns null if this instance was
-    * created via a constructor.
-    * @return the PersistenceManagerFactory that created
-    * this PersistenceManager
-    */  
-    public PersistenceManagerFactory getPersistenceManagerFactory() {
-        assertIsOpen();
-        return (PersistenceManagerFactory)pmf;
-    }
-   
-    /** The application can manage the PersistenceManager instances
-    * more easily by having an application object associated with each
-    * PersistenceManager instance.
-    * @param o the user instance to be remembered by the PersistenceManager
-    * @see #getUserObject
-    */  
-    public void setUserObject(Object o) {
-        assertIsOpen();
-        this._userObject = o;
-    }
-     
-    /** The application can manage the PersistenceManager instances
-    * more easily by having an application object associated with each
-    * PersistenceManager instance.
-    * @return the user object associated with this PersistenceManager
-    * @see #setUserObject
-    */  
-    public Object getUserObject() {
-        assertIsOpen();
-        return _userObject;
-    }
-     
-    /**
-     * Detach the specified object from the <code>PersistenceManager</code>.
-     * @param pc the instance to detach
-     * @return the detached instance
-     * @see #detachCopyAll(Object[])
-     * @since 2.0
-     */
-    public Object detachCopy (Object pc) {
-        throw new UnsupportedOperationException(
-            "Method detachCopy(Object) not yet implemented");
-    }
-
-    /**
-     * Detach the specified objects from the <code>PersistenceManager</code>.
-     * @param pcs the instances to detach
-     * @return the detached instances
-     * @see #detachCopyAll(Object[])
-     * @since 2.0
-     */
-    public Collection detachCopyAll (Collection pcs) {
-        throw new UnsupportedOperationException(
-            "Method detachCopy(Collection) not yet implemented");
-    }
-
-    /**
-     * Detach the specified objects from the
-     * <code>PersistenceManager</code>. The objects returned can be
-     * manipulated and re-attached with 
-     * {@link #attachCopyAll(Object[], boolean)}. 
-     * The detached instances will be
-     * unmanaged copies of the specified parameters, and are suitable
-     * for serialization and manipulation outside of a JDO
-     * environment. When detaching instances, only fields in the
-     * current {@link FetchPlan} will be traversed. Thus, to detach a
-     * graph of objects, relations to other persistent instances must
-     * either be in the <code>default-fetch-group</code>, or in the
-     * current custom {@link FetchPlan}.
-     * @param pcs the instances to detach
-     * @return the detached instances
-     * @throws JDOUserException if any of the instances do not
-     * @see #attachCopyAll(Object[], boolean)
-     * @see #getFetchPlan
-     * @since 2.0
-     */
-    public Object[] detachCopyAll (Object [] pcs) {
-        throw new UnsupportedOperationException(
-            "Method detachCopy(Object[]) not yet implemented");
-    }
-
-    /**
-     * Import the specified object into the
-     * <code>PersistenceManager</code>.
-     * @param pc instance to import
-     * @param makeTransactional if <code>true</code>, this method will
-     *     mark transactional the persistent instances corresponding
-     *     to all instances in the closure of the detached graph.
-     * @return the re-attached instance
-     * @see #attachCopyAll(Object[],boolean)
-     * @since		2.0
-     */
-    public Object attachCopy (Object pc, boolean makeTransactional) {
-        throw new UnsupportedOperationException(
-            "Method attachCopy(Object,boolean) not yet implemented");
-    }
-
-    /**
-     * Import the specified objects into the
-     * <code>PersistenceManager</code>.
-     * @param pcs Collection of instances to import
-     * @param makeTransactional if <code>true</code>, this method will
-     *     mark transactional the persistent instances corresponding
-     *     to all instances in the closure of the detached graph.
-     * @return the re-attached instances
-     * @see #attachCopyAll(Object[],boolean)
-     * @since 2.0
-     */
-    public Collection attachCopyAll (Collection pcs, boolean makeTransactional) {
-        throw new UnsupportedOperationException(
-            "Method attachCopyAll(Collection,boolean) not yet implemented");
-    }
-
-    /**
-     * Import the specified objects into the
-     * <code>PersistenceManager</code>. Instances that were
-     * previously detached from this or another
-     * <code>PersistenceManager</code> will have their changed merged
-     * into the persistent instances. Instances that are new will be
-     * persisted as new instances.
-     * @param pcs array of instances to import
-     * @param makeTransactional	if <code>true</code>, this method will
-     *     mark transactional the persistent instances corresponding
-     *     to all instances in the closure of the detached graph.
-     * @return the re-attached instances
-     * @see #detachCopyAll(Object[])
-     * @since 2.0
-     */
-    public Object[] attachCopyAll (Object[] pcs, boolean makeTransactional) {
-        throw new UnsupportedOperationException(
-            "Method attachCopyAll(Object[],boolean) not yet implemented");
-    }
-
-    /**
-     * Put the specified key-value pair into the map of user objects.
-     * @since 2.0
-     */
-    public Object putUserObject (Object key, Object val) {
-        throw new UnsupportedOperationException(
-            "Method putUserObject(Object,Object) not yet implemented");
-    }
-
-    /**
-     * Get the value for the specified key from the map of user objects.
-     * @param key the key of the object to be returned
-     * @return the object 
-     * @since 2.0
-     */
-    public Object getUserObject (Object key) {
-        throw new UnsupportedOperationException(
-            "Method getUserObject(Object) not yet implemented");
-    }
-
-    /**
-     * Remove the specified key and its value from the map of user objects.
-     * @param key the key of the object to be removed
-     * @since 2.0
-     */
-    public Object removeUserObject (Object key) {
-        throw new UnsupportedOperationException(
-            "Method removeUserObject(Object) not yet implemented");
-    }
-
-    /**
-     * Flushes all dirty, new, and deleted instances to the data
-     * store. It has no effect if a transaction is not active.
-     * <p>If a datastore transaction is active, this method
-     * synchronizes the cache with the datastore and reports any
-     * exceptions.</p>
-     * <p>If an optimistic transaction is active, this method obtains
-     * a datastore connection, synchronizes the cache with the
-     * datastore using this connection and reports any
-     * exceptions. The connection obtained by this method is held
-     * until the end of the transaction.</p>
-     * <p>If exceptions occur during flush, the implementation will
-     * set the current transaction's <code>RollbackOnly</code> flag
-     * (see {@link Transaction#setRollbackOnly}).</p>
-     * @since	2.0
-     */
-    public synchronized void flush () {
-        if (debugging())
-            debug("flush"); // NOI18N
-
-        _transaction.internalFlush();
-    }
-
-    /**
-     * Validates the <code>PersistenceManager</code> cache with the
-     * datastore. This method has no effect if a transaction is not
-     * active.
-     * <p>If a datastore transaction is active, this method verifies
-     * the consistency of instances in the cache against the
-     * datastore. An implementation might flush instances as if
-     * {@link #flush} were called, but it is not required to do
-     * so.</p>
-     * <p>If an optimistic transaction is active, this method obtains
-     * a datastore connection and verifies the consistency of the
-     * instances in the cache against the datastore. If any
-     * inconsistencies are detected, a {@link
-     * JDOOptimisticVerificationException} is thrown. This exception
-     * contains a nested {@link JDOOptimisticVerificationException}
-     * for each object that failed the consistency check. No
-     * datastore resources acquired during the execution of this
-     * method are held beyond the scope of this method.</p>
-     * @since 2.0
-     */
-    public void checkConsistency () {
-        throw new UnsupportedOperationException(
-            "Method checkConsistency() not yet implemented");
-    }
-
-    /**
-     * Returns the <code>FetchPlan</code> used by this
-     * <code>PersistenceManager</code>.
-     * @return the FetchPlan
-     * @since 2.0
-     */
-    public FetchPlan getFetchPlan () {
-        throw new UnsupportedOperationException(
-            "Method getFetchPlan() not yet implemented");
-    }
-
-    /**
-     * Creates an instance of a persistence-capable interface or
-     * abstract class. The returned instance is transient.
-     * @param pcClass Must be an abstract class or interface 
-     *     that is declared in the metadata.
-     * @return the created instance
-     * @since 2.0
-     */
-    public Object newInstance (Class pcClass) {
-        throw new UnsupportedOperationException(
-            "Method newInstance(Class) not yet implemented");
-    }
-
-    /**
-     * Returns the sequence identified by <code>name</code>.
-     * @param name the name of the Sequence
-     * @return the Sequence
-     * @since 2.0
-     */
-    public Sequence getSequence (String name) {
-        throw new UnsupportedOperationException(
-            "Method getSequence(String) not yet implemented");
-    }
-
-    /**
-     * If this method is called while a datastore transaction is
-     * active, the object returned will be enlisted in the current
-     * transaction. If called in an optimistic transaction or outside
-     * an active transaction, the object returned will not be
-     * enlisted in any transaction.
-     * @return the JDOConnection instance
-     * @since 2.0
-     */
-    public JDOConnection getDataStoreConnection () {
-        throw new UnsupportedOperationException(
-            "Method getDataStoreConnection() not yet implemented");
-    };
-
-    /**
-     * Adds the listener instance to the list of lifecycle event
-     * listeners. The <code>classes</code> parameter identifies all
-     * of the classes of interest. If the <code>classes</code>
-     * parameter is specified as <code>null</code>, events for all
-     * persistent classes and interfaces will be sent to
-     * <code>listenerInstance</code>.
-     * <p>The listenerInstance will be called for each event for which it
-     * implements the corresponding listenerInstance interface.</p>
-     * @param listener the lifecycle listener
-     * @param classes the classes of interest to the listener
-     * @since 2.0
-     */
-    public void addInstanceLifecycleListener (InstanceLifecycleListener listener,
-        Class[] classes) {
-        throw new UnsupportedOperationException(
-            "Method addInstanceLifecycleListener(InstanceLifecycleListener) not yet implemented");
-    };
-
-    /**
-     * Removes the listener instance from the list of lifecycle event listeners.
-     * @param listener the listener instance to be removed
-     * @since 2.0
-     */
-    public void removeInstanceLifecycleListener (InstanceLifecycleListener listener) {
-        throw new UnsupportedOperationException(
-            "Method removeInstanceLifecycleListener(InstanceLifecycleListener) not yet implemented");
-    }
-
-    /** The JDO vendor might store certain non-operational properties and
-    * make those properties available to applications (for troubleshooting).
-    *   
-    * <P>Standard properties include:
-    * <li>VendorName</li>
-    * <li>VersionNumber</li>
-    * @return the Properties of this PersistenceManager
-    */  
-    public Properties getProperties() {
-        assertIsOpen();
-        return JDORIVersion.getVendorProperties();
-    }
-
-    //
-    // Implement PersistenceManagerInternal methods
-    //
-
-    /**
-     * assert this PM instance is open
-     */
-    public void assertIsOpen() {
-        if (_isClosed) {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-        // this is synchronized on pmf.closeLock
-        pmf.assertNotClosed();
-    }
-
-    /**
-     * @see org.apache.jdo.pm.PersistenceManagerInternal#getStoreManager()
-     */
-    public StoreManager getStoreManager() {
-        return (_storeManager != null) ? _storeManager : 
-            pmf.getStoreManager(this);
-    }
-
-    /**
-     * @see org.apache.jdo.pm.PersistenceManagerInternal#setStoreManager(StoreManager)
-     */
-    public void setStoreManager(StoreManager storeManager) {
-        _storeManager = storeManager;
-        
-    }
-
-    //
-    // -------- SCO Instance creation methods --------
-    //
-
-    /**
-     * Called by internally by the runtime to create a new tracked instance.
-     * Will not result in marking field as dirty
-     *
-     * @see PersistenceManagerInternal#newSCOInstanceInternal (Class type)
-     */  
-    public Object newSCOInstanceInternal (Class type) {
-        if (debugging())
-            debug("newSCOInstanceInternal for: " + type); // NOI18N
-
-        Class newType = pmf.getTrackedClass(type);
-        if (newType == null) {
-            // Not found - means not supported. Return null here for
-            // the internal calls. 
-            return null;
-        }
-
-        Object obj = null;
-
-        try {
-            Constructor constr = newType.getConstructor((Class[])null);
-
-            if (constr != null) {
-                obj = constr.newInstance((Object[])null);
-            }
-        } catch (Exception e) {
-            throw new JDOUserException(msg.msg(
-                "EXC_CannotConstructSCO",// NOI18N
-                newType.getName()), e);
-        }
-
-        return obj;
-    }
-
-    /**
-     * Called by internally by the runtime to create a new tracked instance.
-     * Will not result in marking field as dirty
-     *
-     * @see PersistenceManagerInternal#newCollectionInstanceInternal(Class type,
-        Class elementType, boolean allowNulls, Integer initialSize,
-        Float loadFactor, Collection initialContents, Comparator comparator)
-     */
-    public Collection newCollectionInstanceInternal(
-        Class type,
-        Class elementType, boolean allowNulls, Integer initialSize,
-        Float loadFactor, Collection initialContents, Comparator comparator) {
-
-        if (debugging())
-            debug("newCollectionInstanceInternal for: " + type); // NOI18N
-
-        Class newType = pmf.getTrackedClass(type);
-        if (newType == null) {
-            // Not found - means not supported. Return null here for
-            // the internal calls. 
-            return null;
-        }
-
-        Object obj = null;
-        SCOCollection rc = null;
-
-
-        try {
-            if (org.apache.jdo.impl.sco.TreeSet.class == newType) {
-                // Comparator can be null.
-                Constructor constr = newType.getConstructor(sigSCO_TreeSet);
-
-                if (constr != null) {
-                    obj = constr.newInstance(
-                        new Object[] {
-                            elementType,
-                            new Boolean(allowNulls), comparator
-                        });
-                }
-            } else if (null == loadFactor) {        
-                // If loadFactor is null, then it might be a HashSet.  If loadFactor
-                // is not null, it must be a HashSet, or we'll throw an exception below.
-
-                Constructor constr = newType.getConstructor(sigSCO_Collection);
-
-                if (constr != null) {
-                    if (initialSize == null) {
-                        initialSize = getInitialSize(newType);
-                    }
-                    obj = constr.newInstance(
-                        new Object[] {
-                            elementType,
-                            new Boolean(allowNulls), initialSize
-                        });
-                }
-            } else if (org.apache.jdo.impl.sco.HashSet.class == newType) {
-                Constructor constr = newType.getConstructor(sigSCO_HashSet);
-                
-                if (constr != null) {
-                    if (initialSize == null) {
-                        initialSize = getInitialSize(newType);
-                    }
-                    obj = constr.newInstance(
-                        new Object[] {
-                            elementType,
-                            new Boolean(allowNulls), initialSize, loadFactor
-                        });
-                    // We don't have a good way of testing this, because
-                    // HashSet is opaque w.r.t. loadFactor.  Uncommenting this
-                    // is all I can suggest!
-                    /*
-                    System.out.println(
-                        "newCollection: loadFactor " + loadFactor); // NOI18N
-                    */
-                }
-            } else {
-                throw new IllegalArgumentException(msg.msg(
-                    "EXC_IllegalArguments",// NOI18N
-                    type.getName()));
-            }
-            rc = (SCOCollection)obj;
-            if (initialContents != null && initialContents.size() > 0) {
-                // Do not use addAllInternal to verify element types of
-                // initialContents.
-                rc.addAll(initialContents);
-            }
-        } catch (IllegalArgumentException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new JDOUserException(msg.msg(
-                "EXC_CannotConstructSCO",// NOI18N
-                newType.getName()), e);
-        }
-        return rc;
-    }
-
-    /**
-     * Called by internally by the runtime to create a new tracked instance.
-     * Will not result in marking field as dirty.
-     *
-     * @see PersistenceManagerInternal#newMapInstanceInternal(Class type,
-        Class keyType, Class valueType, boolean allowNulls, Integer initialSize,
-        Float loadFactor, Map initialContents, Comparator comparator)
-     */
-    public Map newMapInstanceInternal(
-        Class type,
-        Class keyType, Class valueType, boolean allowNulls, Integer initialSize,
-        Float loadFactor, Map initialContents, Comparator comparator) {
-
-        if (debugging())
-            debug("newMapInstanceInternal for: " + type); // NOI18N
-
-        Class newType = pmf.getTrackedClass(type);
-        if (newType == null) {
-            // Not found - means not supported. Return null here for
-            // the internal calls. 
-            return null;
-        }
-
-        Object obj = null;
-        SCOMap rc = null;
-
-
-        try {
-            if (org.apache.jdo.impl.sco.TreeMap.class == newType) {
-                // Comparator can be null.
-                Constructor constr = newType.getConstructor(sigSCO_TreeMap);
-
-                if (constr != null) {
-                    obj = constr.newInstance(
-                        new Object[] {
-                            keyType,
-                            valueType,
-                            new Boolean(allowNulls), comparator
-                        });
-                }
-            } else if (null == loadFactor) {        
-                // It is not TreeMap, so it should be either HashMap or Hashtable
-                // and they can be constructed with or without loadFactor.
-                Constructor constr = newType.getConstructor(sigSCO_Map);
-
-                if (constr != null) {
-                    if (initialSize == null) {
-                        initialSize = getInitialSize(newType);
-                    }
-                    obj = constr.newInstance(
-                        new Object[] {
-                            keyType,
-                            valueType,
-                            new Boolean(allowNulls), initialSize
-                        });
-                }
-            } else if (org.apache.jdo.impl.sco.HashMap.class == newType ||
-                org.apache.jdo.impl.sco.Hashtable.class == newType) {
-                Constructor constr = newType.getConstructor(sigSCO_HashMap);
-                
-                if (constr != null) {
-                    if (initialSize == null) {
-                        initialSize = getInitialSize(newType);
-                    }
-                    obj = constr.newInstance(
-                        new Object[] {
-                            keyType,
-                            valueType,
-                            new Boolean(allowNulls), initialSize, loadFactor
-                        });
-                    // We don't have a good way of testing this, because
-                    // HashMap is opaque w.r.t. loadFactor.  Uncommenting this
-                    // is all I can suggest!
-                    /*
-                    System.out.println(
-                        "newMap: loadFactor " + loadFactor); // NOI18N
-                    */
-                }
-            } else {
-                throw new IllegalArgumentException(msg.msg(
-                    "EXC_IllegalArguments",// NOI18N
-                    type.getName()));
-            }
-            rc = (SCOMap)obj;
-            if (initialContents != null && initialContents.size() > 0) {
-                // Do not use putAllInternal to verify key/value types of
-                // initialContents.
-                rc.putAll(initialContents);
-            }
-        } catch (IllegalArgumentException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new JDOUserException(msg.msg(
-                "EXC_CannotConstructSCO",// NOI18N
-                newType.getName()), e);
-        }
-        return rc;
-    }
-
-    //
-    // ----------- StateManger interaction methods -----------------
-    //
-
-    /**
-     *
-     * @see PersistenceManagerInternal#isSupportedSCOType (Class type)
-     */  
-    public boolean isSupportedSCOType (Class type) {
-        return (pmf.getTrackedClass(type) != null);
-    }
-
-    /**
-     * @see PersistenceManagerInternal#register(StateManagerInternal sm, Object oid, 
-     * boolean transactional, boolean throwDuplicateException)
-     */
-    public void register(StateManagerInternal sm, Object oid, boolean transactional, 
-        boolean throwDuplicateException) {
-        if (debugging())
-            debug("register" + oid); // NOI18N
-
-        _txCache.register(sm, oid, transactional, throwDuplicateException);
-    }
-
-    /**
-     * @see PersistenceManagerInternal#registerTransient(StateManagerInternal sm)
-     */
-    public void registerTransient(StateManagerInternal sm) {
-        if (debugging())
-            debug("registerTransient"); // NOI18N
-
-        _txCache.registerTransient(sm);
-    }
-
-    /**
-     * @see PersistenceManagerInternal#deregister(Object oid)
-     */
-    public void deregister(Object oid) {
-        if (debugging())
-            debug("deregister" + oid); // NOI18N
-
-        _txCache.deregister(oid);
-    }
-
-    /**
-     * @see PersistenceManagerInternal#deregisterTransient(StateManagerInternal sm)
-     */
-    public void deregisterTransient(StateManagerInternal sm) {
-        if (debugging())
-            debug("deregisterTransient"); // NOI18N
-
-        _txCache.deregisterTransient(sm);
-    }
-
-    /**
-     * @see PersistenceManagerInternal#replaceObjectId(Object oldId, Object newId)
-     */
-    public void replaceObjectId(Object oldId, Object newId) {
-        if (debugging())
-            debug("replaceObjectId old: " + oldId + " new: " + newId); // NOI18N
-
-        if (!newId.equals(oldId)) {
-            _txCache.replaceObjectId(oldId, newId);
-        }
-    }
-
-    /**
-     * @see PersistenceManagerInternal#markAsFlushed(StateManagerInternal sm)
-     */
-    public void markAsFlushed(StateManagerInternal sm) {
-        if (debugging())
-            debug("markAsFlushed"); // NOI18N
-
-        if (!_flushing) {
-            _txCache.markAsFlushed(sm);
-        }
-    }
-
-    /**
-     * @see PersistenceManagerInternal#insideCommit()
-     */
-    public boolean insideCommit() {
-        return _transaction.startedCommit();
-    }
-
-    /** A helper method called from the StateManager inside getPersistenceManager()
-     * to identify StateManager associated with this PC instance
-     * @param pc PC instance 
-     * @param sm StateManager to save
-     */
-    public synchronized void hereIsStateManager(StateManagerInternal sm, 
-        PersistenceCapable pc) {
-        if (debugging())
-            debug("hereIsStateManager"); // NOI18N
-
-        if (this.pc == pc) {
-            lookingFor = sm;
-        }
-    }
-
-    /**
-    * @see PersistenceManagerInternal#getStateManager
-    */
-    public StateManagerInternal getStateManager(Object oid, Class pcClass) {
-        if (debugging())
-            debug("getStateManager"); // NOI18N
-
-        return _txCache.getStateManager(oid, pcClass);
-    }
-
-    /** A helper method to find the StateManager associated with this PC instance
-     * @param pc PC instance
-     * @return StateManager as StateManagerInternal
-     */
-    public synchronized StateManagerInternal findStateManager(PersistenceCapable pc) {
-        if (debugging())
-            debug("findStateManager"); // NOI18N
-
-        lookingFor = null;
-        this.pc = pc;
-        // pc.jdoGetPersistenceManager() returns the wrapper. It should compare equals
-        // to this PersistenceManager:
-        PersistenceManager pm = pc.jdoGetPersistenceManager();
-        if (debugging())
-            debug("findStateManager " + pm); // NOI18N
-
-        if (pm != null && !this.equals(pm)) {
-            throw new JDOUserException(msg.msg(
-                 "EXC_AnotherPersistenceManager"));// NOI18N
-        }
-        return lookingFor;
-    }    
-
-    /**
-     * Returns current wrapper
-     */
-    public PersistenceManager getCurrentWrapper() {
-        return current;
-    }
-
-    /**
-     * Returns a Collection of instances that has been made persistent
-     * or become persistent through persistence-by-reachability
-     * algorithm in this transaction. Called by the Extent.iterator.
-     * @see PersistenceManagerInternal#getInsertedInstances
-     * @return Collection of Persistent-New instances.
-     */
-    public Collection getInsertedInstances() {
-        if (debugging())
-            debug("getInsertedInstances"); // NOI18N
-
-        return _txCache.getInsertedInstances();
-    }
-
-    /**
-     * Returns a hash code value for this PersistenceManager.
-     * @return  a hash code value for this PersistenceManager.
-     */  
-    public int hashCode() {
-        return super.hashCode();
-    }
- 
-    /**  
-     * Indicates whether some other object is "equal to" this one.
-     * @param   obj   the reference object with which to compare.
-     * @return  <code>true</code> if this object is the same as the obj
-     *          argument; <code>false</code> otherwise.
-     */  
-    public boolean equals(Object obj) {
-        if (obj instanceof PersistenceManagerWrapper) {
-            return (((PersistenceManagerWrapper)obj).getPersistenceManager() == this); 
- 
-        } else if (obj instanceof PersistenceManagerImpl) {
-            return (((PersistenceManagerImpl)obj) == this); 
-        } 
-        return false; 
-    } 
-
-    //
-    // ----------- Protected methods -----------------
-    //
-
-    /**
-     * Remember the current wrapper
-     */
-    protected void pushCurrentWrapper(PersistenceManagerWrapper pmw) {
-        if (debugging())
-            debug("pushCurrentWrapper"); // NOI18N
-
-        current = pmw;
-    }
-
-    /**
-     * Replace current wrapper with the previous
-     */
-    protected void popCurrentWrapper(PersistenceManagerWrapper prev) {
-        if (debugging())
-            debug("popCurrentWrapper"); // NOI18N
-
-        current = prev;
-        if (_jta == null && current == null) {
-            this.close();
-        }
-    }
-
-    /**
-     * with the current thread in the managed environment
-     */
-    protected void setJTATransaction(Object t) {
-        if (debugging())
-            debug("setJTATransaction"); // NOI18N
-
-        if (this._jta != null) {
-            throw new JDOFatalInternalException(
-                msg.msg("EXC_NotNullJTATransaction")); //NOI18N
-        }
-        this._jta = t;
-    }
-
-    /**
-     * Disassociate this PersistenceManager with the current JTA
-     * transaction.
-     */
-    protected void deregisterJTA() {
-        if (debugging())
-            debug("deregisterJTA"); // NOI18N
-
-        pmf.deregisterPersistenceManager(this, _jta);
-        _jta = null;
-    }
-
-    /** 
-     * Close this persistence manager even if there are open wrappers
-     * or an uncomplete transaction.
-     * Called by transaction completion in case of an inconsistent state
-     * or as a part of a normal close process.
-     */
-    protected void forceClose() {
-        if (debugging())
-            debug("forceClose"); // NOI18N
-
-        _txCache.close();
-
-        // Remove association with JTA Transaction if any and return
-        // to the pool.
-        pmf.releasePersistenceManager(this, _jta);
-
-        // Reset all references:
-        pmf = null;
-        _jta = null;
-        _isClosed = true;
-        _transaction = null;
-        _txCache = null;
-        _userObject = null;
-    }
-
-    /**
-     * Verify that cached instance of a PersistenceManager was initialy
-     * requested with the same values for username and password
-     */
-    protected boolean verify(String username, String password) {
-        if (debugging())
-            debug("verify"); // NOI18N
-
-        return _transaction.verify(username, password);
-    }
-
-    /**
-     * Called by Transaction commit()
-     * Loops through transactional cache and calls PersistentStore.updatePersistent()
-     * on each instance
-     */
-    protected void flushInstances() {
-        if (debugging())
-            debug("flushInstances"); // NOI18N
-
-        assertIsOpen();
-        assertActiveTransaction(false);
-        _flushing = true;
-
-        try {
-            _txCache.flushInstances();
-        } finally {
-            _flushing = false;
-        }
-    }
-
-    /**
-     * Called by Transaction commit() or rollback()
-     * cleans up transactional cache
-     * @param    status        javax.transaction.Status
-     */
-    protected void afterCompletion(int status) {
-        if (debugging())
-            debug("afterCompletion"); // NOI18N
-
-        assertIsOpen();
-        _flushing = true;
-        boolean abort = ((status == Status.STATUS_ROLLEDBACK) ||
-             (status == Status.STATUS_ROLLING_BACK) ||
-             (status == Status.STATUS_MARKED_ROLLBACK));
-        _txCache.afterCompletion(abort);
-        _flushing = false;
-    }
-
-    /**
-     * For Transaction to notify PersistenceManager that
-     * status is changed
-     */
-    protected synchronized void notifyStatusChange(boolean isActive) {
-        _activeTransaction = isActive;
-    }
-
-    /**
-     * For Transaction to notify PersistenceManager that
-     * optimistic flag is changed
-     */
-    protected synchronized void notifyOptimistic(boolean optimistic) {
-        this.optimistic = optimistic;
-    }
-
-    /** --------------Private Methods--------------  */
-
-    /** Returns external representation of the current or transactional
-     * objectId depending on the parameter
-     * @param pc the PersistenceCapable instance
-     * @param transactional true if the transactional Id is requested
-     * @return the corresponding ObjectId of the instance. Returns null
-     * if pc is null, not persistence-capable, or not persistent.
-     */
-    private Object getExternalObjectId(Object pc, boolean transactional) {
-        if (debugging())
-            debug("getExternalObjectId"); // NOI18N
-
-        assertIsOpen();
-        if (pc != null && pc instanceof PersistenceCapable) {
-            PersistenceCapable p = (PersistenceCapable)pc;
-            if (p.jdoIsPersistent()) {
-                return _txCache.getExternalObjectId(p, transactional);
-            }
-        }
-        // All other cases if no exception thrown
-        return null;
-    }
-
-    /**
-     * assert that the associated Transaction is active 
-     */
-    private void assertActiveTransaction(boolean insideQuery) {
-        if (_flushing || (insideQuery && _transaction.getNontransactionalRead())) {
-             return;
-        }
-
-        if (!_activeTransaction) {
-            throw new JDOUserException(msg.msg(
-                "EXC_TransactionNotActive"));// NOI18N
-        }
-
-    }
-
-    /**
-     * assert Object is PersistenceCapable
-     */
-    private void assertPersistenceCapable(Object pc, String caller) {
-        if ( !(pc instanceof PersistenceCapable) ) {
-            String message = null;
-            if (pc instanceof Collection) {
-                message = msg.msg("EXC_CollectionType", caller); // NOI18N
-            } else if (pc.getClass().isArray()) {
-                message = msg.msg("EXC_ArrayType", caller);
-            } else {
-                message = msg.msg("EXC_NotPersistenceCapable", pc.getClass().getName()); // NOI18N
-            }
-            throw new JDOUserException(message, pc);
-        }
-
-    }
-
-    /**
-     * assert PersistenceCapable is associated with this instance of PersistenceManager
-     */  
-    private void assertPersistenceManager(PersistenceCapable pc) {
-        // pc.jdoGetPersistenceManager() returns the wrapper. It should compare equals
-        // to this PersistenceManager:
-        if (!this.equals(pc.jdoGetPersistenceManager())) {
-            throw new JDOUserException(msg.msg(
-                 "EXC_AnotherPersistenceManager"));// NOI18N
-        }
-    }
-
-    /**
-     * Helper method to validate errors on processing arrays of objects.
-     * @param l actual size of the array
-     * @param err array of Throwable to validate
-     * @throws JDOUserException if <code>l</code> is greater than 0.
-     */  
-    private void validateResult(int l, Throwable[] err) {
-        if (l > 0) {
-            Throwable[] t = new Throwable[l];
-            System.arraycopy(err, 0, t, 0, l);
-            throw new JDOUserException(msg.msg(
-                "EXC_FailedToProcessAll"), t); //(Throwable[])err.toArray());// NOI18N
-        } 
-    }
-    /**
-     * Helper method to calculate initialSize of the Collection or Map if
-     * null is specifield for the new tracked instance.
-     *
-     * @param type Class type for which the request is processed.
-     * @return default initialSize as Integer.
-     */  
-    private Integer getInitialSize(Class type) {
-        if (type.equals(org.apache.jdo.impl.sco.HashSet.class) ||
-            type.equals(org.apache.jdo.impl.sco.HashMap.class) ||
-            type.equals(org.apache.jdo.impl.sco.Hashtable.class)) {
-            return int11;
-        } else {
-            return int10;
-        }
-    }
-    
-    //
-    // Internal methods to process state transitions requests.
-    //
-
-    /**
-     * Internal method for processing makePersistent request.
-     * @see #makePersistent(Object pc)
-     */
-    private Object makePersistentInternal(Object pc) {
-        if (pc == null) {
-            if (debugging())
-                debug("makePersistentInternal null"); // NOI18N
-            return null;        // ignore
-        }
-        if (debugging())
-            debug("makePersistentInternal for " + pc.getClass().getName()); // NOI18N
-
-        assertPersistenceCapable(pc, "makePersistent");
-        if (debugging())
-            debug("makePersistentInternal is pc"); // NOI18N
-
-        PersistenceCapable p = (PersistenceCapable)pc;
-        return _txCache.makePersistent(p);
-    }
-
-    /**
-     * Internal method for processing makePersistentAll request.
-     * @see #makePersistentAll(Object[] pcs)
-     */
-    private Object[] makePersistentAllInternal(Object[] pcs) {
-        Object[] result = new Object[pcs.length];
-        Throwable[] err = new Throwable[pcs.length];
-        int l = 0;
-
-        if (debugging())
-            debug("makePersistentAllInternal " + pcs.length); // NOI18N
-        for(int i = 0; i < pcs.length; i++) {
-            try {
-                result[i] = makePersistentInternal(pcs[i]);
-            } catch (Throwable e) {
-                err[l++] = e;
-            }
-        }
-        validateResult(l, err);
-        return result;
-    }
-
-    /**
-     * Internal method to process deletePersistent call.
-     * @see #deletePersistent(Object pc)
-     */
-    private void deletePersistentInternal(Object pc) {
-        if (pc == null) {
-            return;        // ignore
-        }
-        assertPersistenceCapable(pc, "deletePersistent");
-        
-        PersistenceCapable p = (PersistenceCapable)pc;
-
-        if( !(p.jdoIsPersistent()) ) {
-            throw new JDOUserException(msg.msg(
-                "EXC_TransientInstance", pc.getClass().getName()));// NOI18N
-        }
-
-        StateManagerInternal sm = findStateManager(p);
-        sm.deletePersistent();
-    }
-    
-    /**
-     * Internal method to process deletePersistentAll call.
-     * @see #deletePersistentAll(Object[] pcs)
-     */
-    private void deletePersistentAllInternal(Object[] pcs) {
-        Throwable[] err = new Throwable[pcs.length];
-        int l = 0;
-
-        for(int i = 0; i < pcs.length; i++) { 
-            try {
-                deletePersistentInternal(pcs[i]); 
-            } catch (Throwable e) {
-                err[l++] = e;
-            }
-        }
-        validateResult(l, err);
-    }
-
-    /**
-     * Internal method to process makeTransient call.
-     * @see #makeTransient(Object pc)
-     */  
-    private void makeTransientInternal(Object pc) {
-        if (pc == null) {
-            return;        // ignore
-        }
-        assertPersistenceCapable(pc, "makeTransient");
-
-        PersistenceCapable p = (PersistenceCapable)pc;
-        _txCache.makeTransient(p);
-    }
-
-    /**
-     * Internal method to process makeTransientAll call.
-     * @see #makeTransientAll(Object[] pcs)
-     */  
-    private void makeTransientAllInternal(Object[] pcs) {
-        Throwable[] err = new Throwable[pcs.length];
-        int l = 0;
-
-        for(int i = 0; i < pcs.length; i++) { 
-            try {
-                makeTransientInternal(pcs[i]);
-            } catch (Throwable e) {
-                err[l++] = e;
-            }
-        }
-        validateResult(l, err);
-    }
-
-    /**
-     * Internal method to process makeTransactional call.
-     * @see #makeTransactional(Object pc)
-     */  
-    private void makeTransactionalInternal(Object pc) {
-        if (pc == null) {
-            return;        // ignore
-        }
-        assertPersistenceCapable(pc, "makeTransactional");
-        
-        PersistenceCapable p = (PersistenceCapable)pc;
-        if (p.jdoIsPersistent()) {
-            assertActiveTransaction(false);
-        }
-
-        _txCache.makeTransactional(p);
-    }
-
-    /**
-     * Internal method to process makeTransactionalAll call.
-     * @see #makeTransactionalAll(Object[] pcs)
-     */  
-    private void makeTransactionalAllInternal(Object[] pcs) {
-        Throwable[] err = new Throwable[pcs.length];
-        int l = 0;
-
-        for(int i = 0; i < pcs.length; i++) {
-            try {
-                makeTransactionalInternal(pcs[i]);
-            } catch (Throwable e) {
-                err[l++] = e;
-            }
-        }
-        validateResult(l, err);
-    }
-
-    /**
-     * Internal method to process makeNontransactional  call.
-     * @see #makeNontransactional(Object pc)
-     */  
-    private void makeNontransactionalInternal(Object pc) {
-        if (pc == null) {
-            return;        // ignore
-        }
-        assertPersistenceCapable(pc, "makeNontransactional");
-        
-        PersistenceCapable p = (PersistenceCapable)pc;
-        _txCache.makeNontransactional(p);
-    }
-
-    /**
-     * Internal method to process makeNontransactionalAll  call.
-     * @see #makeNontransactionalAll(Object[] pcs)
-     */  
-    private void makeNontransactionalAllInternal(Object[] pcs) {
-        Throwable[] err = new Throwable[pcs.length];
-        int l = 0;
-
-        for(int i = 0; i < pcs.length; i++) {
-            try {
-                makeNontransactionalInternal(pcs[i]);
-            } catch (Throwable e) {
-                err[l++] = e;
-            }
-        }
-        validateResult(l, err);
-    }
-
-    /**
-     * Internal method to process evict call.
-     * @see #evict(Object pc)
-     */  
-    private void evictInternal(Object pc) {
-        if (pc == null) {
-            return;        // ignore
-        }
-        assertPersistenceCapable(pc, "evict");
-
-        PersistenceCapable p = (PersistenceCapable)pc;
-        _txCache.evict(p);
-    }
-
-    /**
-     * Internal method to process evictAll call.
-     * @see #evictAll(Object[] pcs)
-     */  
-    private void evictAllInternal(Object[] pcs) {
-        Throwable[] err = new Throwable[pcs.length];
-        int l = 0;
-
-        for(int i = 0; i < pcs.length; i++) {
-            try {
-                evict(pcs[i]);
-            } catch (Throwable e) {
-                err[l++] = e;
-            }
-        }
-        validateResult(l, err);
-    }
-
-    /**
-     * Internal method to process refresh call.
-     * @see #refresh(Object pc)
-     */  
-    private void refreshInternal(Object pc) {
-        if (pc == null) {
-            return;        // ignore
-        }
-        assertPersistenceCapable(pc, "refresh");
-
-        PersistenceCapable p = (PersistenceCapable)pc;
-        _txCache.refresh(p);
-    }
-
-    /**
-     * Internal method to process refreshAll call.
-     * @see #refreshAll(Object[] pcs)
-     */  
-    private void refreshAllInternal(Object[] pcs) {
-        Throwable[] err = new Throwable[pcs.length];
-        int l = 0;
-
-        for(int i = 0; i < pcs.length; i++) {
-            try {
-                refresh(pcs[i]);
-            } catch (Throwable e) {
-                err[l++] = e;
-            }
-        }
-        validateResult(l, err);
-    }
-
-    /**
-     * Internal method to process retrieve call.
-     * @see #retrieve(Object pc)
-     */  
-    private void retrieveInternal(Object pc, boolean DFGOnly) {
-        // XXX the DFGOnly flag is ignored here.
-        if (pc == null) {
-            return;        // ignore
-        }
-        assertPersistenceCapable(pc, "retrieve");
-
-        PersistenceCapable p = (PersistenceCapable)pc;
-        _txCache.retrieve(p);
-    }
-
-    /**
-     * Internal method to process retrieveAll call.
-     * @see #retrieveAll(Object[] pcs)
-     */  
-    private void retrieveAllInternal(Object[] pcs, boolean DFGOnly) {
-        Throwable[] err = new Throwable[pcs.length];
-        int l = 0;
-
-        for(int i = 0; i < pcs.length; i++) {
-            try {
-                retrieveInternal(pcs[i], DFGOnly);
-            } catch (Throwable e) {
-                err[l++] = e;
-            }
-        }
-        validateResult(l, err);
-    }
-
-    /**
-     * Tracing method
-     * @param msg String to display
-     */
-    private void debug(String msg) {
-        logger.debug("In PersistenceManagerImpl " + msg); // NOI18N
-    }
-
-    /**
-     * Verifies if debugging is enabled.
-     * @return true if debugging is enabled.
-     */
-    private boolean debugging() {
-        return logger.isDebugEnabled();
-    }
-
-    /**
-     * Calls getContextClassLoader for the current Thread in a
-     * doPrivileged block. 
-     * @return the context class loader of the current Thread
-     * @exception SecurityException thrown by getContextClassLoader.
-     */
-    public ClassLoader getContextClassLoaderPrivileged()
-        throws SecurityException
-    {
-        return (ClassLoader) AccessController.doPrivileged (
-            new PrivilegedAction () {
-                public Object run () {
-                    return Thread.currentThread().getContextClassLoader();
-                }
-            }
-            );
-    }
-    
-    /**
-     * Assert the NontransactionalRead flag is true or a transaction is active.
-     */
-    public void assertReadAllowed() {
-        assertIsOpen();
-        _transaction.assertReadAllowed();
-    }
-    
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java b/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java
deleted file mode 100644
index 5c5cf13..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/pm/PersistenceManagerWrapper.java
+++ /dev/null
@@ -1,1179 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * PersistenceManagerWrapper.java
- *
- * Created on January 16, 2001
- */
- 
-package org.apache.jdo.impl.pm;
-
-import java.util.*;
-
-import javax.jdo.*;
-import javax.jdo.datastore.JDOConnection;
-import javax.jdo.datastore.Sequence;
-import javax.jdo.listener.InstanceLifecycleListener;
-
-import org.apache.jdo.pm.PersistenceManagerInternal;
-import org.apache.jdo.util.I18NHelper;
-
-
-/**  
- * This is a thin wrapper for the current implemetation of javax.jdo.PersistenceManager
- * interface. Delegates most of method execution to the corresponding instance of 
- * the PersistenceManagerImpl. Becomes invalid after PersistenceManager is closed.
- *  
- * @author Marina Vatkina 
- */  
-public class PersistenceManagerWrapper implements PersistenceManager {
-
-    // Previous  PersistenceManagerWrapper
-    private PersistenceManagerWrapper prev = null;
-
-    // Actual  PersistenceManager
-    private PersistenceManagerImpl pm = null;
-
-    // Boolean flag that allows to use this wrapper
-    private boolean isValid = false;
-
-    /**
-     * I18N message handler
-     */
-     private final static I18NHelper msg = 
-        I18NHelper.getInstance("org.apache.jdo.impl.pm.Bundle"); // NOI18N
-
-    // Constructed by  PersistenceManagerFactoryImpl
-    PersistenceManagerWrapper(PersistenceManagerImpl pm) {
-        this.pm = pm;
-        prev = (PersistenceManagerWrapper)pm.getCurrentWrapper();
-        pm.pushCurrentWrapper(this);
-        isValid = true;
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#isClosed()
-     */
-    public boolean isClosed() {
-        if (isValid) {
-            return pm.isClosed();
-        } else {
-            return true;
-        }
-    }
-
-
-   /**
-    * @see javax.jdo.PersistenceManager#close()
-    */
-    public void close() {
-        if (isValid) { 
-            pm.popCurrentWrapper(prev);
-            isValid = false;
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-     /** 
-      * @see javax.jdo.PersistenceManager#currentTransaction()
-      */
-    public Transaction currentTransaction() {
-        if (isValid) { 
-            return pm.currentTransaction();
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-
-    /**
-     * @see javax.jdo.PersistenceManager#setIgnoreCache(boolean flag)
-     */
-    public void setIgnoreCache(boolean flag) {
-        if (isValid) {
-            pm.setIgnoreCache(flag);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#getIgnoreCache()
-     */
-    public boolean getIgnoreCache() {
-        if (isValid) {
-            return pm.getIgnoreCache();
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#setIgnoreCache(boolean flag)
-     */
-    public void setDetachAllOnCommit(boolean flag) {
-        if (isValid) {
-            pm.setDetachAllOnCommit(flag);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#getIgnoreCache()
-     */
-    public boolean getDetachAllOnCommit() {
-        if (isValid) {
-            return pm.getDetachAllOnCommit();
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#getMultithreaded()
-     */
-    public boolean getMultithreaded() {
-        if (isValid) {
-            return pm.getMultithreaded();
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#setMultithreaded(boolean flag)
-     */
-    public void setMultithreaded(boolean flag) {
-        if (isValid) {
-            pm.setMultithreaded(flag);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#evict(Object pc)
-     */
-    public  void evict(Object pc) {
-        if (isValid) {
-            pm.evict(pc);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#evictAll(Object[] pcs)
-     */
-    public  void evictAll(Object[] pcs) {
-        if (isValid) {
-            pm.evictAll(pcs);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#evictAll(Collection pcs)
-     */
-    public  void evictAll(Collection pcs) {
-        if (isValid) {
-            pm.evictAll(pcs);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#evictAll()
-     */
-    public  void evictAll() {
-        if (isValid) {
-            pm.evictAll();
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#refresh(Object pc)
-     */
-    public  void refresh(Object pc) {
-        if (isValid) {
-            pm.refresh(pc);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#refreshAll(Object[] pcs)
-     */
-    public  void refreshAll(Object[] pcs) {
-        if (isValid) {
-            pm.refreshAll(pcs);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#refreshAll(Collection pcs)
-     */
-    public  void refreshAll(Collection pcs) {
-        if (isValid) {
-            pm.refreshAll(pcs);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#refreshAll()
-     */
-    public  void refreshAll() {
-        if (isValid) {
-            pm.refreshAll();
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /**
-     * @see javax.jdo.PersistenceManager#refreshAll(JDOException jdoe)
-     */
-    public  void refreshAll(JDOException jdoe) {
-        if (isValid) {
-            pm.refreshAll(jdoe);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        }
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery()
-     */
-    public Query newQuery(){
-        if (isValid) { 
-            return pm.newQuery();
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(Object compiled)
-     */
-    public Query newQuery(Object compiled){
-        if (isValid) { 
-            return pm.newQuery(compiled);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(String query)
-     */
-    public Query newQuery(String query){
-        if (isValid) { 
-            return pm.newQuery(query);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(Class cls)
-     */
-    public Query newQuery(Class cls){
-        if (isValid) { 
-            return pm.newQuery(cls);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(Extent cln)
-     */
-    public Query newQuery(Extent cln){
-        if (isValid) { 
-            return pm.newQuery(cln);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(Class cls,Collection cln)
-     */
-    public Query newQuery(Class cls,Collection cln){
-        if (isValid) { 
-            return pm.newQuery(cls, cln);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(String language, Object query)
-     */
-    public Query newQuery (String language, Object query){
-        if (isValid) { 
-            return pm.newQuery(language, query);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(Class cls, String filter)
-     */
-    public Query newQuery (Class cls, String filter){
-        if (isValid) { 
-            return pm.newQuery(cls, filter);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(Class cls, Collection cln, String filter)
-     */
-    public Query newQuery (Class cls, Collection cln, String filter){
-        if (isValid) { 
-            return pm.newQuery(cls, cln, filter);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#newQuery(Extent cln, String filter)
-     */
-    public Query newQuery (Extent cln, String filter){
-        if (isValid) { 
-            return pm.newQuery(cln, filter);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#newNamedQuery(Class cls, String queryName)
-     */
-    public Query newNamedQuery(Class cls, String queryName) {
-        if (isValid) { 
-            return pm.newNamedQuery(cls, queryName);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#getExtent(Class persistenceCapableClass,
-     * boolean subclasses)
-     */
-    public Extent getExtent(Class persistenceCapableClass,boolean subclasses){
-        if (isValid) { 
-            return pm.getExtent(persistenceCapableClass, subclasses);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getExtent(Class persistenceCapableClass)
-     */
-    public Extent getExtent(Class persistenceCapableClass){
-        if (isValid) { 
-            return pm.getExtent(persistenceCapableClass);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectById(Object oid, boolean validate)
-     */
-    public Object getObjectById(Object oid, boolean validate){
-        if (isValid) { 
-            return pm.getObjectById(oid, validate);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectById(Class cls, Object key)
-     */
-    public Object getObjectById(Class cls, Object key){
-        if (isValid) { 
-            return pm.getObjectById(cls, key);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectById(Object oid)
-     */
-    public Object getObjectById(Object oid){
-        if (isValid) { 
-            return pm.getObjectById(oid);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectId(Object pc)
-     */
-    public Object getObjectId(Object pc){
-        if (isValid) { 
-            return pm.getObjectId(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#getTransactionalObjectId (Object pc)
-     */
-    public Object getTransactionalObjectId (Object pc) {
-        if (isValid) { 
-            return pm.getTransactionalObjectId(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#newObjectIdInstance (Class pcClass, Object key)
-     */
-    public Object newObjectIdInstance (Class pcClass, Object key) {
-        if (isValid) { 
-            return pm.newObjectIdInstance (pcClass, key);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectsById (Collection oids, boolean validate)
-     */
-    public Collection getObjectsById (Collection oids, boolean validate) {
-        if (isValid) { 
-            return pm.getObjectsById (oids, validate);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectsById (Collection oids)
-     */
-    public Collection getObjectsById (Collection oids) {
-        if (isValid) { 
-            return pm.getObjectsById (oids);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectsById (Object[] oids, boolean validate)
-     */
-    public Object[] getObjectsById (Object[] oids, boolean validate) {
-        if (isValid) { 
-            return pm.getObjectsById (oids, validate);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectsById (Object[] oids)
-     */
-    public Object[] getObjectsById (Object[] oids) {
-        if (isValid) { 
-            return pm.getObjectsById (oids);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#makePersistent(Object pc)
-     */
-    public Object makePersistent(Object pc){
-        if (isValid) { 
-            return pm.makePersistent(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makePersistentAll(Object[] pc)
-     */
-    public Object[] makePersistentAll(Object[] pcs){
-        if (isValid) { 
-            return pm.makePersistentAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makePersistentAll(Collection pcs)
-     */
-    public Collection makePersistentAll (Collection pcs){
-        if (isValid) { 
-            return pm.makePersistentAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#deletePersistent(Object pc)
-     */
-    public void deletePersistent(Object pc){
-        if (isValid) { 
-            pm.deletePersistent(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#deletePersistentAll(Object[] pc)
-     */
-    public void deletePersistentAll (Object[] pcs){
-        if (isValid) { 
-            pm.deletePersistentAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#deletePersistentAll(Collection pc)
-     */
-    public void deletePersistentAll (Collection pcs){
-        if (isValid) { 
-            pm.deletePersistentAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransient(Object pc)
-     */
-    public void makeTransient(Object pc){
-        if (isValid) { 
-            pm.makeTransient(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransientAll(Object[] pc)
-     */
-    public void makeTransientAll(Object[] pcs){
-        if (isValid) { 
-            pm.makeTransientAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransientAll(Collection pcs)
-     */
-    public void makeTransientAll (Collection pcs){
-        if (isValid) { 
-            pm.makeTransientAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransient
-     * (Object pc, boolean useFetchPlan)
-     */
-    public void makeTransient(Object pc, boolean useFetchPlan){
-        if (isValid) { 
-            pm.makeTransient(pc, useFetchPlan);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransientAll
-     * (Object[] pc, boolean useFetchPlan)
-     */
-    public void makeTransientAll(Object[] pcs, boolean useFetchPlan){
-        if (isValid) { 
-            pm.makeTransientAll(pcs, useFetchPlan);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransientAll
-     * (Collection pcs, boolean useFetchPlan)
-     */
-    public void makeTransientAll (Collection pcs, boolean useFetchPlan){
-        if (isValid) { 
-            pm.makeTransientAll(pcs, useFetchPlan);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransactional(Object pc)
-     */
-    public void makeTransactional(Object pc){
-        if (isValid) { 
-            pm.makeTransactional(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransactionalAll(Object[] pc)
-     */
-    public void makeTransactionalAll(Object[] pcs){
-        if (isValid) { 
-            pm.makeTransactionalAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeTransactionalAll(Collection pcs)
-     */
-    public void makeTransactionalAll (Collection pcs){
-        if (isValid) { 
-            pm.makeTransactionalAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /*
-     * @see javax.jdo.PersistenceManager#makeNontransactional(Object pc)
-     */
-    public void makeNontransactional(Object pc){
-        if (isValid) { 
-            pm.makeNontransactional(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeNontransactionalAll(Object[] pc)
-     */
-    public void makeNontransactionalAll(Object[] pcs){
-        if (isValid) { 
-            pm.makeNontransactionalAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#makeNontransactionalAll(Collection pcs)
-     */
-    public void makeNontransactionalAll (Collection pcs){
-        if (isValid) { 
-            pm.makeNontransactionalAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** Retrieve all field values of an instance from the store. 
-     * <P>The PersistenceManager might use policy information about the
-     * class to retrieve associated instances.
-     * @param pc the instance to retrieve
-     */
-    public void retrieve(Object pc) {
-        if (isValid) { 
-            pm.retrieve(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** Retrieve field values of an instance from the store. If the FGOnly
-     * flag is false, retrieve all field values. If the FGOnly flag is true,
-     * retrieve only fields defined in the fetch plan.
-     * <P>The PersistenceManager might use policy information about the
-     * class to retrieve associated instances.
-     * @param pc the instance to retrieve
-     * @param FGOnly whether to retrieve only the fetch group fields defined
-     * in the fetch plan
-     * @since 2.0
-     */
-    public void retrieve(Object pc, boolean FGOnly) {
-        if (isValid) { 
-            pm.retrieve(pc, FGOnly);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** Retrieve field values of instances from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instances, and all field values must be retrieved.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pcs the instances
-     */
-    public void retrieveAll(Object[] pcs) {
-        if (isValid) { 
-            pm.retrieveAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** Retrieve field values of instances from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instances, and their field values should be retrieved.  The fields
-     * in the default fetch group must be retrieved, and the implementation
-     * might retrieve more fields than the default fetch group.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pcs the instances
-     * @param FGOnly whether to retrieve only the fetch group fields defined
-     * in the fetch plan
-     * @since 1.0.1
-     */
-    public void retrieveAll (Object[] pcs, boolean FGOnly) {
-        if (isValid) { 
-            pm.retrieveAll(pcs, FGOnly);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-           
-    /** Retrieve field values of instances from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instances, and all field values must be retrieved.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pcs the instances
-     */
-    public void retrieveAll(Collection pcs) {
-        if (isValid) { 
-            pm.retrieveAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** Retrieve field values of instances from the store.  This tells
-     * the <code>PersistenceManager</code> that the application intends to use the
-     * instances, and their field values should be retrieved.  The fields
-     * in the default fetch group must be retrieved, and the implementation
-     * might retrieve more fields than the default fetch group.
-     * <P>The <code>PersistenceManager</code> might use policy information about the
-     * class to retrieve associated instances.
-     * @param pcs the instances
-     * @param FGOnly whether to retrieve only the fetch group fields defined
-     * in the fetch plan
-     * @since 1.0.1
-     */
-    public void retrieveAll (Collection pcs, boolean FGOnly) {
-        if (isValid) {
-            pm.retrieveAll(pcs, FGOnly);
-        } else {
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-            
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#getPersistenceManagerFactory()
-     */
-    public PersistenceManagerFactory getPersistenceManagerFactory(){
-        if (isValid) { 
-            return pm.getPersistenceManagerFactory();
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-   }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#setUserObject(Object o)
-     */
-    public void setUserObject(Object o){
-        if (isValid) { 
-            pm.setUserObject(o);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#getUserObject()
-     */
-    public Object getUserObject(){
-        if (isValid) { 
-            return pm.getUserObject();
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-    
-    /** 
-     * @see javax.jdo.PersistenceManager#getObjectIdClass(Class cls)
-     */
-    public Class getObjectIdClass(Class cls){
-        if (isValid) { 
-            return pm.getObjectIdClass(cls);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#detachCopy (Object pc)
-     */
-    public Object detachCopy (Object pc) {
-        if (isValid) { 
-            return pm.detachCopy(pc);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#detachCopyAll (Collection pcs)
-     */
-    public Collection detachCopyAll (Collection pcs) {
-        if (isValid) { 
-            return pm.detachCopyAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#detachCopyAll (Object [] pcs)
-     */
-    public Object[] detachCopyAll (Object [] pcs) {
-        if (isValid) { 
-            return pm.detachCopyAll(pcs);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#attachCopy (Object pc, boolean makeTransactional)
-     */
-    public Object attachCopy (Object pc, boolean makeTransactional) {
-        if (isValid) { 
-            return pm.attachCopy(pc, makeTransactional);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#attachCopyAll (Collection pcs, boolean makeTransactional)
-     */
-    public Collection attachCopyAll (Collection pcs, boolean makeTransactional) {
-        if (isValid) { 
-            return pm.attachCopyAll(pcs, makeTransactional);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#attachCopyAll (Object[] pcs, boolean makeTransactional)
-     */
-    public Object[] attachCopyAll (Object[] pcs, boolean makeTransactional) {
-        if (isValid) { 
-            return pm.attachCopyAll(pcs, makeTransactional);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#putUserObject (Object key, Object val)
-     */
-    public Object putUserObject (Object key, Object val) {
-        if (isValid) { 
-            return pm.putUserObject(key, val);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getUserObject (Object key)
-     */
-    public Object getUserObject (Object key) {
-        if (isValid) { 
-            return pm.getUserObject(key);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#removeUserObject (Object key)
-     */
-    public Object removeUserObject (Object key) {
-        if (isValid) { 
-            return pm.removeUserObject(key);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#flush ()
-     */
-    public void flush () {
-        if (isValid) { 
-            pm.flush();
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#checkConsistency ()
-     */
-    public void checkConsistency () {
-        if (isValid) { 
-            pm.checkConsistency();
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getFetchPlan ()
-     */
-    public FetchPlan getFetchPlan () {
-        if (isValid) { 
-            return pm.getFetchPlan();
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#newInstance (Class pcClass)
-     */
-    public Object newInstance (Class pcClass) {
-        if (isValid) { 
-            return pm.newInstance(pcClass);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getSequence (String name)
-     */
-    public Sequence getSequence (String name) {
-        if (isValid) { 
-            return pm.getSequence(name);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#getDataStoreConnection ()
-     */
-    public JDOConnection getDataStoreConnection () {
-        if (isValid) { 
-            return pm.getDataStoreConnection();
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#addInstanceLifecycleListener (
-     * InstanceLifecycleListener listener, Class[] classes)
-     */
-    public void addInstanceLifecycleListener (
-        InstanceLifecycleListener listener, Class[] classes) {
-        if (isValid) { 
-            pm.addInstanceLifecycleListener(listener, classes);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /** 
-     * @see javax.jdo.PersistenceManager#removeInstanceLifecycleListener (
-     * InstanceLifecycleListener listener)
-     */
-    public void removeInstanceLifecycleListener (
-        InstanceLifecycleListener listener) {
-        if (isValid) { 
-            pm.removeInstanceLifecycleListener(listener);
-        } else { 
-            throw new JDOFatalUserException(msg.msg(
-                "EXC_PersistenceManagerClosed"));// NOI18N
-        } 
-    }
-
-    /**
-     * Returns PersistenceManagerInternal associated with this wrapper.
-     * This method should be accessed by the PersistenceManagerInternal
-     * only.
-     * @return PersistenceManagerInternal.
-     */
-    protected PersistenceManagerInternal getPersistenceManager() {
-        return (PersistenceManagerInternal)pm;
-    }
-
-    /** 
-     * Returns a hash code value for this PersistenceManagerWrapper.
-     * @return  a hash code value for this PersistenceManagerWrapper.
-     */
-    public int hashCode() {
-        return pm.hashCode();
-    }
-
-    /**  
-     * Indicates whether some other object is "equal to" this one.
-     * @param   obj   the reference object with which to compare.
-     * @return  <code>true</code> if this object is the same as the obj
-     *          argument; <code>false</code> otherwise.
-     */  
-    public boolean equals(Object obj) {
-        if (obj instanceof PersistenceManagerWrapper) {
-            return (((PersistenceManagerWrapper)obj).pm == this.pm);
-
-        } else if (obj instanceof PersistenceManagerImpl) {
-            return (((PersistenceManagerImpl)obj) == this.pm);
-        }
-        return false;
-    }
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java b/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java
deleted file mode 100644
index 663c1ef..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/pm/TransactionImpl.java
+++ /dev/null
@@ -1,1181 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * TransactionImpl.java
- *
- * Create on December 1, 2000
- */
-
-package org.apache.jdo.impl.pm;
-
-import java.util.*;
-import javax.transaction.*;
-
-import javax.jdo.*;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.jdo.ejb.EJBImplHelper;
-import org.apache.jdo.store.Connector;
-import org.apache.jdo.store.StoreManager;
-import org.apache.jdo.util.I18NHelper;
-
-/**
- *
- * The Transaction interface allows operations to be performed against
- * the transaction in the target Transaction object. A Transaction 
- * object is created corresponding to each PersistentManagerImpl creation.
- * The Transaction object can be used for synchronization registration, 
- * transaction completion and status query operations.
- *
- * This implementation is StoreManager independent.
- *
- * @author Marina Vatkina
- */
-class TransactionImpl implements javax.jdo.Transaction {
-
-    /**
-     * Transaction status (from javax.transaction.Status).
-     */
-    private int            status;
-
-    /**
-     * The commit process has already begun (even though the status is still
-     * STATUS_ACTIVE).  This is the first thing set during commit or rollback.
-     */
-    private boolean        startedCommit;
-
-    /**
-     * Registered Synchronization object.
-     */
-    private Object    synchronization;
-
-    /**
-     * Synchronisation object associated with this transaction instance
-     */
-    private Object txSync = null;
-    
-    /**
-     * PersistenceManagerFactory associated with this transaction 
-     */
-    private PersistenceManagerFactoryImpl pmFactory = null;
-    
-    /**
-     * PersistenceManager associated with this transaction (1-1)
-     */
-    private PersistenceManagerImpl    persistenceManager     = null;
-
-    /**
-     * Connector associated with this transaction 
-     */
-    private Connector    connector     = null;
-
-    /**
-     * javax.transaction.Transaction instance associated with the current
-     * thread or null if there is none.
-     */
-    private javax.transaction.Transaction jta = null;
-
-    /**
-     * Flag that indicates how to handle objects after commit.
-     * If true, at commit instances retain their values and the instances
-     */
-    private boolean retainValues = true;
-
-    /**
-     * Flag that indicates how to handle objects after rollback.
-     * If true, at rollback instances have their values restored.
-     */
-    private boolean restoreValues = true;
-
-    /**
-     * Flag that indicates type of the transaction.
-     * Optimistic transactions do not hold data store locks until commit time.
-     */
-    private boolean optimistic = true;
-
-    /**
-     * Flag that indicates if queries and navigation are allowed
-     * without an active transaction
-     */
-    private boolean nontransactionalRead = true;    
-
-    /**
-     * Flag that indicates if write access is allowed
-     * without an active transaction
-     */
-    private boolean nontransactionalWrite = true;
-
-    /** values for the datasource user and user password to access
-     * security connections
-     */
-    private String         username     = null;
-    private String         password     = null;
-
-    /**
-     * Possible values of txType
-     */
-    protected static final int NON_MGD = 0;
-    protected static final int CMT = 1;
-    protected static final int BMT_UT = 2;
-    protected static final int BMT_JDO = 3;
-
-    /**
-     * Flag to indicate usage mode (non-managed versus managed, and so on).
-     */
-    private int txType = -1;
-
-    /**
-     * Logger instance
-     */
-    private static final Log logger = LogFactory.getFactory().getInstance(
-        "org.apache.jdo.impl.pm"); // NOI18N
-
-    /**
-     * I18N message handler
-     */
-     private final static I18NHelper msg = 
-        I18NHelper.getInstance("org.apache.jdo.impl.pm.Bundle"); // NOI18N
-    
-    /**
-     * Constructors new instance of TransactionImpl for the corresponding
-     * PersistenceManagerImpl. Username and password are provided for future
-     * validation and Connector request.
-     *
-     * @param pm calling instance of PersistenceManagerImpl
-     * @param pmf PersistenceManagerFactoryImpl associated with the instance of
-     * PersistenceManagerImpl
-     * @param username user name for Connector request
-     * @param password user password for Connector request
-     */
-    TransactionImpl(PersistenceManagerImpl pm, PersistenceManagerFactoryImpl pmf,
-        String username, String password) {
-
-        this.status = Status.STATUS_NO_TRANSACTION;
-        this.startedCommit = false;
-        this.persistenceManager = pm;
-
-        pmFactory = pmf;
-        optimistic = pmFactory.getOptimistic();
-        retainValues = pmFactory.getRetainValues();
-        restoreValues = pmFactory.getRestoreValues();
-        nontransactionalRead = pmFactory.getNontransactionalRead();
-        nontransactionalWrite = pmFactory.getNontransactionalWrite();
-
-        this.username = username;
-        this.password = password;
-
-    }
-
-    //
-    // ----- Methods from javax.jdo.Transaction interface ------
-    //
-
-    /**
-     * Returns PersistenceManager associated with this transaction
-     * @see javax.jdo.Transaction#getPersistenceManager()
-     */
-    public javax.jdo.PersistenceManager getPersistenceManager() {
-        persistenceManager.assertIsOpen();
-        return (javax.jdo.PersistenceManager) persistenceManager.getCurrentWrapper();
-    }
-
-    /**
-     * @see javax.jdo.Transaction#isActive()
-     */
-    public boolean isActive() {
-        persistenceManager.assertIsOpen();
-        return !isTerminated();
-    }
-
-    /**
-     * @see javax.jdo.Transaction#setRetainValues(boolean flag)
-     */
-    public void setRetainValues(boolean flag) {
-        persistenceManager.assertIsOpen();
-
-        // Cannot change flag value when transaction commit is in progress.
-        if (startedCommit)
-            throw new JDOUserException(msg.msg(
-                "EXC_CannotSetFlag")); // NOI18N
-
-        this.retainValues = flag;
-    }
-
-    /**
-     * @see javax.jdo.Transaction#getRetainValues()
-     */
-    public boolean getRetainValues() {
-        persistenceManager.assertIsOpen();
-        return retainValues;
-    }
-
-    /**
-     * @see javax.jdo.Transaction#setRestoreValues(boolean flag)
-     */
-    public void setRestoreValues(boolean flag) {
-        persistenceManager.assertIsOpen();
-        // Cannot change flag if transaction is active.
-        if (isActive()) {
-            throw new JDOUserException(msg.msg(
-                "EXC_CannotSetFlagIfActive")); // NOI18N
-        }
-        this.restoreValues = flag;
-    }
-
-    /**
-     * @see javax.jdo.Transaction#getRestoreValues()
-     */
-    public boolean getRestoreValues() {
-        persistenceManager.assertIsOpen();
-        return restoreValues;
-    }
-
-    /**
-     * @see javax.jdo.Transaction#setNontransactionalRead(boolean flag)
-     */
-    public synchronized void setNontransactionalRead (boolean flag) {
-        persistenceManager.assertIsOpen();
-
-        // Cannot change flag value when transaction commit is in progress.
-        if (startedCommit)
-            throw new JDOUserException(msg.msg(
-                "EXC_CannotSetFlag")); // NOI18N
-
-        this.nontransactionalRead = flag;
-
-    }
-
-    /**
-     * @see javax.jdo.Transaction#getNontransactionalRead()
-     */
-    public boolean getNontransactionalRead() {
-        persistenceManager.assertIsOpen();
-        return nontransactionalRead;
-    }
-
-    /**
-     * @see javax.jdo.Transaction#setNontransactionalWrite(boolean flag)
-     */
-    public synchronized void setNontransactionalWrite (boolean flag) {
-        persistenceManager.assertIsOpen();
-
-        // Cannot change flag value when transaction commit is in progress.
-        if (startedCommit)
-            throw new JDOUserException(msg.msg(
-                "EXC_CannotSetFlag")); // NOI18N
-
-        this.nontransactionalWrite = flag;
-    }
-
-    /**
-     * @see javax.jdo.Transaction#getNontransactionalWrite()
-     */
-    public boolean getNontransactionalWrite() {
-        persistenceManager.assertIsOpen();
-        return nontransactionalWrite;
-    }
-
-    /**
-     * @see javax.jdo.Transaction#setOptimistic(boolean flag)
-     */
-    public synchronized void setOptimistic(boolean flag) {
-        persistenceManager.assertIsOpen();
-
-        if (isTerminated()) {
-            this.optimistic = flag;
-        } else {
-            // Cannot change flag value inside an active transaction.
-            throw new JDOUserException(msg.msg(
-                "EXC_CannotChangeType")); // NOI18N
-        }
-
-        // Notify PM about Tx type change
-        persistenceManager.notifyOptimistic(flag);
-    }
-
-    /**
-     * @see javax.jdo.Transaction#getOptimistic()
-     */
-    public boolean getOptimistic() {
-        persistenceManager.assertIsOpen();
-        return optimistic;
-    }
-
-    /**
-     * @see javax.jdo.Transaction#setSynchronization(Synchronization sync)
-     */
-    public void setSynchronization(Synchronization sync) {
-        persistenceManager.assertIsOpen();
-        if (sync == synchronization) {
-            return; // the same Synchronization.
-
-        } else if (sync != null && synchronization != null) {
-            throw new JDOUserException(msg.msg(
-                "EXC_SynchronizationNotNull")); // NOI18N
-        }
-
-        this.registerSynchronization(sync);
-    }
-
-    /**
-     * @see javax.jdo.Transaction#getRetainValues()
-     */
-    public Synchronization getSynchronization() {
-        persistenceManager.assertIsOpen();
-        return (Synchronization)synchronization;
-    }
-
-    public void assertReadAllowed() {
-        if ((!isActive()) && (!getNontransactionalRead())) {
-            throw new JDOUserException(msg.msg(
-                "EXC_NontransactionalRead"));// NOI18N
-        }
-    }
-    
-    /**
-     * Begin a transaction.
-     * @see javax.jdo.Transaction#begin()
-     */
-    public void begin() {
-        // Check and set status...
-        beginInternal();
-
-       // BMT with JDO Transaction
-       if (EJBImplHelper.isManaged()) {
-           txType = BMT_JDO;
-           try {
-                EJBImplHelper.getUserTransaction().begin();
-                jta = EJBImplHelper.getTransaction();
-                if (txSync == null)
-                    txSync = new TransactionSynchronization(this);
-
-                jta.registerSynchronization((Synchronization)txSync);
-                pmFactory.registerPersistenceManager(persistenceManager, jta);
-
-            } catch (JDOException e) {
-                throw e;     // re-throw it.
-            } catch (Exception e) {
-                throw new JDOFatalInternalException(
-                    "EXC_ErrorRegister", e); // NOI18N
-            }
-        } else {
-            // Mark as non-managed transaction.
-            txType = NON_MGD;
-        }
-        
-    }
-
-    /**
-     * Commit the transaction represented by this Transaction object
-     * @see javax.jdo.Transaction#commit()
-     */
-    public void commit() {
-        persistenceManager.assertIsOpen();
-
-        if (txType == CMT || txType == BMT_UT) {
-            // Error - should not be called
-            throw new JDOUserException(msg.msg(
-                 "EXC_WrongMgdOperation", "commit")); //NOI18N
-        } else if (txType == BMT_JDO) {
-            // Send request to the container:
-            try {
-                EJBImplHelper.getUserTransaction().commit();
-                return;
-            } catch (Exception e) { 
-                throw new JDOException("", e); // NOI18N
-            }
-        }
- 
-        // Proceede with non-managed environment call.
-        synchronized (this) {
-            if (persistenceManager.getDetachAllOnCommit()) {
-                throw new JDOUnsupportedOptionException(msg.msg(
-                    "notsupported", "DetachAllOnCommit"));
-            }
-        
-            //
-            // Disallow parallel transaction completion calls:
-            //
-            if (startedCommit) {
-                throw new JDOUserException(msg.msg(
-                    "EXC_TransactionCommitting")); // NOI18N
-            }
-        
-            // This flag prevents user from making any changes to the transaction object.
-            this.startedCommit = true;
-        }
-
-        if (debugging())
-            this.traceCall("commit"); // NOI18N
-
-        try {
-            this.prepareFlush(true); // do actual beforeComplition.
-            this.commitPrepare(); // check internal status.
-            this.commitComplete(); // commitConnector and set status to success.
-
-        } catch (Throwable e) {
-            try {
-                this.internalRollback();
-            } catch (Exception re) {
-                // Do not rethrow the rollback exception - just log it.
-                if (debugging())
-                    logger.debug("Exception during rollback after failed commit: " + re);
-            }
-
-            if (e instanceof JDOException) {
-                throw (JDOException)e;
-            }
-            throw new JDOException("", e); // NOI18N
-        } finally {
-            this.internalAfterCompletion(); // do afterCompletion and cleanup.
-        }
-    }
-
-    /**
-     * Rollback the transaction represented by this transaction object.
-     * @see javax.jdo.Transaction#rollback()
-     */
-    public void rollback() {
-        persistenceManager.assertIsOpen();
-        if (txType == CMT || txType == BMT_UT) {
-            // Error - should not be called
-            throw new JDOUserException(msg.msg(
-                 "EXC_WrongMgdOperation", "rollback")); //NOI18N
-        }
-
-        if (debugging())
-            this.traceCall("rollback"); // NOI18N
-
-        synchronized (this) {
-            //
-            // Disallow parallel transaction completion calls:
-            //
-            if (startedCommit) {
-                throw new JDOUserException(msg.msg(
-                    "EXC_TransactionCommitting")); // NOI18N
-
-            } else if ((this.status != Status.STATUS_ACTIVE) &&    
-                (this.status != Status.STATUS_MARKED_ROLLBACK)) {
-
-                throw new JDOUserException(msg.msg(
-                    "EXC_TransactionNotActive")); // NOI18N
-            }
-        
-            // This flag prevents user from making any changes to the transaction object.
-            this.startedCommit = true;
-        }
-
-        try {
-            this.internalRollback();
-
-            if (txType == BMT_JDO) {
-                // Send request to the container:
-                EJBImplHelper.getUserTransaction().rollback();
-            }
-        } catch (JDOException e) { 
-            throw e;
-
-        } catch (Exception e) { 
-            throw new JDOException("", e); // NOI18N
-
-        } finally {
-            if (txType == NON_MGD) {
-                // afterCompletion and cleanup in case of the managed env. had been
-                // done already.
-                this.internalAfterCompletion(); 
-            }
-        }
-    }
-
-    /**
-     * Returns the rollback-only status of the transaction. When
-     * begun, the rollback-only status is false. Either the 
-     * application or the JDO implementation may set this flag
-     * using setRollbackOnly.
-     * @return <code>true</code> if the transaction has been
-     * marked for rollback.
-     * @since 2.0
-     */
-    public boolean getRollbackOnly() {
-        throw new UnsupportedOperationException(
-            "Method getRollbackOnly not yet implemented");
-    }
-
-    /**
-     * Sets the rollback-only status of the transaction to <code>true</code>.
-     * After this flag is set to <code>true</code>, the transaction 
-     * can no longer be committed, and any attempt to commit the 
-     * transaction will throw <code>JDOUserException<code>.
-     */
-    public void setRollbackOnly() {
-        if (debugging())
-            this.traceCall("setRollbackOnly"); // NOI18N
-
-        if ((this.status == Status.STATUS_ROLLING_BACK)
-                ||    (this.status == Status.STATUS_ROLLEDBACK)
-                ||     (this.status == Status.STATUS_MARKED_ROLLBACK)) {
-            //
-            // Already rolled back, rollback in progress or already marked.
-            //
-            return;
-        }
-
-        if (txType == NON_MGD) {
-            this.setStatus(Status.STATUS_MARKED_ROLLBACK);
-        } else {
-            try {
-                jta.setRollbackOnly();
-            } catch (Exception e) { 
-                throw new JDOException("", e); // NOI18N
-            }
-        }
-
-    }
-
-    //
-    // ----- Other public methods ------
-    //
-
-    /**
-     * Obtain the status of this transaction object.
-     * 
-     * @return The transaction status. 
-     */
-    public int getStatus() {
-        synchronized (this) {
-            return this.status;
-        }
-    }
-
-    /**
-     * Translates a javax.transaction.Status value into a string. 
-     *
-     * @param   status   Status object to translate.
-     * @return  Printable String for a Status object.
-     */
-    public static String statusString(int status) {
-        switch (status) {
-            case Status.STATUS_ACTIVE:            return "STATUS_ACTIVE"; // NOI18N
-            case Status.STATUS_MARKED_ROLLBACK:    return "STATUS_MARKED_ROLLBACK"; // NOI18N
-            case Status.STATUS_PREPARED:        return "STATUS_PREPARED"; // NOI18N
-            case Status.STATUS_COMMITTED:        return "STATUS_COMMITTED"; // NOI18N
-            case Status.STATUS_ROLLEDBACK:        return "STATUS_ROLLEDBACK"; // NOI18N
-            case Status.STATUS_UNKNOWN:            return "STATUS_UNKNOWN"; // NOI18N
-            case Status.STATUS_NO_TRANSACTION:    return "STATUS_NO_TRANSACTION"; // NOI18N
-            case Status.STATUS_PREPARING:        return "STATUS_PREPARING"; // NOI18N
-            case Status.STATUS_COMMITTING:        return "STATUS_COMMITTING"; // NOI18N
-            case Status.STATUS_ROLLING_BACK:    return "STATUS_ROLLING_BACK"; // NOI18N
-            default:                            break;
-        }
-        return "STATUS_Invalid[" + status + "]"; // NOI18N
-    }
-
-    /**
-     * Returns a string representation of this transaction object.
-     *
-     * @return  String describing contents of this Transaction object.
-     */
-    public String toString() {
-        StringBuffer    s = new StringBuffer();
-
-        s.append("  Transaction: \n   status        = " + this.statusString(this.status)+ "\n"); // NOI18N
-        if (this.startedCommit)
-            s.append("   startedCommit = true\n"); // NOI18N
-
-        if (synchronization != null) 
-            s.append("   sync          = " + synchronization.getClass().getName() + "\n"); // NOI18N
-        
-        return s.toString();
-    }
-
-    //
-    // ----- protected methods ------
-    //
-
-    /**
-     * Returns current transaction type
-     * @return current transaction type as int.
-     */
-    protected int getTransactionType() {
-        return txType;
-    }
-
-    /** Verify that username and password are equal to ones stored before
-     *
-     * @param username as String
-     * @param password as String
-     * @return true if they are equal
-     */
-    protected boolean verify(String username, String password) {
-        if ((this.username != null && !this.username.equals(username)) ||
-            (this.username == null && username != null) ||
-            (this.password != null && !this.password.equals(password)) ||
-            (this.password  == null && password != null)) {
-            return false;
-        }
-        return true;
-    }
-
-    /** Returns true if commit has started
-     * @return true if commit has started
-     */
-    protected boolean startedCommit() {
-        return startedCommit;
-    } 
-
-    /**
-     * Flush changes to the datastore. Performed in an active datastore 
-     * transaction only.
-     */
-    protected void internalFlush() {
-        if (this.status != Status.STATUS_ACTIVE) { 
-            throw new JDOUserException(msg.msg(
-                "EXC_TransactionNotActive")); // NOI18N
-        }
-
-        this.prepareFlush(false); // prepare the flush.
-    }
-
-    /**
-     * Begin a transaction in a managed environment. Called by 
-     * PersistenceManagerFactoryImpl when JTA Transaction associated with 
-     * the current thread is active.
-     *
-     * @param t JTA Transaction associated with the current thread
-     */
-    protected void begin(javax.transaction.Transaction t) {
-
-        beginInternal();
-        try {
-            jta = t;
-            if (txSync == null) 
-                txSync = new TransactionSynchronization(this); 
-
-            jta.registerSynchronization((Synchronization)txSync);
-        } catch (Exception e) {
-            throw new JDOFatalInternalException(msg.msg(
-                "EXC_ErrorRegister")); //NOI18N
-        }
-
-        // Set transaction type.
-        txType = CMT;
-    }
-
-    /** 
-     * Called in the managed environment only for transaction completion
-     * by TransactionSynchronization#beforeCompletion().
-     */
-    protected void beforeCompletion() {
-    
-        if (txType == NON_MGD) {
-            // Error - should not be called
-            throw new JDOUserException(msg.msg(
-                "EXC_WrongNonMgdOperation", "beforeCompletion")); //NOI18N
-        }      
- 
-        Object o = null;
- 
-        // This flag prevents user from making any changes to the transaction object.
-        this.startedCommit = true;
-
-        try {
-            o = EJBImplHelper.enlistBeforeCompletion(
-                new Object[] {this, persistenceManager, jta});
-            this.prepareFlush(true); // do actual beforeComplition.
-            this.commitPrepare(); // check internal status.
-
-            // do not do commitConnector() in the managed environment:
-            this.setStatus(Status.STATUS_COMMITTED); 
-
-        } finally {
-            EJBImplHelper.delistBeforeCompletion(o);
-        }
-    }
- 
-    /** 
-     * Called in the managed environment only for transaction completion
-     * by TransactionSynchronization#afterCompletion(int st).
-     */
-    protected void afterCompletion(int st) {
-        if (txType == NON_MGD) {
-            // Error - should not be called
-            throw new JDOUserException(msg.msg(
-                "EXC_WrongNonMgdOperation", "afterCompletion")); //NOI18N
-        }
-        st = EJBImplHelper.translateStatus(st); // translate Status
-
-        if (debugging()) {
-            this.traceCall("afterCompletion", st); // NOI18N
-        }
-
-        if (st == Status.STATUS_ROLLEDBACK) {
-            this.internalRollback();
-        } 
-
-        if (st != this.status) {
-            // Status mismatch - should not happen.
-            throw new JDOUserException(msg.msg(
-                 "EXC_InvalidStatus", // NOI18N
-                 "afterCompletion", this.statusString(this.status),  // NOI18N
-                 this.statusString(st)));
-         }
-
-         this.internalAfterCompletion();
-
-    }
-
-    //
-    // ----- private methods ------
-    //
-
-    /** 
-     * Status change and validation. Called by begin methods.
-     */
-    private void beginInternal() {
-        persistenceManager.assertIsOpen();
-
-        if (debugging())
-            this.traceCall("begin");  // NOI18N
-
-        if (this.isActive()) {
-            throw new JDOUserException(msg.msg(
-                "EXC_ErrorBegin"));  // NOI18N
-
-        }
-        this.setStatus(Status.STATUS_ACTIVE);
-
-            connector = this.getConnector();
-            connector.begin(optimistic);
-    }
-
-    /**
-     * Lower-level before-commit method - phase 1.
-     *
-     * This is called to flush changes to the store.
-     * State transition:
-     *        STATUS_ACTIVE        starting state
-     *        internalBeforeCompletion()    called while still active
-     *        STATUS_PREPARING    no longer active, about to "really" commit
-     *
-     * @param _commit true if called during the commit processing
-     * For exceptions see commit() method.
-     */
-    private void prepareFlush(boolean _commit) {
-        boolean        rollbackOnly = false; //marked for rollback
-
-        if (debugging())
-            this.traceCall("prepareFlush"); // NOI18N
-        //
-        // Prepare connection
-        //
-        connector = this.getConnector();
-
-        //
-        // Validate transaction state before we commit
-        //
-
-        if ((this.status == Status.STATUS_ROLLING_BACK)
-            ||    (this.status == Status.STATUS_ROLLEDBACK)) {
-            throw new JDOUserException(msg.msg(
-                "EXC_TransactionRolledback")); // NOI18N
-        }
-
-        if (connector.getRollbackOnly() ||
-            this.status == Status.STATUS_MARKED_ROLLBACK) {
-            rollbackOnly = true;
-
-        } else if (this.status != Status.STATUS_ACTIVE) {
-            throw new JDOUserException(msg.msg(
-                "EXC_TransactionNotActive")); // NOI18N
-        }
-
-        //
-        // User notifications done outside of lock - check for concurrent
-        // rollback or setRollbackOnly during notification.
-        //
-        if (!rollbackOnly) {
-            this.flushInstances(_commit);
-
-            if (this.status == Status.STATUS_ACTIVE) {        // All ok
-                if (this.startedCommit) { // inside commit - change status.
-                    this.setStatus(Status.STATUS_PREPARING);
-                }
-
-            } else if (this.status == Status.STATUS_MARKED_ROLLBACK) {
-                // This could happen only if this.setRollbackOnly() was called 
-                // during flushInstances() without throwing an
-                // exception.
-                rollbackOnly = true;
-
-            } else {    // concurrently rolled back - should not happen.
-                throw new JDOUserException(msg.msg(
-                    "EXC_TransactionRolledback")); // NOI18N
-            }
-        }
-        if (rollbackOnly) {
-            // Do not rollback here, but throw the exception and the rollback
-            // will happen in the 'catch' block. Usually happens if the
-            // connector was set rollback-only before the commit.
-            this.setRollbackOnly();
-
-            throw new JDOUserException(msg.msg(
-               "EXC_MarkedRolledback")); // NOI18N
-
-        }
-    }
-
-    /**
-     * Lower-level prepare-commit method - phase 2. 
-     *
-     * This is called when flush is finished but before connectorCommit.
-     * Will allow to support 2-phase commit.
-     * State transition:
-     *        STATUS_PREPARING    starting state
-     *        STATUS_PREPARED
-     *
-     * For exceptions see commit() method.
-     */
-    private void commitPrepare() {
-        if (debugging())
-            this.traceCall("commitPrepare"); // NOI18N
-        //
-        // Once we've reached the Status.STATUS_PREPARING state we do not need
-        // to check for concurrent state changes.  All user-level methods
-        // (rollback, setRollbackOnly, register, enlist, etc) are no longer
-        // allowed.
-        //
-
-        //
-        // Validate initial state
-        //
-        if (this.status != Status.STATUS_PREPARING) {
-            throw new JDOUserException(msg.msg(
-               "EXC_WrongStateCommit")); // NOI18N
-        }
-
-        this.setStatus(Status.STATUS_PREPARED);
-    }
-
-    /**
-     * Lower-level commit method - phase 3. Called only in a non-
-     * managed environment.
-     *
-     * State transition:
-     *        STATUS_PREPARED        starting state
-     *        STATUS_COMMITTING    starting to do final phase
-     *        commitConnector()        commit the flush.
-     *        STATUS_COMMITTED
-     *
-     */
-    private void commitComplete() {
-        if (debugging())
-            this.traceCall("commitComplete"); // NOI18N
-
-        //
-        // Validate initial state
-        //
-        if (this.status == Status.STATUS_ROLLING_BACK) {
-            this.setStatus(Status.STATUS_ROLLING_BACK); 
-
-            this.setStatus(Status.STATUS_ROLLEDBACK);
-
-        } else if (this.status == Status.STATUS_PREPARED) {
-            this.setStatus(Status.STATUS_COMMITTING);
-            this.commitConnector();
-            this.setStatus(Status.STATUS_COMMITTED);
-
-        } else {
-            throw new JDOUserException(msg.msg(
-                "EXC_WrongStateCommit")); // NOI18N
-        }
-    }
-
-    /**
-     * Lower-level internal rollback method. This is to avoid concurrent rollbacks.
-     *
-     */
-    private void internalRollback() {
-        if (debugging())
-            this.traceCall("internalRollback"); // NOI18N
-
-        this.setStatus(Status.STATUS_ROLLING_BACK);
-        try {
-            if (txType == NON_MGD) {
-                this.rollbackConnector();
-            }
-        } catch (JDOException ex) {
-            throw ex;
-
-        } catch (Exception ex) {
-            throw new JDOException("", ex);
-
-        } finally {
-            this.setStatus(Status.STATUS_ROLLEDBACK);
-        }
-    }
-
-    /**
-     *
-     * Force rollback.  This is called when something goes wrong during
-     * a late state check (i.e. some failure occurred during the prepare
-     * stage).  Unless we're not already rolling back (or rolled back) this
-     * will blindly change the state of the transaction and complete the
-     * latter stage of rollback.
-     *
-     * @return the final status of the transaction.
-     *
-     * See internalRollback() for exceptions
-     */
-    private int forceRollback() {
-        if (debugging())
-            this.traceCall("forceRollback"); // NOI18N
-
-        if ((this.status == Status.STATUS_ROLLING_BACK)        // Already
-            ||    (this.status == Status.STATUS_ROLLEDBACK)        // Done
-            ||    (this.status == Status.STATUS_COMMITTED)        // Too late
-            ||    (this.status == Status.STATUS_NO_TRANSACTION)    // Never was
-           ) {
-            return this.status;
-        }
-        try {
-            this.internalRollback();
-        } finally {
-            this.internalAfterCompletion();
-        }
-
-        return this.status;
-    }
-
-    /** 
-     * Register a Synchronization object for this transaction object.
-     * The transction manager invokes the beforeCompletion method prior to
-     * starting the transaction commit process. After the transaction is
-     * completed (or aborted), the transaction manager invokes the
-     * afterCompletion method.
-     *
-     * @param sync The Synchronization object for the transaction.
-     */
-    private void registerSynchronization(Synchronization sync) {
-        if (debugging())
-            this.traceCall("registerSynchronization"); // NOI18N
-        synchronized (this) {
-            //
-            // Disallow registration of new synchronization objects during
-            // beforeCompletion or afterCompletion processing.  Synchronizations
-            // are themselves involved in the process.
-            //
-            if (this.startedCommit) {
-                throw new JDOUserException(msg.msg(
-                    "EXC_TransactionCommitting")); // NOI18N
-            }
-
-            synchronization = sync;
-
-            if (debugging()) {
-                this.traceCall("registerSynchronization"); // NOI18N
-            }
-        }
-    }
-
-
-    /**
-     * Confirm that transaction is terminated.
-     * 
-     * @return True if transaction is completed or not started.
-     */
-    private boolean isTerminated() {
-        synchronized (this) {
-            return (    (this.status == Status.STATUS_COMMITTED)
-                    ||    (this.status == Status.STATUS_ROLLEDBACK)
-                    ||    (this.status == Status.STATUS_NO_TRANSACTION));
-        }
-    }
-
-    /**
-     * Flush dirty persistent instances to the datastore.
-     * If called during the commit processing, notifies registered 
-     * Synchronization interfaces with beforeCompletion().
-     */
-    private void flushInstances(boolean commit) {
-        if (commit) {
-            this.getConnector().beforeCompletion();
-            if (synchronization != null) {
-                ((Synchronization)synchronization).beforeCompletion();
-            }
-        }
-
-        persistenceManager.flushInstances();
-    }
-
-    /**
-     * Notify Connector, PersistenceManager, and registered Synchronization 
-     * instances about afterCompletion(). 
-     * All status changes occured before executing this method.
-     */
-    private void internalAfterCompletion() {
-        //
-        // This will execute w/o an active transaction context
-        //
-        persistenceManager.afterCompletion(status);
-
-        try {
-            if (synchronization != null)
-                ((Synchronization)synchronization).afterCompletion(status);
-        } catch (Exception ex) {
-            //
-            // Exceptions ignored
-            //
-        }
-        
-        this.finish();
-    }
-
-    /**
-     * Set status under lock (may be a nested lock which is ok)
-     */
-    private void setStatus(int status) {
-        if (debugging()) {
-            logger.debug(
-                "Tran[" + this.toString() + "].setStatus: " + // NOI18N
-                this.statusString(this.status) + " => " + // NOI18N
-                this.statusString(status));
-        }
-
-        synchronized(this) {
-            this.status = status;
-            persistenceManager.notifyStatusChange(!isTerminated());
-        }
-    }
-
-    /**
-     * Finish this transaction
-     */
-    private void finish() {
-        if (debugging())
-            this.traceCall("finish"); // NOI18N
-
-        //
-        // Do not clear:
-        //
-        //    .status            -- users can still check status
-        //
-        this.startedCommit = false;
-
-        if (txType == CMT || txType == BMT_UT) {
-            persistenceManager.forceClose();
-        } else if (txType == BMT_JDO) {
-            persistenceManager.deregisterJTA();
-        }
-
-        jta = null;
-        txType = NON_MGD;       // Restore the flag
-    }
-
-    //
-    // ----- Connector utilities -----
-    //
-
-    /**
-     * Get a connector 
-     */
-    private Connector getConnector() {
-        StoreManager srm = persistenceManager.getStoreManager();
-
-        if (username != null) {
-            return srm.getConnector(username, password);
-        }
-        return srm.getConnector();
-    }
-
-    /**
-     * Close a connector does flush of the changes and close
-     */
-    private void flushConnector() {
-            connector = this.getConnector();
-            connector.flush();
-    }
-
-    /** 
-     * Rollback a connector does rollback and close
-     */
-    private void rollbackConnector() {
-        connector = this.getConnector();
-        connector.rollback();
-    }
-
-    /** 
-     * Commit a connector does flush if necessary, commit and close
-     */
-    private void commitConnector() {
-        connector = this.getConnector();
-        connector.commit();
-    }
- 
-    //
-    // ----- Debugging utilities -----
-    //
-
-    /**
-     * Verifies if debugging is enabled.
-     * @return true if debugging is enabled.
-     */
-    private boolean debugging() {
-        return logger.isDebugEnabled();
-    }
-
-
-    /**
-     * Trace method call.
-     */
-    private void traceCall(String call) {
-        logger.debug(
-            "Tran[" + this.toString() + "]." + call + // NOI18N
-            ": status = " + this.statusString(this.status) + // NOI18N
-            ", txType: " + txTypeString()); // NOI18N
-    }
-
-    /**
-     * Trace method call with a provided status.
-     */
-    private void traceCall(String call, int st) {
-        logger.debug(
-            "Tran[" + this.toString() + "]." + call + // NOI18N
-            ": status = " + this.statusString(st) + // NOI18N
-            ", txType: " + txTypeString()); // NOI18N
-    }
-
-    /**
-     * Translates a txType value into a string.
-     * 
-     * @return  Printable String for a txType value
-     */
-    private String txTypeString() {
-        switch (txType) {
-            case NON_MGD:                   return "NON_MGD"; // NOI18N
-            case CMT:                       return "CMT"; // NOI18N
-            case BMT_UT:                    return "BMT_UT"; // NOI18N
-            case BMT_JDO:                   return "BMT_JDO"; // NOI18N
-            default:                        break;
-        }
-        return "UNKNOWN"; // NOI18N
-    }      
-}
-
-
-
diff --git a/runtime20/src/java/org/apache/jdo/impl/pm/TransactionSynchronization.java b/runtime20/src/java/org/apache/jdo/impl/pm/TransactionSynchronization.java
deleted file mode 100644
index a3abc2d..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/pm/TransactionSynchronization.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * TransactionSynchronization.java
- *
- * Create on August 1, 20001
- */
-
-package org.apache.jdo.impl.pm;
-
-import javax.transaction.*;
-
-
-/**   
- * This is a Synchronization instance associated with the corresponding instance
- * of the TransactionImpl. Is used for synchronization callbacks in a managed
- * environment. This is a separate object to avoid a requirement for a non-managed
- * application have JTA classes in its classpath.
- *  
- * @author Marina Vatkina  
- */ 
-class TransactionSynchronization implements Synchronization {
-    /** Reference to TransactionImpl instance associated
-     * with this instance of TransactionSynchronization
-     */
-    private TransactionImpl tx = null;
-
-    TransactionSynchronization(TransactionImpl newtx) {
-        tx = newtx;
-    }
-
-    /**
-     * @see javax.transaction.Synchronization#beforeCompletion()
-     */
-    public void beforeCompletion() {
-        tx.beforeCompletion();
-    }
-
-    /** 
-     * @see javax.transaction.Synchronization#afterCompletion(int status) 
-     */ 
-    public void afterCompletion(int status) { 
-        tx.afterCompletion(status); 
-    } 
-
-}
diff --git a/runtime20/src/java/org/apache/jdo/impl/pm/package.html b/runtime20/src/java/org/apache/jdo/impl/pm/package.html
deleted file mode 100644
index 417f286..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/pm/package.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- Copyright 2005 The Apache Software Foundation.
- 
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at 
- 
-     http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing, software 
- distributed under the License is distributed on an "AS IS" BASIS, 
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- See the License for the specific language governing permissions and 
- limitations under the License.
--->
-
-<html>
-<head>
-<title>Package org.apache.jdo.impl.pm</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
-</head>
-
-<body bgcolor="#FFFFFF">
-<p>This package contains classes that are for use across all kinds of implementations 
-  of the JDO Reference Implementation. The classes herein by and large implement 
-  the interfaces defined in <a href="../package-summary.html">org.apache.jdo.pm</a>. 
-</body>
-</html>
diff --git a/runtime20/src/java/org/apache/jdo/impl/sco/ArrayList.java b/runtime20/src/java/org/apache/jdo/impl/sco/ArrayList.java
deleted file mode 100644
index 2f76a56..0000000
--- a/runtime20/src/java/org/apache/jdo/impl/sco/ArrayList.java
+++ /dev/null
@@ -1,605 +0,0 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at 
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- */
-
-/*
- * sco.ArrayList.java
- */
-
-package org.apache.jdo.impl.sco;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.jdo.JDOUserException;
-import javax.jdo.JDOFatalInternalException;
-
-import org.apache.jdo.sco.SCO;
-import org.apache.jdo.sco.SCOCollection;
-import org.apache.jdo.state.StateManagerInternal;
-import org.apache.jdo.util.I18NHelper;
-
-
-/**
- * A mutable 2nd class object that represents ArrayList.
- * @author Marina Vatkina
- * @version 1.0.1
- * @see java.util.ArrayList
- */
-public class ArrayList extends java.util.ArrayList
-    implements SCOCollection {
-
-    private transient StateManagerInternal owner;
-
-    private transient int fieldNumber = -1;
-
-    private transient     Class elementType;
- 
-    private transient boolean allowNulls;
-
-    private transient java.util.Vector added = new java.util.Vector();
-
... 15898 lines suppressed ...

Mime
View raw message