Friday, March 30, 2012

Re: php support

hey yea!  I need to move my wordpress blog over..   I requested access to speckle to try this out..  

SQuirreL connected but no tables appearing

Hi,

I've just got SQuirreL working with a Google Cloud SQL instance.

It logs in just fine and shows me the databases available (information_schema,mysql, etc..)

What I'm having trouble with is that when I select the database I want to work with it doesn't have any of the tables. I've seen in screenshots that they're supposed to appear under the 'TABLE' node, but they're just not there

Has anyone has had any similar problems?

Re: Incorrect SELECT results in GAE/SQL cloud JDBC?

Might be a bit late, but I had a very similar issue and it turned out my local MySQL instance was not case sensitive, but Google Cloud   SQL is case sensitive. Everything worked fine locally, but after deployment the queries would error

Hope it helps someone

Re: php support

We recently invited a number of users to join the limited preview who expressed an interest in using it with PHP. We did so because other users have reported success in using Quercus (a Java implementation of PHP) with AppEngine, such as this:

Re: php support

Probably never. Also please note that cloud-sql is language neutral, it is SQL, it doesn't support any programming languages at all.

The programming platform to use (in connection with) CloudSQL is AppEngine, which only supports: Python, Java and Go (experimental).



php support

When will php support enable?

Wednesday, March 28, 2012

Re: Cloud SQL and Netbeans; Limited Preview

Hi Nasir

We are only providing the Eclipse IDE plugin at the moment.
We are currently working on improving the performance of Cloud SQL and will open it up for general access when we are happy to recommend it for production use.


--
Joe Faith | Product Manager | Google Cloud

Re: Hibernate Application: class not found?

