Wednesday, May 23, 2012

Re: Running Data Nucleus JDO 3.0.x with Google Cloud SQL

Well, I've searched high and low for such a flag and haven't found
it.

I've managed to convert all my queries to JDOQL, but there is one that
I would still like to use SQL, as there is some optimization that I
can't seem to accomplish with JDOQL.


On May 22, 8:39 pm, Rob Clevenger <rclev...@google.com> wrote:
> That's odd, I wonder if there's a flag or setting to disable using a new
> thread for this...
>
> Rob
>
>
>
>
>
>
>
> On Tue, Apr 24, 2012 at 10:09 AM, Alan <alanswee...@gmail.com> wrote:
> > Thanks to this Thread, I am successfully using DataNucleus JDO with
> > Google Cloud.
>
> > I am having one problem:
>
> > If I try to use SQL directly for a query:
> > Query query = pm.newQuery("javax.jdo.query.SQL", querySQL);
>
> > DataNucleus tries to spawn a Thread to execute the query.
>
> > Caused by: java.security.AccessControlException: access denied
> > (java.lang.RuntimePermission modifyThreadGroup)
> >        at
>
> > java.security.AccessControlContext.checkPermission(AccessControlContext.java:
> > 323)
> >        at
> > java.security.AccessController.checkPermission(AccessController.java:
> > 546)
> >        at java.lang.SecurityManager.checkPermission(SecurityManager.java:
> > 532)
> >        at com.google.appengine.tools.development.DevAppServerFactory
> > $CustomSecurityManager.checkPermission(DevAppServerFactory.java:252)
> >        at com.google.appengine.tools.development.DevAppServerFactory
> > $CustomSecurityManager.checkAccess(DevAppServerFactory.java:277)
> >        at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:299)
> >        at java.lang.Thread.init(Thread.java:332)
> >        at java.lang.Thread.<init>(Thread.java:391)
> >        at org.datanucleus.store.query.Query.performExecuteTask(Query.java:
> > 1669)
> >        at
> > org.datanucleus.store.rdbms.query.SQLQuery.performExecute(SQLQuery.java:
> > 259)
> >        at org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
> >        at
>
> > org.datanucleus.store.query.AbstractSQLQuery.executeWithArray(AbstractSQLQuery.java:
> > 287)
> >        at org.datanucleus.store.query.Query.execute(Query.java:1344)
> >        at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221)
>
> > This is not a problem with the default JDOQL queries.
>
> > Anyone have a solution for this?  I have one query that I need to use
> > mysql SQL with that won't work with JDOQL.
>
> > On Mar 26, 9:50 am, Feliks Khantsis <doom...@gmail.com> wrote:
> > > Yes, you must download datanucleus access platform 1.1.5 rdbms, and add
> > the
> > > datanucleus-rdbms-1.1.5.jar to your classpath
>
> > > On Friday, March 2, 2012 4:51:03 PM UTC+2, Christoph wrote:
>
> > > > Dear Study,
>
> > > > thank you for posting your jdoconfig.xml. However I run into the
> > problem
> > > > that the code doesn't run on Google App Engine. It creates the
> > following
> > > > error message:
>
> > > > Caused by: javax.jdo.JDOFatalUserException: No available StoreManager
> > found for the datastore URL key "jdbc". Please make sure you have all
> > relevant plugins in the CLASSPATH (e.g datanucleus-rdbms?,
> > datanucleus-db4o?), and consider setting the persistence property
> > "datanucleus.storeManagerType" to the type of store you are using e.g
> > rdbms, db4o
> > > > NestedThrowables:
> > > > org.datanucleus.exceptions.NucleusUserException: No available
> > StoreManager found for the datastore URL key "jdbc". Please make sure you
> > have all relevant plugins in the CLASSPATH (e.g datanucleus-rdbms?,
> > datanucleus-db4o?), and consider setting the persistence property
> > "datanucleus.storeManagerType" to the type of store you are using e.g
> > rdbms, db4o
>
> > > > However directly accessing the database via JDBC and SQL works!
>
> > > > So it seems that something for datanucleus is missing within the app
> > > > engine libraries. I added no special libraries and used version 1.6.3.
>
> > > > Thank you very much for your help in advance.
>
> > > > Christoph
>
> > > > Am Mittwoch, 26. Oktober 2011 18:27:02 UTC+2 schrieb Study:
>
> > > >> You can try my jdoconfig.xml
>
> > > >> it works with built-in GAE JDO without using newer version JDO
>
> > > >> <?xml version="1.0" encoding="utf-8"?>
> > > >> <jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
> > > >>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > >>    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/
> > > >> jdoconfig">
>
> > > >>    <persistence-manager-factory name="transactions-optional">
> > > >>        <property name="javax.jdo.PersistenceManagerFactoryClass"
> > > >>            value="org.datanucleus.jdo.JDOPersistenceManagerFactory"/>
> > > >>        <property name="javax.jdo.option.ConnectionDriverName"
> > > >> value="com.google.appengine.api.rdbms.AppEngineDriver"/>
> > > >>        <property name="javax.jdo.option.ConnectionURL"
> > > >> value="jdbc:google:rdbms://instance_name/database_name"/>
> > > >>        <property name="javax.jdo.option.NontransactionalRead"
> > > >> value="true"/>
> > > >>        <property name="javax.jdo.option.NontransactionalWrite"
> > > >> value="true"/>
> > > >>        <property name="javax.jdo.option.RetainValues" value="true"/>
>
> > > >>        <property name="datanucleus.metadata.validate" value="false"/>
> > > >>        <property name="datanucleus.autoCreateSchema" value="true"/>
> > > >>        <property name="datanucleus.validateTables" value="false"/>
> > > >>        <property name="datanucleus.validateConstraints" value="false"/
>
> > > >>        <property name="datanucleus.appengine.autoCreateDatastoreTxns"
> > > >> value="true"/>
> > > >>    </persistence-manager-factory>
> > > >> </jdoconfig>
>
> > > >> On Oct 24, 5:11 am, J N <jngcl...@gmail.com> wrote:
> > > >> > Hi
> > > >> > I am trying to figure out how to run Data Nucleus with Google Cloud
> > > >> > SQL. I am running into trouble due to class conflicts with the built
> > > >> > in app-engine JDO (which also uses data nucleus for persistence to
> > the
> > > >> > google data store.
>
> > > >> > Has anyone of you tried this. I am hoping that there is a way to
> > make
> > > >> > this work. If you have worked on this  I will appreciate it very
> > much
> > > >> > if you share your experience. A working example would obviously be
> > the
> > > >> > best thing :-) Thanks in advance.
>
> > > >> > Regards
>
> > > > Am Mittwoch, 26. Oktober 2011 18:27:02 UTC+2 schrieb Study:
>
> > > >> You can try my jdoconfig.xml
>
> > > >> it works with built-in GAE JDO without using newer version JDO
>
> > > >> <?xml version="1.0" encoding="utf-8"?>
> > > >> <jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
> > > >>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > >>    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/
> > > >> jdoconfig">
>
> > > >>    <persistence-manager-factory name="transactions-optional">
> > > >>        <property name="javax.jdo.PersistenceManagerFactoryClass"
> > > >>            value="org.datanucleus.jdo.JDOPersistenceManagerFactory"/>
> > > >>        <property name="javax.jdo.option.ConnectionDriverName"
> > > >> value="com.google.appengine.api.rdbms.AppEngineDriver"/>
> > > >>        <property name="javax.jdo.option.ConnectionURL"
> > > >> value="jdbc:google:rdbms://instance_name/database_name"/>
> > > >>        <property name="javax.jdo.option.NontransactionalRead"
> > > >> value="true"/>
> > > >>        <property name="javax.jdo.option.NontransactionalWrite"
> > > >> value="true"/>
> > > >>        <property name="javax.jdo.option.RetainValues" value="true"/>
>
> > > >>        <property name="datanucleus.metadata.validate" value="false"/>
> > > >>        <property name="datanucleus.autoCreateSchema" value="true"/>
> > > >>        <property name="datanucleus.validateTables" value="false"/>
> > > >>        <property name="datanucleus.validateConstraints" value="false"/
>
> > > >>        <property name="datanucleus.appengine.autoCreateDatastoreTxns"
> > > >> value="true"/>
> > > >>    </persistence-manager-factory>
> > > >> </jdoconfig>
>
> > > >> On Oct 24, 5:11 am, J N <jngcl...@gmail.com> wrote:
> > > >> > Hi
> > > >> > I am trying to figure out how to run Data Nucleus with Google Cloud
> > > >> > SQL. I am running into trouble due to class conflicts with the built
> > > >> > in app-engine JDO (which also uses data nucleus for persistence to
> > the
> > > >> > google data store.
>
> > > >> > Has anyone of you tried this. I am hoping that there is a way to
> > make
> > > >> > this work. If you have worked on this  I will appreciate it very
> > much
> > > >> > if you share your experience. A working example would obviously be
> > the
> > > >> > best thing :-) Thanks in advance.
>
> > > >> > Regards
>
> > > > Am Mittwoch, 26. Oktober 2011 18:27:02 UTC+2 schrieb Study:
>
> > > >> You can try my jdoconfig.xml
>
> > > >> it works with built-in GAE JDO without using newer version JDO
>
> > > >> <?xml version="1.0" encoding="utf-8"?>
> > > >> <jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
> > > >>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > >>    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/
> > > >> jdoconfig">
>
> > > >>    <persistence-manager-factory name="transactions-optional">
> > > >>        <property name="javax.jdo.PersistenceManagerFactoryClass"
> > > >>            value="org.datanucleus.jdo.JDOPersistenceManagerFactory"/>
> > > >>        <property name="javax.jdo.option.ConnectionDriverName"
> > > >> value="com.google.appengine.api.rdbms.AppEngineDriver"/>
> > > >>        <property name="javax.jdo.option.ConnectionURL"
> > > >> value="jdbc:google:rdbms://instance_name/database_name"/>
> > > >>        <property name="javax.jdo.option.NontransactionalRead"
> > > >> value="true"/>
> > > >>        <property name="javax.jdo.option.NontransactionalWrite"
> > > >> value="true"/>
> > > >>        <property name="javax.jdo.option.RetainValues" value="true"/>
>
> > > >>        <property name="datanucleus.metadata.validate" value="false"/>
> > > >>        <property name="datanucleus.autoCreateSchema" value="true"/>
> > > >>        <property name="datanucleus.validateTables" value="false"/>
> > > >>        <property name="datanucleus.validateConstraints" value="false"/
>
> > > >>        <property
>
> ...
>
> read more »

1 comment:

  1. Obviously not using a recent DataNucleus version; creating a thread was changed from being the default a long time ago. Also please mention such things on the DataNucleus forum otherwise people who use it will be unaware.

    ReplyDelete