/** * Return a new PersistenceManagerFactory with options set according to the given Properties. * This method exists for JDO1 compliance whereas in JDO2+ the method takes a Map. * @param overridingProps The Properties to initialize the PersistenceManagerFactory with. * @return A PersistenceManagerFactory with options set according to the given Properties. * @see javax.jdo.JDOHelper#getPersistenceManagerFactory(java.util.Map) */ public synchronized static PersistenceManagerFactory getPersistenceManagerFactory(Properties overridingProps) { // Extract the properties into a Map allowing for a Properties object being used Map overridingMap = new HashMap(); // Make sure we handle default properties too (java.util.Properties class oddness) for (Enumeration e = overridingProps.propertyNames() ; e.hasMoreElements() ;) { // Use props.get to allow for user misusing Properties class String param = (String)e.nextElement(); overridingMap.put(param, overridingProps.get(param)); } return getPersistenceManagerFactory(overridingMap); }
properties.put(HiveConfigConstants.JAVAX_JDO_DATASTOREREADTIMEOUT, JDO_TIMEOUT); properties.put(HiveConfigConstants.JAVAX_JDO_DATASTOREWRITETIMEOUT, JDO_TIMEOUT); result = JDOPersistenceManagerFactory.getPersistenceManagerFactory(properties); factories.put(name, result);
properties.put(HiveConfigConstants.JAVAX_JDO_DATASTOREREADTIMEOUT, JDO_TIMEOUT); properties.put(HiveConfigConstants.JAVAX_JDO_DATASTOREWRITETIMEOUT, JDO_TIMEOUT); result = JDOPersistenceManagerFactory.getPersistenceManagerFactory(properties); factories.put(name, result);