Sorry C. but it does not work even without annotations :-(( See mails

unable to deploy app - 404

Hi all,

I am the owner for this app-id and other than me all other developer can able to deploy in the same ID. 
Please let me know at the earliest. 

404 Not Found
This application does not exist (app_id=u'login-live-o8g').


See the deployment console for more details
404 Not Found
This application does not exist (app_id=u'login-live-o8g').

environment - MAC + eclipse Helios + 1.6.2 sdk


Thanks,
Bala

Tuesday, March 27, 2012

Cloud SQL and Netbeans; Limited Preview

i am just starting with Google App Engine and Cloud SQL. there are
guides for making a cloud SQL enabled project in eclipse, but how d i
make such a project in netbeans?
i have google plugin and sdk installed and seemingly working in
Netbeans 7.1.1
also, i need to know till when is the limited preview available.

Re: Hibernate Application: class not found?

Hi,

As I realized there is two options to solve this issue. First one is you have to remove annotation form your domain classes and change it to Hibernate mapping file, Second option is Google App engine team should add javax.naming.NamingException class in to their white list.

My suggestion is Google App Engine team should add that "javax.naming.NamingException" class in to their white list. Otherwise we can't get full advantage of Google Cloud SQL and App Engine. 


Regards,
Chandana
http://cnapagoda.blogspot.com

Re: Hibernate Application: class not found?

See the email I sent you, id is still trewnewmedia.appspot.com


Monday, March 26, 2012

Re: Export database

Hi Carl
Cloud SQL only uses Cloud Storage for storing exports, so there shouldn't be any surprises.
Joe Faith | Google Cloud Product Manager
Sent from my phone, so please excuse my brevity.


Re: Hibernate Application: class not found?

Hi Fabio.

Would it be possible for you to put together a simple testcase so we can see what's happening under the covers?  I'm not super familiar with hibernate.

Ideally this would have a single class reproducing the problem, source and have it running in appengine with an appid we can look at.

Thanks!

Rob


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

Yes, you must download datanucleus access platform 1.1.5 rdbms, and add the datanucleus-rdbms-1.1.5.jar to your classpath


Re: Wordpress + AppEngine = PressEngine

Yes, PHP running on Java powered by Quercus

Re: Hibernate Application: class not found?

Tried again, using HibernateTemplate. No way Spring let me create the session factory bean! :-((( Please GAE / cloudSQL team. Help me!!!!!

Re: Hibernate Application: class not found?

 Hi Chandana.... finally someone helping me with all that madness! :-)))

I already knew your sample code, and started from here for building my app.
Actually, it worked til' some change I can't understand.

I tried all. With annotations (mapping files), without annotations.... Old versions of hibernate 3, last hibernate 4 versions, fixing all dependencies each try but nothing.
I also tried removing autowiring for my dao object.

When I try locally (mvn gae:run) it works (with several configurations above) always good!
AppEngine raises various errors.

With Hibernate 3 I get:


java.lang.SecurityException: Unable to get members for class org.hibernate.impl.SessionFactoryImpl




Thank you for all! 

Sunday, March 25, 2012

performance

Hello,

I have problem with performance of specific select on Cloud. Same
select on same database on local took about .5 sec. I had only one
successful run with time about 88 sec when I did it against Cloud. All
other attempts fail.

instance: appsres:appsres

problematic command:

SELECT COUNT(distinct ao_id), templates.*
FROM application_templates, templates, aobjects
WHERE appt_app_id=1 AND t_id=appt_t_id AND ao_ot_id=t_ot_id
GROUP BY t_id, t_code, t_name, t_desc, t_ot_id, t_ta_id, t_user_id
ORDER BY t_name

successful commnad (.5 sec):

SELECT COUNT(distinct ao_id), templates.*
FROM templates, aobjects
WHERE ao_ot_id=t_ot_id
GROUP BY t_id, t_code, t_name, t_desc, t_ot_id, t_ta_id, t_user_id
ORDER BY t_name

table application_templates has only 5 rows.

Saturday, March 24, 2012

Export database

Hi,

I have been playing around with Google Cloud SQL. What I want to do is export the database but it seems the only way to do this via the GsUtil tool or the web console is through the use of buckets in Google Cloud Storage ..... and to use these I need to have billing enabled on my account. This is something I am not comfortable in doing because it is not clear whether you can set limits on the cloud storage billing which could lead to surprise bills (I have posted a thread over there to see if I can clear up that issue).

The only other thing I can think of is to write some script in my Google App Engine app that prints out SQL insert statements - then I download this. It seems a bit overkill but from playing with the command line - it does not seem possible. And GsUtil has the same problem as the console - I need billing activated for Google Cloud Storage.

Any ideas? Suggestions?
Cheers,
Carl.

Friday, March 23, 2012

Re:Wordpress + AppEngine = PressEngine

use java and php together?
------------------ Original ------------------
From: "Trung";
Date: 2012年3月24日(星期六) 凌晨4:05
To: "Google Cloud SQL discuss";
Subject: Wordpress + AppEngine = PressEngine
Hi friends,

Just inform you that we are setting up WordPress running on AppEngine
using Cloud SQL database.

See http://pressengine.appspot.com/

Hope this help.

Wordpress + AppEngine = PressEngine

Hi friends,

Just inform you that we are setting up WordPress running on AppEngine
using Cloud SQL database.

See http://pressengine.appspot.com/

Hope this help.

Has anybody successful used JPA/DataNucleus with Clould SQL?

Has anybody successful used JPA/DataNucleuos with Clould SQL?

Re: Hibernate Application: class not found?

Hi,

I have already developed hibernate based application, But main defense between that and your code is,  you have used org.springframework.
orm.hibernate4.LocalSessionFactoryBean .

Hosted application code: http://code.google.com/p/cloudsql/source/browse/trunk/CloudSQLSample2/

In CloudSQLSample2 I have used org.springframework.orm.hibernate3.LocalSessionFactoryBean instead of org.springframework.
orm.hibernate4.LocalSessionFactoryBean

JPA problem:
There is some issue with Hibernate JPA support, because it used JPA 2.0 specification. But Google App Engine only support JPA1.0 specification.
http://stackoverflow.com/questions/7833538/jpahibernate-google-cloud-sql/


Regards,
Chandana
http://cnapagoda.blogspot.com


Re: Hibernate Application: class not found?

I swear it was working without changes last week. Its id is
"trewnewmedia".
As you can read in this article http://cloud.dzone.com/articles/spring-hibernate-google
AppEngine doesn't seem to get JPA2 annotations working!!! I can't say
why!
So I will probably convert my hibernate project with old-style
*.hbm.xml mapping files...
Why does AppEngine deny the usage of classes like
EJB3DTDEntityResolver?

Re: Hibernate Application: class not found?

Hi just need one clarification.

Did you upload a new application and it stopped working, or did it stop working with no changes to your app? 

What's your application id?

Do you see any other errors in the logs?

Rob


Hibernate Application: class not found?

I have an Hibernate application which worked til the last week. Now an
error:
Injection of resource dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'mySessionFactory' defined in ServletContext
resource [/WEB-INF/spring/root-context.xml]: Invocation of init method
failed; nested exception is java.lang.NoClassDefFoundError: org/
hibernate/cfg/EJB3DTDEntityResolver at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:
287)
On my local machine, it works. My classpath is ok.
Here's my configuration (Spring):
<bean id="myDataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"
value="com.google.appengine.api.rdbms.AppEngineDriver" />
<property name="url" value="jdbc:google:rdbms://secret:secret/
secret" />
</bean>

<bean id="mySessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="annotatedClasses">
<list>
<value>it.trew.prove.model.beans.Scadenza</value>
<value>it.trew.prove.model.beans.Fornitore</value>
<value>it.trew.prove.model.beans.Societa</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</
prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
<!-- <prop key="hibernate.hbm2ddl.import_files">/setup.sql</prop>
-->
</props>
</property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="mySessionFactory" />
</bean>

Please help!

Wednesday, March 21, 2012

Google service accounts

Dear Cloud SQL Previewers

There have been some changes to the Google APIs Console to support
service accounts, which make it easier to support server-to-server
interactions. As a result, you will see an extra entry in the 'Team'
tab for those projects that have Cloud SQL enabled, of the form
'xyz@developer.gserviceaccount.com'. This account is used by Google to
manage your Cloud SQL instance, but has no effect on your project.
(For example, it does not matter if you alter the permissions on this
account.)

For more about service accounts see:
http://googledevelopers.blogspot.com/2012/03/service-accounts-have-arrived.html

thanks

J

--
Joe Faith | Product Manager | Google Cloud

Re: Spring Autowiring + Hibernate = Security Exception

Ok. But I do need to use hibernate. How can I do now?
I tried upgrading some versions and use Hibernate4 but I still got an
only-GAE error: http://stackoverflow.com/questions/9827886/appengine-cant-find-org-hibernate-cfg-ejb3dtdentityresolver

Re: Spring Autowiring + Hibernate = Security Exception

It looks like org.hibernate.impl.SessionFactoryImpl has a dependency on a class that's not allowed in the AppEngine whitelist, hence it's not working here.

Rob



On Wed, Mar 21, 2012 at 8:29 AM, Fabio Bozzo
And so? What's the solution?

Re: Spring Autowiring + Hibernate = Security Exception

And so? What's the solution?

Tuesday, March 20, 2012

Re: Spring Autowiring + Hibernate = Security Exception

This looks like the same issue as this one:

Rob


On Tue, Mar 20, 2012 at 1:29 AM, Fabio Bozzo
My web app makes use of Google Cloud SQL.
It works perfectly locally, using mvn gae:run (mave gae plugin) on
local mysql db.

Here's some of my xml spring context config:

<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
               <property name="dataSource" ref="myDataSource" />
               <property name="annotatedClasses">
                       <list>
                               <value>it.trew.prove.model.beans.Scadenza</value>
                               <value>it.trew.prove.model.beans.Fornitore</value>
                               <value>it.trew.prove.model.beans.Societa</value>
                       </list>
               </property>
               <property name="hibernateProperties">
                       <props>
                               <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</
prop>
                               <prop key="hibernate.show_sql">true</prop>
                               <prop key="hibernate.hbm2ddl.auto">create</prop>
                       </props>
               </property>
       </bean>

And here's my generic DAO.java:



@Component
public class Dao {

   @Resource(name = "mySessionFactory")
   private SessionFactory sessionFactory;

   @SuppressWarnings("unchecked")
       public <T> T save(final T o){
       return (T) sessionFactory.getCurrentSession().save(o);
   }

   public void delete(final Object object){
       sessionFactory.getCurrentSession().delete(object);
   }

   @SuppressWarnings("unchecked")
       public <T> T get(final Class<T> type, final Long id){
       return (T) sessionFactory.getCurrentSession().get(type, id);
   }

   @SuppressWarnings("unchecked")
       public <T> T merge(final T o)   {
       return (T) sessionFactory.getCurrentSession().merge(o);
   }

   public <T> void saveOrUpdate(final T o){
       sessionFactory.getCurrentSession().saveOrUpdate(o);
   }

   @SuppressWarnings("unchecked")
       public <T> List<T> getAll(final Class<T> type) {
       final Session session = sessionFactory.getCurrentSession();
       final Criteria crit = session.createCriteria(type);
       return crit.list();
   }
}


And one of my services:

@Service
@Transactional
public class ScadenzaService {

       private Dao scadenzaDao;
       private SocietaService societaService;

       public void salvaScadenza(Scadenza scadenza) {
               scadenza.setDataInserimento(new Date());
               scadenza.setSocieta(societaService.getSocietaCorrente());
               scadenzaDao.save(scadenza);
       }

       public List<Scadenza> tutteLeScadenze() {
               return scadenzaDao.getAll(Scadenza.class);
       }

       @Autowired
       public void setScadenzaDao(Dao scadenzaDao) {
               this.scadenzaDao = scadenzaDao;
       }

       @Autowired
       public void setSocietaService(SocietaService societaService) {
               this.societaService = societaService;
       }
}





The error 500 on Appengine is:

Failed startup of context
com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@1079ff{/,/
base/data/home/apps/s~trewnewmedia/1.357617962256387950}
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'scadenziarioController': Injection of
autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire method: public void
it.trew.prove.web.controllers.ScadenziarioController.setScadenzaService(it.trew.prove.services.ScadenzaService);
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'scadenzaService': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire method: public void
it.trew.prove.services.ScadenzaService.setSocietaService(it.trew.prove.services.SocietaService);
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'societaService': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire method: public void
it.trew.prove.services.SocietaService.setSocietaDao(it.trew.prove.model.dao.Dao);
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dao': Injection of resource dependencies
failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'mySessionFactory': Post-processing of the
FactoryBean's object failed; nested exception is
java.lang.SecurityException: Unable to get members for class
org.hibernate.impl.SessionFactoryImpl


What do you think? Why in local works and not in GAE?

Spring Autowiring + Hibernate = Security Exception

My web app makes use of Google Cloud SQL.
It works perfectly locally, using mvn gae:run (mave gae plugin) on
local mysql db.
Here's some of my xml spring context config:
<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="annotatedClasses">
<list>
<value>it.trew.prove.model.beans.Scadenza</value>
<value>it.trew.prove.model.beans.Fornitore</value>
<value>it.trew.prove.model.beans.Societa</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</
prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
</bean>
And here's my generic DAO.java:
@Component
public class Dao {
@Resource(name = "mySessionFactory")
private SessionFactory sessionFactory;
@SuppressWarnings("unchecked")
public <T> T save(final T o){
return (T) sessionFactory.getCurrentSession().save(o);
}
public void delete(final Object object){
sessionFactory.getCurrentSession().delete(object);
}
@SuppressWarnings("unchecked")
public <T> T get(final Class<T> type, final Long id){
return (T) sessionFactory.getCurrentSession().get(type, id);
}
@SuppressWarnings("unchecked")
public <T> T merge(final T o) {
return (T) sessionFactory.getCurrentSession().merge(o);
}
public <T> void saveOrUpdate(final T o){
sessionFactory.getCurrentSession().saveOrUpdate(o);
}
@SuppressWarnings("unchecked")
public <T> List<T> getAll(final Class<T> type) {
final Session session = sessionFactory.getCurrentSession();
final Criteria crit = session.createCriteria(type);
return crit.list();
}
}

And one of my services:
@Service
@Transactional
public class ScadenzaService {
private Dao scadenzaDao;
private SocietaService societaService;
public void salvaScadenza(Scadenza scadenza) {
scadenza.setDataInserimento(new Date());
scadenza.setSocieta(societaService.getSocietaCorrente());
scadenzaDao.save(scadenza);
}
public List<Scadenza> tutteLeScadenze() {
return scadenzaDao.getAll(Scadenza.class);
}
@Autowired
public void setScadenzaDao(Dao scadenzaDao) {
this.scadenzaDao = scadenzaDao;
}
@Autowired
public void setSocietaService(SocietaService societaService) {
this.societaService = societaService;
}
}
The error 500 on Appengine is:
Failed startup of context
com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@1079ff{/,/
base/data/home/apps/s~trewnewmedia/1.357617962256387950}
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'scadenziarioController': Injection of
autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire method: public void
it.trew.prove.web.controllers.ScadenziarioController.setScadenzaService(it.trew.prove.services.ScadenzaService);
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'scadenzaService': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire method: public void
it.trew.prove.services.ScadenzaService.setSocietaService(it.trew.prove.services.SocietaService);
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'societaService': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire method: public void
it.trew.prove.services.SocietaService.setSocietaDao(it.trew.prove.model.dao.Dao);
nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dao': Injection of resource dependencies
failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'mySessionFactory': Post-processing of the
FactoryBean's object failed; nested exception is
java.lang.SecurityException: Unable to get members for class
org.hibernate.impl.SessionFactoryImpl

What do you think? Why in local works and not in GAE?

Re: Django 1.3 problem

I've been running Django 1.3 just fine with Python 2.7 and Google Cloud SQL. Django 1.3 has been added to the sdk so you can use

- libraries:
  - name: django
    version: "1.3"




On Monday, March 19, 2012 12:35:59 PM UTC-5, Matt Cooper wrote:
Hi Joe

1.3 seems to be running fine now on 2.7 or am I missing something? If it's all been added then thanks for that!

Matt

google apps script <-> google cloud sql

Hi,
first of all i try to get/put some data from google spreadsheet into
google cloud sql.
For that i found some useful link (i use the first example for my
question):
https://developers.google.com/apps-script/jdbc_overview
for the jdbc connection i use:
var conn = Jdbc.getConnection("jdbc:google:rdbms://Instance/
name_database","root", "root");
If i run the script i get this error message:
TypeError: Cannot call method "setAutoCommit" of null.
Can anyone help me with that? Do i have some additional settings in
https://code.google.com/apis/console
Thx for your help

Problems using Ibatis

Hi,
This is an exception when Ibatis is trying to set a value for a java
bean property.
java.lang.IllegalArgumentException: object is not an instance of
declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:
104)
at com.ibatis.common.beans.MethodInvoker.invoke(MethodInvoker.java:
17)
at
com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:
46)

