Package org.datanucleus.store

Examples of org.datanucleus.store.StoreManager


    {
        Extension[] exts = nucCtx.getPluginManager().getExtensionPoint("org.datanucleus.store_manager").getExtensions();
        Class[] ctrArgTypes = new Class[] {ClassLoaderResolver.class, NucleusContext.class, Map.class};
        Object[] ctrArgs = new Object[] {clr, nucCtx, datastoreProps};

        StoreManager storeMgr = null;

        String storeManagerType = (String) props.get("datanucleus.storemanagertype");
        if (storeManagerType != null)
        {
            // User defined the store manager type, so find the appropriate plugin
View Full Code Here


                return;
            }
        }

        // Run SchemaTool
        StoreManager storeMgr = nucleusCtx.getStoreManager();
        if (!(storeMgr instanceof SchemaAwareStoreManager))
        {
            LOGGER.error("StoreManager of type " + storeMgr.getClass().getName() +
                " is not schema-aware so cannot be used with SchemaTool");
            System.exit(2);
            return;
        }
        SchemaAwareStoreManager schemaStoreMgr = (SchemaAwareStoreManager) storeMgr;

        try
        {
            if (mode == SCHEMATOOL_CREATE_MODE)
            {
                tool.createSchema(schemaStoreMgr, classNames);
            }
            else if (mode == SCHEMATOOL_DELETE_MODE)
            {
                tool.deleteSchema(schemaStoreMgr, classNames);
            }
            else if (mode == SCHEMATOOL_VALIDATE_MODE)
            {
                tool.validateSchema(schemaStoreMgr, classNames);
            }
            else if (mode == SCHEMATOOL_DATABASE_INFO_MODE)
            {
                storeMgr.printInformation("DATASTORE", System.out);
            }
            else if (mode == SCHEMATOOL_SCHEMA_INFO_MODE)
            {
                storeMgr.printInformation("SCHEMA", System.out);
            }

            msg = LOCALISER.msg(false, "014043");
            LOGGER.info(msg);
            System.out.println(msg);
View Full Code Here

            typeName = value.getClass().getName();
        }

        // Find the SCO wrapper type most suitable
        TypeManager typeMgr = ownerOP.getExecutionContext().getNucleusContext().getTypeManager();
        StoreManager storeMgr = ownerOP.getExecutionContext().getStoreManager();
        boolean fullWrapper = (storeMgr instanceof BackedSCOStoreManager);
        Class wrapperType = null;
        if (fullWrapper)
        {
            wrapperType = typeMgr.getWrappedTypeBackedForType(typeName);
View Full Code Here

    public Collection<String> supportedOptions()
    {
        // Generate the list of supported options, taking the general options we support and removing
        // any that the particular StoreManager doesn't support
        Set options = new HashSet(Arrays.asList(OPTION_ARRAY));
        StoreManager storeMgr = nucleusContext.getStoreManager();
        if (storeMgr != null)
        {
            Collection storeMgrOptions = storeMgr.getSupportedOptions();
            if (!storeMgrOptions.contains("DatastoreIdentity"))
            {
                options.remove("javax.jdo.option.DatastoreIdentity");
            }
            if (!storeMgrOptions.contains("ApplicationIdentity"))
            {
                options.remove("javax.jdo.option.ApplicationIdentity");
            }
            if (!storeMgr.supportsQueryLanguage("JDOQL"))
            {
                options.remove("javax.jdo.query.JDOQL");
            }
            if (!storeMgr.supportsQueryLanguage("SQL"))
            {
                options.remove("javax.jdo.query.SQL");
            }

            if (storeMgrOptions.contains("TransactionIsolationLevel.read-committed"))
View Full Code Here

   * Convenience accessor for the {@link KeyRegistry} associated with the current datasource connection.
   * @param ec ExecutionContext
   * @return The KeyRegistry
   */
  public static KeyRegistry getKeyRegistry(ExecutionContext ec) {
    StoreManager storeManager = ec.getStoreManager();
    ManagedConnection mconn = storeManager.getConnection(ec);
    return ((EmulatedXAResource) mconn.getXAResource()).getKeyRegistry();
  }
View Full Code Here

        // Make sure any persistence info is loaded
        ec.hasPersistenceInformationForClass(candidateClass);
        AbstractClassMetaData cmd = ec.getMetaDataManager().getMetaDataForClass(candidateClass, clr);

        QueryManager qm = getQueryManager();
        StoreManager storeMgr = ec.getStoreManager();
        String datastoreKey = storeMgr.getQueryCacheKey();
        String cacheKey = getQueryCacheKey();
        if (useCaching())
        {
            // Allowing caching so try to find compiled (datastore) query
            datastoreCompilation = (MongoDBQueryCompilation)qm.getDatastoreQueryCompilation(datastoreKey,
View Full Code Here

                }
            }
        }

        QueryManager qm = getQueryManager();
        StoreManager storeMgr = ec.getStoreManager();
        String datastoreKey = storeMgr.getQueryCacheKey();
        String cacheKey = getQueryCacheKey();
        if (useCaching())
        {
            // Allowing caching so try to find compiled (datastore) query
            datastoreCompilation = (MongoDBQueryCompilation)qm.getDatastoreQueryCompilation(datastoreKey,
View Full Code Here

            om.getFetchPlan().setGroup(javax.jdo.FetchPlan.ALL);
            om.getFetchPlan().setMaxFetchDepth(-1);
        }

        ArrayList objects = new ArrayList();
        StoreManager storeMgr = om.getStoreManager();
        ClassLoaderResolver clr = om.getClassLoaderResolver();
        try
        {
            tx1.begin();

            for (int i=0;i<oids.length;i++)
            {
                try
                {
                    String className = storeMgr.getClassNameForObjectID(oids[i], clr, om);
                    if (className == null)
                    {
                        throw new NucleusException("Unable to find the class name for the identity " + oids[i]);
                    }
                    Class cls = clr.classForName(className);
View Full Code Here

   * connection gets allocated, don't establish a datastore transaction.
   * Note that even if nontransactional writes are enabled, if there
   * is already a connection available then setting the property is a no-op.
   */
  static KeyRegistry getKeyRegistry(ObjectManager om) {
    StoreManager storeManager = om.getStoreManager();
    ManagedConnection mconn = storeManager.getConnection(om);
    return ((EmulatedXAResource) mconn.getXAResource()).getKeyRegistry();
  }
View Full Code Here

    public Collection<String> supportedOptions()
    {
        // Generate the list of supported options, taking the general options we support and removing
        // any that the particular StoreManager doesn't support
        List options = new ArrayList(Arrays.asList(OPTION_ARRAY));
        StoreManager storeMgr = getOMFContext().getStoreManager();
        if (storeMgr != null)
        {
            Collection storeMgrOptions = storeMgr.getSupportedOptions();
            if (!storeMgrOptions.contains("DatastoreIdentity"))
            {
                options.remove("javax.jdo.option.DatastoreIdentity");
            }
            if (!storeMgrOptions.contains("ApplicationIdentity"))
            {
                options.remove("javax.jdo.option.ApplicationIdentity");
            }
            if (!storeMgrOptions.contains("OptimisticTransaction"))
            {
                options.remove("javax.jdo.option.Optimistic");
            }
            if (!storeMgr.supportsQueryLanguage("JDOQL"))
            {
                options.remove("javax.jdo.query.JDOQL");
            }
            if (!storeMgr.supportsQueryLanguage("SQL"))
            {
                options.remove("javax.jdo.query.SQL");
            }

            if (storeMgrOptions.contains("TransactionIsolationLevel.read-committed"))
View Full Code Here

TOP

Related Classes of org.datanucleus.store.StoreManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.