NucleusContext nc = jdoPmf.getNucleusContext(); try { Field pmCache = pmf.getClass().getDeclaredField("pmCache"); Set<JDOPersistenceManager> pmSet = (Set<JDOPersistenceManager>) pmCache.get(pmf); for (JDOPersistenceManager pm : pmSet) { org.datanucleus.ExecutionContext ec = pm.getExecutionContext(); if (ec instanceof org.datanucleus.ExecutionContextThreadedImpl) { ClassLoaderResolver clr = ((org.datanucleus.ExecutionContextThreadedImpl) ec).getClassLoaderResolver(); clearClr(clr); jdoPmf.getNucleusContext().getPluginManager(); Field registryField = pluginManager.getClass().getDeclaredField("registry"); registryField.setAccessible(true); (org.datanucleus.PersistenceNucleusContextImpl) nc; org.datanucleus.store.types.TypeManagerImpl tm = (org.datanucleus.store.types.TypeManagerImpl) pnc.getTypeManager(); Field clrField = tm.getClass().getDeclaredField("clr"); clrField.setAccessible(true);
/** * Creates an object manager with datastore credentials. * * @param omf the object manager factory * @param owner the owning persistence manager or entity manager * @param userName the username to the datastore * @param password the password to the datastore */ public ForceObjectManagerImpl(ObjectManagerFactoryImpl omf, Object owner, String userName, String password) { super(omf, owner, userName, password); this.allOrNothingEnabled = omf.getOMFContext().getPersistenceConfiguration().getBooleanProperty("force.AllOrNothing"); }
/** * Get the properties and associated values that are in effect for the entity manager factory. * Changing the contents of the map does not change the configuration in effect. * @return properties */ public Map getProperties() { PersistenceConfiguration conf = ((ObjectManagerFactoryImpl)pmf).getOMFContext().getPersistenceConfiguration(); return conf.getOptions(); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, int value) { om.getTransaction().setOption(option, value); }
/** * Indicate whether a transaction is in progress. * @throws PersistenceException if an unexpected error condition is encountered. */ public boolean isActive() { return om.getTransaction().isActive(); }
/** * Accessor for the fetch size. * @return The fetch size */ public int getFetchSize() { return fp.getFetchSize(); }
/** * Accessor for the groups. * @return The groups */ public Set getGroups() { return fp.getGroups(); }
/** * Accessor for the detachment roots. * @return Detachment roots */ public Collection getDetachmentRoots() { return fp.getDetachmentRoots(); }
/** * Accessor for the objects currently managed by this PM in the current transaction. * @return The managed objects */ public Set getManagedObjects() { return ec.getManagedObjects(); }
/** * Method to deregister a listener for transaction events. * @param listener The listener to remove */ public void deregisterEventListener(TransactionEventListener listener) { tx.removeTransactionEventListener(listener); } }
/** * Accessor for the class that this group is for. * @return the class */ public Class getType() { return fg.getType(); }
/** * Accessor for whether the FetchGroup is unmodifiable * @return Whether unmodifiable */ public boolean isUnmodifiable() { return fg.isUnmodifiable(); }
public String toString() { return fg.toString(); } }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, boolean value) { om.getTransaction().setOption(option, value); }
/** * Indicate whether a transaction is in progress. * @throws PersistenceException if an unexpected error condition is encountered. */ public boolean isActive() { return om.getTransaction().isActive(); }
/** * Creates an object manager with datastore credentials. * * @param omf the object manager factory * @param owner the owning persistence manager or entity manager * @param userName the username to the datastore * @param password the password to the datastore */ public ForceObjectManagerImpl(ObjectManagerFactoryImpl omf, Object owner, String userName, String password) { super(omf, owner, userName, password); this.allOrNothingEnabled = omf.getOMFContext().getPersistenceConfiguration().getBooleanProperty("force.AllOrNothing"); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, int value) { om.getTransaction().setOption(option, value); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, String value) { om.getTransaction().setOption(option, value); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, String value) { om.getTransaction().setOption(option, value); }
/** * Convenience accessor for setting a transaction option. * @param option option name * @param value The value */ public void setOption(String option, boolean value) { om.getTransaction().setOption(option, value); }