is the GAE runtime engine not allowing the action?

Sunday, March 18, 2012

Re: HRD applications with cloud storage

Hi,

Thanks !

I was thinking of using it with HRD to avoid data contention.


Re: HRD applications with cloud storage

The Cloud SQL and Data store systems are independent. You can use one or both as you see fit for your app.
We recommend using HRD apps because that type of app will be colocated with Cloud SQL. Master slave apps are served from a different set of datacenters where cloud sql does not have presence. It will work but it will be slow.
Ken

HRD applications with cloud storage

Hi,

I am building a python 2.5 application on app engine using HRD.
My only problem is eventual consistency in HRD due to which writes fail on app engine and the data is not updated properly.

I am a little confused here, so I am going to ask straight away:
The FAQs mention that 
"We recommend that you use Google Cloud SQL with High Replication (HRD) App Engine applications." 

Does it mean that we can use both HRD as well as Google MySQL Cloud together for our application ?

Thanks,
Sushant

Saturday, March 17, 2012

Re: The rdbms API is not available because the MySQLdb library could not be loaded.

I was simply stunned to see such issue on GAE.... I have several websites served in GAE that don't even rely on datastore, or databases for that matter... now, I am having the same issues, since the update 1.6.3... really dumb!


Re: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

SELECT TIMESTAMP('0001-01-01 00:00:00') as t works...

