Running Data Nucleus JDO 3.0.x with Google Cloud SQL

Showing 1-8 of 8 messages
Running Data Nucleus JDO 3.0.x with Google Cloud SQL J N 10/23/11 2:11 PM
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
Re: Running Data Nucleus JDO 3.0.x with Google Cloud SQL Study 10/26/11 9:27 AM
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>
Re: Running Data Nucleus JDO 3.0.x with Google Cloud SQL dave 12/7/11 9:55 AM
thank you so much.  This is exactly what i've been looking for.  It would be nice if they post this on the Cloud sql's main page.
Re: Running Data Nucleus JDO 3.0.x with Google Cloud SQL Christoph 3/2/12 6:51 AM
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
Re: Running Data Nucleus JDO 3.0.x with Google Cloud SQL Feliks Khantsis 3/26/12 8:50 AM
Yes, you must download datanucleus access platform 1.1.5 rdbms, and add the datanucleus-rdbms-1.1.5.jar to your classpath 
Re: Running Data Nucleus JDO 3.0.x with Google Cloud SQL Alan 4/24/12 10:09 AM
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.
Re: Running Data Nucleus JDO 3.0.x with Google Cloud SQL Rob 5/22/12 7:39 PM
That's odd, I wonder if there's a flag or setting to disable using a new thread for this...

Rob
Re: Running Data Nucleus JDO 3.0.x with Google Cloud SQL Alan 5/23/12 7:27 AM
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
>
>
>
>
>
>
>
> ...
>
> read more »