SELECT TIMESTAMP('0000-00-00 00:00:00') as t not working...

But the column is null.. so the correct result must be "NULL" and not "0000-00-00 00:00:00"... 

Re: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

Have you tried 0001-01-01 00:00:00?



Re: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

Nobody any idea? I couldn't believe that i am the first who has a null value in timestamp...

Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

Hey!

I have a Timestamp Field with a Null Value. But the JDBC say the following error message:

Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

Seems that MySQL convert a null timestamp into '0000-00-00 00:00:00. Anybody prefered to set this flag zeroDateTimeBehavior=convertToNull

But I found no way to set it in Cloud SQL. Is it possible to set this flag?

Regards, 

Markus

Friday, March 16, 2012

Unit testing Google Cloud SQL with deployed app

Hi,

I'm currently testing methods that interact with the MySQL database
locally using GAEUnit (python27 runtime). However, if I deploy the app
to App Engine and try to run the tests on the cloud, GAEUnit cannot
use the rdbms service (error below). Normal interaction with the
deployed app works fine, i.e., the deployed app can talk to the Google
Cloud SQL instance.

Any ideas on how I can get access to the Google Cloud SQL instance via
GAEUnit within a deployed app?

Thanks!
Leo

Traceback (most recent call last):
File "test/test_models.py", line 144, in test_get_company_names
models.reset_test_database()
File "/base/data/home/apps/s~hd-analytics/1-0-dev.357531219904467056/models.py",
line 408, in reset_test_database
conn = rdbms.connect(instance=_INSTANCE_NAME, database=_TEST_DB)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/rdbms.py",
line 69, in connect
password=password)
File "/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
line 480, in __init__
self.OpenConnection()
File "/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
line 503, in OpenConnection
response = self.MakeRequest('OpenConnection', request)
File "/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
line 606, in MakeRequest
response = self.MakeRequestImpl(stub_method, request)
File "/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms_apiproxy.py",
line 66, in MakeRequestImpl
apiproxy_stub_map.MakeSyncCall('rdbms', stub_method, request, response)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py",
line 94, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py",
line 301, in MakeSyncCall
assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "rdbms"


--
Leonardo Trabuco, Postdoctoral fellow (Russell group)
CellNetworks, University of Heidelberg, Germany
http://www.russelllab.org/people/leo/

Wednesday, March 14, 2012

Cloud SQL HRD issues?

Hello everyone,

I posted a question on StackOverFlow about SQL and HRD because I thought the Cloud SQL FAQ didn't sufficiently answer this question.

Here's the link:

I'd greatly appreciate any support on this.
Best Regards,
Julian

Re: Using DictCursors

Please star this in the issue tracker.

you can search by **dict cursor** or **dict_cursor**

Regards
Sarfaraz

Tuesday, March 13, 2012

Re: Using DictCursors

Correct, the dev. server has the dict cursor implemented but the production python doesn't. I copied the implementation from the SDK source code (which is open source) to my application and mocked it that way. This works but as I said before, the performance just wasn't doing it for me.


Re: Using DictCursors

Yes, Its an AppEngine issue, not cloud-sql.

I am using sdk 1.6.3 and using dict cursor works fine.

I get errors only in production code. I cannot recall the exact message, hopefully I will try to post it ASAP.

Thanks


Re: Using DictCursors

I believe this is not a cloud-sql but an app engine issue. The problem is that dict cursor is not implemented in one or both of the app engine python sdk version (can't remember exactly).

I remember having the same exact issue and I what I did was to copy the implementation from dict cursor and kind of mock it that way. 

Spoiler alert: In my particular case, the performance was terrible because the dict cursor basically copies the data into a dictionary one result row at the time, while this happens the mysql connection remains open and the performance of the copy operation itself was terrible, at least for the result set I was working with (this might be different in your particular use case/dataset).


Re: Using DictCursors


Hi,
I am using sdk 1.6.3 on python 2.7
I checked the file rdbms.py and saw the implementation of use_dict_cursor. however
when i try to use it I get an exception
Usage:
conn = rdbms.connect(...)
cursor = conn.cursor(use_dict_cursor=True)
Exception:
cursor() got an unexpected keyword argument 'use_dict_cursor'
I guess its not usable yet.

The code is there and the tests pass for us.  Can you give us more information?  A simple, complete app to reproduce the error would be helpful.

Thanks,
Ken

Regards

Re: Google Apps Script JDBC Service and Google Cloud SQL


Its been a long time since this post was commented. This is a very important missing feature. Any word on its status?


No update, sorry.  As Saurabh suggested earlier in the thread, you can make an app to wrap your Cloud SQL data.

Ken

Monday, March 12, 2012

Re: Google Apps Script JDBC Service and Google Cloud SQL

Its been a long time since this post was commented. This is a very important missing feature. Any word on its status?

On Wednesday, December 21, 2011 11:49:14 AM UTC-5, geoggle wrote:
Just watching http://www.google.com/events/io/2011/sessions/enterprise-workflow-with-apps-script.html and during the Q/A, Evin Levey comments on the fact that trusted testers on Hosted SQL can use Apps Script to access a database. "He'll hook them up!"
So that was in May 2011. I'm guessing Hosted SQL was the name used for Cloud SQL before it was released officially in November.

Is there a timeframe for 2012 when we might see this?

Geoff


Re: Write Consistency & Geographical Replication

Hi Ronoaldo

replication only happens on writes, so it doesn't affect read performance

j


Sunday, March 11, 2012

Re: Is the data stable?

Good idea - let us know how you get on
Joe Faith | Google Cloud Product Manager
Sent from my phone, so please excuse my brevity.


Re: Is the data stable?

Hey Joe,

Thanks for your fast response. 

Fantastic! Will start trialling it asap.

Kind regards,
Matt

PS: It could be worth including that in the FAQ so that others are aware that their data will be safe in limited preview.


Re: Using DictCursors

Hi,
I am using sdk 1.6.3 on python 2.7
I checked the file rdbms.py and saw the implementation of use_dict_cursor. however
when i try to use it I get an exception
Usage:
conn = rdbms.connect(...)
cursor = conn.cursor(use_dict_cursor=True)
Exception:
cursor() got an unexpected keyword argument 'use_dict_cursor'
I guess its not usable yet.
Regards

Re: Write Consistency & Geographical Replication

Does this impact on the read queries performance? If so, can we set a consistency policy (like we can do on AppEngine M/S Datastore) to speed up read queries?


Saturday, March 10, 2012

Re: Is the data stable?

Hi Matt
All your data will be replicated in multiple locations, and we won't make any changes to the service - even during limited preview - that would put your data at risk.
For what its worth, many internal systems here at Google run on Cloud SQL.
Hope this helps.
Joe Faith | Google Cloud Product Manager
Sent from my phone, so please excuse my brevity.



Re: Is the data stable?

Hi Matt
All your data will be replicated in multiple locations, and we won't make any changes to the service - even during limited preview - that would put your data at risk.
For what its worth, many of our internal systems here at Google run on Cloud SQL.
Hope this helps.
Joe Faith | Google Cloud Product Manager
Sent from my phone, so please excuse my brevity.




Friday, March 9, 2012

Is the data stable?

Hi there,

I couldn't see an answer to this question in the FAQ or elsewhere so I thought I would ask.

I'm currently a Google App Engine customer and huge fan.

I'm considering shifting our sites data from the datastore across to Cloud SQL. 

Now I know it's still in beta but I'd love to be able to do this.

My main concern is around losing my data. Is that possibility whilst it's in beta?

Thanks in advance,
Matt





Re: Write Consistency & Geographical Replication

Hi

Google Cloud SQL uses synchronous replication, meaning that every write query returns only once the data has been written to multiple geographical locations.

J


Write Consistency & Geographical Replication

How is write consistency maintained in case of database failures?
How are you able to perform "multiply geographically replicated"; is
this done using MMM replication?

Thursday, March 8, 2012

Re: Free quota and Minimum Monthly

Hi Sarfaraz

At the moment we are working on making improvements in performance, reliability, and features, and will announce our plans for charging when the product is ready to launch. Sorry I can't give you a date yet.

We will give you at least 30 days notice before charging for the service. We can't give you details yet, but we are bearing in mind that many of you are just trying out the service.

And remember you can always use your local development environment for testing.

J


Joe Faith | Product Manager | Google Cloud

Free quota and Minimum Monthly

Will there be a free quota to test the concept of the app we will be
developing using cloud-sql and app-engine ?
Will there be a min monthly charge like we have 10 USD for App
Engine ?
We need these answers before investing our time in this. Pleeeez

Pricing and Free Quota

Will there be a free quota like App Engine ? Yes or No ?

How to call a backends job from cron job in java

I created a backends.xml as
<?xml version="1.0" encoding="UTF-8"?>
<backends>
 <backend name="cmdline1">
   <options>
     <dynamic>true</dynamic>
     <public>true</public>
   </options>
 </backend>
</backends>


This back end job calls a servlet using the <url-pattern>/_ah/start</url-pattern> from the web.xml.

and i called this back end job from a cron.xml

<?xml version="1.0" encoding="UTF-8"?>
<cronentries>
  <cron>
    <url>/test</url>
     <schedule>every 1 minutes</schedule>
    <target>cmdline1</target>
  </cron>
</cronentries>.

But i tapped the servlet using req.getRequestURI(), the servlet is always call using the url /test and not call from backend job except in the case of initial application run. Is this way is correct ? Or how can i call backend job from cron.xml?

Re: App Engine crone jobs not working on cloud sql database in java

Now its working after i placed the <target> tag inside the crone:
<cron>
     <url>/test</url>
     <schedule>every 2 hours</schedule>
     <target>version-1</target>
 </cron>

and changed the default version of application to 1 also.

Wednesday, March 7, 2012

Re: Classcast Exception using GAE/J+Spring+JPA+MySQL

I also face the same problem:
java.lang.ClassCastException: org.datanucleus.store.rdbms.RDBMSManager
cannot be cast to org.datanucleus.store.appengine.DatastoreManager
at
org.datanucleus.store.appengine.jpa.DatastoreEntityManager.<init>(DatastoreEntityManager.java:
38)
at
org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory.newEntityManager(DatastoreEntityManagerFactory.java:
102)
at
org.datanucleus.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:
407)

Re: Android connect Google Cloud Sql

I suggest you write a simple GAE app to proxy the data to/from your database.  The app will allow you to change your schema without pushing an update to all of your android devices.  It will also give you more control over which devices are allowed to touch which pieces of data.

Ken


Re: Additional admins




What is the project id, and email address you're adding? Feel free to reply privately.


Re: Additional admins

I added him to the team but he still can't see the google cloud SQL tab.



Tuesday, March 6, 2012

Android connect Google Cloud Sql

Hi All,

I'm trying to connect google cloud sql from my android, but failed due
to acck of information on this. Appreciate if anyone can help me
provides link or documentations on "How to connect Google cloud sql
from Android".Just like fetching data from Google cloud sql. Please
help. Thanks

Re: Insert Into User

I don't think you can do that with google groups.



Re: Insert Into User

Great Tony!
Following your tip I could manage to produce the same result as the
old SQL.
Here is the code updated:
CREATE USER 'testuser'@'localhost';
SET PASSWORD FOR 'testuser'@'localhost' = PASSWORD('123');
GRANT ALL ON testdb.* TO 'testuser'@'localhost';
Thank you!
PS: Is it possible to mark this thread as solved?

Re: Additional admins

See the Team page in console.

Thanks,
Brian


Additional admins

Can you add additional admins? I'd like to add additional admins like
I do with AppEngine, but I can't seem to find how to do it in the
GUI. I'd love to have it show up in their admin console.

Thanks

Re: Insert Into User

Instead of directly manipulating the underlying tables, can you try to use the account management statements instead? http://dev.mysql.com/doc/refman/5.5/en/account-management-sql.html


Insert Into table from SQuirreL without SQL (phpmyadmin style)

Is there a way to insert data into a table without SQL like on phpmyadmin?

Maybe some SQuirreL plug-in...

Thank you.

Insert Into User

Hi,

I have an old MySQL code (3.23.41) to insert users into a database:

INSERT INTO user
VALUES('localhost','test',PASSWORD('123'),'N','N','N','N','N','N','N','N','N','N','N','N','N','N');
INSERT INTO db
VALUES('localhost','test','test','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

I have received the following error:
Error 1136:
Column count doesn't match value count at row 1

I already discover that this occurs by an increase number of columns
in later releases.

I´ve found on a forum the following answer to the issue:

insert into user
(Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,Show_db_priv,Super_priv,Create_tmp_table_pri,Lock_tables_priv,Execute_priv,Repl_slave_priv,Repl_client_priv,Create_view_priv,Show_view_priv,Create_routine_priv,Alter_routine_priv,Create_user_priv
) values
('your_host','your_username',password('your_password'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

But it is not what I need, as I intent to give no rights on mysql
enviroment and full rights on database.
Before I start to change the 'Y' to 'N' I´m trying to see if someone
can point me into the right direction, or maybe a new way to do this.

Thank you!

Saturday, March 3, 2012

Re: Connection Pool

I have been using the commons dbcp pool successfully (with straight JDBC, no JDO/JPA).  It has a facility for testing a connection before returning from pool, which prevents any errors if the db instance 'went to sleep'.  The test query adds 10-15ms seconds before every query, which is acceptable to me.  DBCP has more efficient ways to check for dead connections (e.g. every x seconds while sitting in pool) but these can't be used because they involve starting up new maintenance threads, which aren't allowed in AppEngine.   

Of course, this will prevent any errors, but it won't keep some requests from taking upwards of 15 seconds while they wait for the db instance to come up.  I deal with that by having my monitoring server hit a url every 5 minutes that involves a db call, so even in periods of very low activity the db should stay on.

See more here:

http://commons.apache.org/dbcp/configuration.html

Here's how I wire up my datasource and transaction manager in Spring:

    <bean id="dsSearchIndex" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.google.appengine.api.rdbms.AppEngineDriver"/>
        <property name="url" value="jdbc:google:rdbms://xxxx.com:web-prod:searchindex/ctssearchidx"/>
        <property name="username" value="xxx"/>
        <property name="password" value="xxx"/>
        <property name="testOnBorrow" value="true"/>
        <property name="validationQuery" value="select 1"/>
    </bean>
<bean id="tmSearchIndex" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
   <property name="dataSource" ref="dsSearchIndex"/>
   <qualifier value="searchIndex"/>
</bean>
<tx:annotation-driven mode="aspectj" transaction-manager="tmSearchIndex" />
    <bean id="daoSearchIndex" class="com.commentous.searchindex.SearchIndexJdbcDao">
        <property name="dataSource" ref="dsSearchIndex"/>
    </bean>





On Tuesday, November 1, 2011 11:44:30 AM UTC-7, javabuddy wrote:
How to establish Connection Pool in GAE using AppEngineDriver in Cloud
SQL or native datastore??

Thanks

Re: The rdbms API is not available because the MySQLdb library could not be loaded.

I'm also on 10.7.3 with Python 2.7.1 and an install of MySQLdb into the standard system location. Using App Engine 1.6.3.

Adding "import MySQLdb" to the top of dev_appserver.py also fixed the problem for me. 

I still see errors like

WARNING  2012-03-03 17:29:47,709 py_zipimport.py:139] Can't open zipfile /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg: IOError: [Errno 13] file not accessible: '/Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg'

but 1) that is where the file is and it's readable and 2) my app engine app does actually work. So not sure what that error is all about.

Re: Connection Pool

hey, but how about doing like this?


    private Connection connection;

    public void init(ServletConfig c) throws ServletException {
      //Open the connection here
    }

    public void destroy() {
     //Close the connection here
    }

    public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException {
      //Use the connection here
      Statement stmt = connection.createStatement();

  }


On Friday, March 2, 2012 10:37:05 PM UTC+5:30, Joe Faith wrote:
Database connections in a cloud hosted environment should be managed differently to those on a conventional server. In particular, be aware that your database instance may be taken offline while not in use, and any pooled connections would be closed. We recommend that a new connection is created to service each HTTP request, and re-used for the duration of that request (since the time to create a new connection is similar to that required to test the liveness of an existing connection).

J

Good question ! I'm in need of the answer as well...

Le mardi 1 novembre 2011 19:44:30 UTC+1, javabuddy a écrit :
How to establish Connection Pool in GAE using AppEngineDriver in Cloud
SQL or native datastore??

Thanks



--
Joe Faith | Product Manager | Google Cloud

Friday, March 2, 2012

Re: Connection Pool

Database connections in a cloud hosted environment should be managed differently to those on a conventional server. In particular, be aware that your database instance may be taken offline while not in use, and any pooled connections would be closed. We recommend that a new connection is created to service each HTTP request, and re-used for the duration of that request (since the time to create a new connection is similar to that required to test the liveness of an existing connection).

J

Good question ! I'm in need of the answer as well...

Le mardi 1 novembre 2011 19:44:30 UTC+1, javabuddy a écrit :
How to establish Connection Pool in GAE using AppEngineDriver in Cloud
SQL or native datastore??

Thanks



--
Joe Faith | Product Manager | Google Cloud

Re: Mysql Performance

is your app an HR app? (it should be).
what are the app  & instance names?

jm.




Hello!

I have a simple table called "tbl_languages"

tl_id smallint unsigned not null primary_key auto_increment
tl_key varchar(45) not null UNIQUE
tl_short_key varchar(5) not null UNIQUE
tl_description text
tl_supported boolean not null default false

INSERT INTO tbl_languages (tl_key, tl_short_key, tl_supported)
VALUES ('german', 'de', true);

In the Google Api Console I get a 3-4ms for "SELECT * FROM tbl_languages" but in the GAE I get 80-100ms.
Is the connection between my GAE App and the Mysql Database so slow?

Thanks for help!

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

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: Connection Pool

Good question ! I'm in need of the answer as well...

Le mardi 1 novembre 2011 19:44:30 UTC+1, javabuddy a écrit :
How to establish Connection Pool in GAE using AppEngineDriver in Cloud
SQL or native datastore??

Thanks

Thursday, March 1, 2012

Mysql Performance

Hello!

I have a simple table called "tbl_languages"

tl_id smallint unsigned not null primary_key auto_increment
tl_key varchar(45) not null UNIQUE
tl_short_key varchar(5) not null UNIQUE
tl_description text
tl_supported boolean not null default false

INSERT INTO tbl_languages (tl_key, tl_short_key, tl_supported)
VALUES ('german', 'de', true);

In the Google Api Console I get a 3-4ms for "SELECT * FROM tbl_languages" but in the GAE I get 80-100ms.
Is the connection between my GAE App and the Mysql Database so slow?

Thanks for help!

Re: Classcast Exception using GAE/J+Spring+JPA+MySQL

Thanks Rob.
I have changed provider and included  datanucleus-rdbms.jar in CLASS-PATH. But still the same problem.
Do i need to make any other changes?


Re: DatabaseMetaData on version 5.5

Thanks for logging a bug on this in the tracker, I'm looking into it.

Rob

Re: System property rdbms.driver must be set

Thanks for the update!

Rob


Re: App Engine crone jobs not working on cloud sql database in java

Sorry but you'll need to be more specific than it's not working for anyone to be able to offer any suggestions.

One thing I noted, is you don't want to do the DriverManager.registerDriver inside of the doGet since that will leak new driver instances are they are added to the drivermanager each time you handle a request. Please do that in a static initializer only once.

Thanks,

Rob



Re: App Engine crone jobs not working on cloud sql database in java



You need to specify your actual full instance name in the connection string, not "testdb".

Re: Classcast Exception using GAE/J+Spring+JPA+MySQL

You need to use the RDBMS plugin's provider and not the one for AppEngine's datastore. The provider property should be set to"org.datanucleus.api.jpa.PersistenceProviderImpl". Also make sure the datanucleus-rdbms.jar (I think that's the name) is in your WEB-INF/lib directory.

Thanks,

Rob



Classcast Exception using GAE/J+Spring+JPA+MySQL

Hi,

I am developing an application using GAE/J+Spring+JPA+MySQL.
When i retrieve the data from MySQL Database i am getting the following Error.

org.datanucleus.store.rdbms.RDBMSManager cannot be cast to org.datanucleus.store.appengine.DatastoreManager

Can anybody please help me where i am doing wrong.

Following is my persistence.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">

<persistence-unit name="transactions-optional">
<provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</provider>
<class>ENTITY-CLASS-NAME</class>
<properties>
<property name="datanucleus.NontransactionalRead" value="true" />
<property name="datanucleus.NontransactionalWrite" value="true" />
<property name="javax.persistence.jdbc.driver"
value="com.google.appengine.api.rdbms.AppEngineDriver" />
<property name="datanucleus.ConnectionURL"
value="jdbc:google:rdbms://INSTACE-NAME/DATABASE_NAME" />

<property name="datanucleus.autoCreateTables" value="false" />
<property name="datanucleus.storeManagerType" value="rdbms" />
<property name="datanucleus.jpa.level" value="JPA1" />
<property name="datanucleus.jpa.addClassTransformer" value="false" 
/>
</properties>
</persistence-unit>

</persistence>

Re: App Engine crone jobs not working on cloud sql database in java

Its not working after effectively handling the exception

Re: Cannot deploy updated application to app engine

I solved this problen, by  rollback the project