Wednesday, February 29, 2012

Cannot deploy updated application to app engine

When i try to deploy my application's new version it show below error message.
 Will check again in 60 seconds.
 Will check again in 60 seconds.
 Will check again in 60 seconds.
 Will check again in 60 seconds.
  on backend null.
java.lang.RuntimeException: Version not ready.


But in the admin console the application version is created.But not updated and shows previously uploaded version.I created new application id and uploaded then it works successfully and also it successfully works in anoher existing application id.
Can anyone suggest proper solution.

Re: Loading mysql JDBC jar file -

Are you following the instructions in the documentation?


Brian


Linsanity - Learn Chinese (Mandarin) faster by using flashcards with pictures

http://www.ichineseflashcards.com will help you learn Chinese
(Mandarin) faster by using flashcards with pictures, thanks

Tuesday, February 28, 2012

Re: System property rdbms.driver must be set

Guess you solved it, but in case anyone happens here, for my JUnit
test class I was missing the helper:
public class MyTest
{
private LocalServiceTestHelper mysqlhelper;
@Before
public void setUp()
{
LocalRdbmsServiceTestConfig rdbms = new
LocalRdbmsServiceTestConfig();
rdbms.setDriverClass("com.mysql.jdbc.Driver");
rdbms.setJdbcConnectionStringFormat("jdbc:mysql://localhost:3306/
databasename?
user=databaseuser&password=databasepassword&useInformationSchema=true&useUnicode=true&characterEncoding=UTF8&useServerPrepStmts=true");
rdbms.setDatabase("databsename");
rdbms.setPassword("databasepassword");
rdbms.setUser("databaseuser");
mysqlhelper = new LocalServiceTestHelper(rdbms);
mysqlhelper.setUp();
}
@After
public void tearDown()
{
mysqlhelper.tearDown();
}
:
}
Hope that helps someone.
-c.

Re: System property rdbms.driver must be set

I had this, and was missing the test helper:

public class MyTest
{
  private final LocalServiceTestHelper mysqlhelper = new LocalServiceTestHelper(new LocalRdbmsServiceTestConfig());

  @Before
  public void setUp()
  {
    mysqlhelper.setUp();
  }

  @After
  public void tearDown()
  {
    mysqlhelper.tearDown();
  }

 :

}


Hope that help you, and anyone else who comes to this post because of the error message.


-c.

Loading mysql JDBC jar file -

I'm running my app locally, to test out connection to my new CloudSQL
Instance.

I'm loading the JDBC Driver in my code:
DriverManager.registerDriver(new AppEngineDriver());
Connection c = DriverManager
.getConnection("jdbc:google:rdbms://<projectName>:<InstanceName>/
<DBName>");

On executing locally, I get this error:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Caused by:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
com.mysql.jdbc.Driver

On forums, I read this:
"Google App Engine doesn't allow you to open Sockets. When you try to
load the JDBC driver, it makes a socket connection in a static block.
An exception in the static block leads to a ClassNotFoundException,
which is what you are seeing..."

Mysql-connector-java-5.1.18-bin.jar is in my Eclipse Build path.

What is the workaround to the Sockets issue in GAE?

In this appengine how-to section for cloudSQL, I don't find any
special reference to taking care of this situation:
https://developers.google.com/cloud-sql/docs/developers_guide_java#register_the_driver

Any pointers greatly appreciated!

Thanks,
-Shiv

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

Is it possible an exception is being thrown and your code is swallowing it? I notice that in the code you pasted, you have an empty catch block.

Brian

Re: Authorized applications to mysql Instance

Yes, that's current limitation.

Re: Maven GAE Plugin

Ok solved by myself :)

<plugin>
<groupId>net.kindleit</groupId>
<artifactId>maven-gae-plugin</artifactId>
<version>0.7.3</version>
<dependencies>
<dependency>
<groupId>net.kindleit</groupId>
<artifactId>gae-runtime</artifactId>
<version>${gae.version}</version>
<type>pom</type>
</dependency>
</dependencies>
<configuration>
<jvmFlags>
<jvmFlag>-Drdbms.server=local</jvmFlag>
<jvmFlag>-Drdbms.driver=com.mysql.jdbc.Driver</jvmFlag>
<jvmFlag>-Drdbms.url=jdbc:mysql://localhost:3306/prova?
user=root&amp;password=pass</jvmFlag>
</jvmFlags>
<serverId>appengine.google.com</serverId>
<!-- <sdkDir>${appengine.sdk.root}</sdkDir> -->
<!-- <appDir>${basedir}/war</appDir> -->
</configuration>
</plugin>

THANKS however.

About Maven GAE Plugin again...

Here's my plugin configuration:

<plugin>
<groupId>net.kindleit</groupId>
<artifactId>maven-gae-plugin</artifactId>
<version>0.7.3</version>
<dependencies>
<dependency>
<groupId>net.kindleit</groupId>
<artifactId>gae-runtime</artifactId>
<version>${gae.version}</version>
<type>pom</type>
</dependency>
</dependencies>
<configuration>
<jvmFlags>
<jvmFlag>-Drdbms.server=local</jvmFlag>
<jvmFlag>-Drdbms.driver=com.mysql.jdbc.Driver</
jvmFlag>
<jvmFlag>-Drdbms.url=jdbc:mysql://localhost:3306/prova?
user=root&amp;password=pass</jvmFlag>
</jvmFlags>
<serverId>appengine.google.com</serverId>
</configuration>
</plugin>

You can read more here: https://developers.google.com/cloud-sql/docs/developers_guide_java

First I had this trivial error, doing `mvn gae:run`

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

So I added the "real" driver to my pom.xml:

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.18</version>
</dependency>

with no results. The error remains the same.

Part of the stacktrace:


java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
com.google.appengine.tools.development.DevAppServerClassLoader.loadClass(DevAppServerClassLoader.java:
87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
com.google.appengine.api.rdbms.dev.LocalRdbmsServiceLocalDriver.registerDriver(LocalRdbmsServiceLocalDriver.java:
84)
at
com.google.appengine.api.rdbms.dev.LocalRdbmsServiceLocalDriver.init(LocalRdbmsServiceLocalDriver.java:
73)
at
com.google.appengine.api.rdbms.dev.LocalRdbmsService.init(LocalRdbmsService.java:
85)

Authorized applications to mysql Instance

Hi,

I have the size as Large in Instance settings. However, am unable to add the 4th application in the authorized application list. It throws up an error

You have reached the maximum number of authorized applications for this instance

Re: DatabaseMetaData on version 5.5

> Not sure if that's a bug in 5.5. or by design.
And can not see the list of TABLES in squirrel-sql client.
@Google Cloud SQL Team: Is it by design?
Thanks

Monday, February 27, 2012

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

        I am trying to create a crone job using scheduler of App Engine. My aim is to create a job that calls a servlet which insert values to the the table in cloud sql.I have created a crone job for update database on each minute.The admin console also shows the status of cron job as "on time success". But the values are not inserting into the table.TestServlet.java is the servlet class used to update database. My instance is testdb and database is db. TestServlet.java     
      package com.my;
        import java.io.IOException;
        import java.sql.Connection;
        import java.sql.DriverManager;
        import java.sql.PreparedStatement;
        
        import javax.servlet.http.*;
        
        import com.google.appengine.api.rdbms.AppEngineDriver;
        
        @SuppressWarnings("serial")
        public class TestServlet extends HttpServlet {
        public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        Connection c = null;
           try {
             DriverManager.registerDriver(new AppEngineDriver());
             c = DriverManager.getConnection("jdbc:google:rdbms://testdb/db");
             String fname = "Manu";
             String content = "Hai";
             if (fname == "" || content == "") {
              // out.println("<html><head></head><body>You are missing either a message or a name! Try again! Redirecting in 3 seconds...</body></html>");
             } else {
             String statement ="INSERT INTO entries (guestName, content) VALUES( ? , ? )";
             PreparedStatement stmt = c.prepareStatement(statement);
             stmt.setString(1, fname);
             stmt.setString(2, content);
             int success = 2;
             success = stmt.executeUpdate();
             }
           }catch(Exception ex){
             
             }
        }
        }
            
            Cron.xml 's url is defined in the web.xml as url-mapping tag as /test. It is placed in the WEB-INF folder along with app-engine.xml
            cron.xml
       
    
         <?xml version="1.0" encoding="UTF-8"?>
            <cronentries>
            <cron>
        <url>/test</url>
        <schedule>every 1 minutes</schedule>
            </cron>
        </cronentries>

Re: Maven GAE Plugin

Don't know it, I'd simply like to know where to put these three
properties... :-(

Re: Maven GAE Plugin

Is maven forking the jvm? If so, you may need to use argline.

Rob


Saturday, February 25, 2012

Re: The instance could not be created because you have reached the maximum number of allowed instances



There will be in the future when the product is generally available, but for now, that's the limit.

Ken

Re: JDO with Google SQL

One additional question I have is, when insert query is fired than it
shows table name as USER123 where as object name is User123. So should
the table name be all uppercase or case-sensitive.

Re: JDO with Google SQL

Tried show tables and it does not show the table. I am not sure if
Data-nucleus can create a table if it doesn't exist. Though I have set
following flag in jdoconfig.xml
<property name="datanucleus.autoCreateSchema" value="true"/>
<property name="datanucleus.validateTables" value="true"/>
<property name="datanucleus.validateConstraints" value="true"/>
<property name="datanucleus.validateColumns" value="true"/>
I don't see neither the table nor the data in google sql But when I
fire the select query from application then I get back the saved data.
Wonder what this puzzle is? and where data is getting saved?
regards

Re: JDO with Google SQL

Use show tables;
To view the list of tables after selecting the instance and database.

Friday, February 24, 2012

Re: The instance could not be created because you have reached the maximum number of allowed instances

Is there a way to connect more than 3 instance? eg: enabling billing or so

Thanks,
Bala

Re: JDO with Google SQL

How can assure that? I am using datanucleus for connection and as far
as I could see in connection log the string read "jdbc:google:rdbms://
<project_sql_>:<db_instance>/<db_name>". My local database does not
have same instance name and db name.
I am sure it's not hitting the right place in google sql but it seems
to be hitting somewhere and storing records. Wonder how to debug this?

Re: The instance could not be created because you have reached the maximum number of allowed instances

thanks, I'll try it.

Min Li

Re: The instance could not be created because you have reached the maximum number of allowed instances

You are limited to three instances per user or project. To create a new instance, you must delete one of your old instances.

Thanks,
Brian


The instance could not be created because you have reached the maximum number of allowed instances

I'm getting the below error when I tried to create a new instance to
migrate my data. Anyone could help to have a check?

The instance could not be created because you have reached the maximum
number of allowed instances.

Thanks,

Re: JDO with Google SQL

Are you sure that it is hitting the Cloud SQL instance and not your local mysql?

Ken


Re: JDO with Google SQL

Just to add I am even able to get the results back from google SQL. My
eclipse is configured to point to sql instance on google servers. What
is puzzling is why I don't see the table in my squirrel or google sql
instance.

Maven GAE Plugin

I wrote on S.O.: http://stackoverflow.com/questions/9428048/maven-gae-plugin-using-google-cloud-sql

Good morning,

I am trying to local test my web application, which makes use of:

Spring (core + MVC)
Google AppEngine
Google Cloud SQL
Hibernate
In this page https://developers.google.com/cloud-sql/docs/developers_guide_java
Google explains how to make the hello world run, and that's right. I
deploy to AppEngine with no problems.

The next need is testing on the local system, with a local standard
mysql instance and that document goes ahead in the explanation. You
can give your local access credentials by command-line or by Google
Eclipse Plugin.

But I am using the Maven GAE Plugin http://www.kindleit.net/maven_gae_plugin/
and simple mvn gae:run ends up with this error:

Cannot resolve reference to bean 'mySessionFactory' while setting bean
property 'sessionFactory'; 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.IllegalStateException: System
property rdbms.driver must be set.:
java.lang.IllegalStateException: System property rdbms.driver must be
set.
at
com.google.appengine.api.rdbms.dev.LocalRdbmsServiceLocalDriver.registerDriver(LocalRdbmsServiceLocalDriver.java:
80)

That's a pretty descriptive error, so I desperately tried:


mvn gae:run -Drdbms.server=local -Drdbms.driver=com.mysql.jdbc.Driver -
Drdbms.url=jdbc:mysql://localhost:3306/prova?user=root&password=pass


... with no result! :-(

Help! O.O

JDO with Google SQL

I finally managed to make this work. i.e to say my Java code is not
throwing any error. However I am not able to figure out where my
entity is saving data on google SQL. I saw all three databases and
could not find my entity table and data there. However data has been
persisted as when I try to persist the same entity again, it throw
duplicate key erro.

Thursday, February 23, 2012

Re: Authorizing cloud sql command line tool - Windows

Maybe the firewall on your Windows computer is blocking you?


Re: DatabaseMetaData on version 5.5

I had the same issue. It seems that because the Cloud SQL instances have useInformationSchema=true then we aren't getting the catalog information back through DatabaseMetaData.

Not sure if that's a bug in 5.5. or by design.

-c.

Tuesday, February 21, 2012

Re: Authorizing cloud sql command line tool - Windows

Any help???

Re: Using Ibatis with Google Cloud SQL

Thank you for the answer and my apologies for the question.
I must read the guide before to post any question. The good part is
that Ibatis is supported.
Regards.
Mav.

Monday, February 20, 2012

Authorizing cloud sql command line tool - Windows

I am trying to get command line tool on the Windows authorized. When I run the google_sql.cmd <instanceName>, I am getting the following error...

Exiting; Unable to open connection.
unauthorized_client:

Thanks

Re: Selecting project name

Yes, please!

Project id = 817822318968

Gian Marco Gherardi
http://gianmarco.gherardi.me


Re: Selecting project name

The project name cannot be changed (similar to your appid in appengine). If you like, you can create another project, then let me know its numeric id, and I'll send you a fresh invite.

Re: Programmatic/Command Line Exporting of an Instance to Cloud Storage?

Is there a way to vote for the addition of this feature?  It would be extremely helpful to be able to control the instance programmatically including both imports and exports.

-Scott

Re: Terrible performance when deployed to GAE

I'm currently working on some of the same issues that Derrick & eli
seem to be working with, so here's some of my ideas:
@Derrick:
Derrick, I poked around your website and it seems to me that you're
building a ratemyprofessors.com-esque site. As for the SQL query, it
looks like you're using myISAM full text searching to search VARCHAR
fields so you can create a simple relevancy ranking (the "score"
field). While that's useful, perhaps you'd be better off to split your
professor/school searches and rewrite your frontend a bit.
For example, if you go to ratemyprofessors.com, and put a professor's
name in the school search field, it won't work. Likewise, if you put a
school's name in the find professors search, it won't find the school
(seriously, go try it, this can wait!). If you can live without a
relevancy ranking, then you can switch to InnoDB and search your
tables with wildcards (i.e. Select * from professor_list where
professor_name LIKE %smith% ). I have an InnoDB table with 40k rows
which I routinely search with similar syntax, and I get searches done
lightning fast.
I'd have to see your data to verify, but my gut instinct tells me you
probably don't need a relevancy ranking; I doubt that most searches
would exceed 4-7 results. If you're really married to the idea of a
relevancy score system, you could probably just reimplement a basic
ranking system in your software once you get back the results of the
wildcard search.
Also, you can reduce the load on your SQL service. You stated in one
message that you were expecting a load of 4k to 8k SQL searches. How
much of that is searching for schools and professors, and what do the
other queries look like? Are you using the other queries to build
other web pages, like school/professor description pages?
If you are using some of the 8k queries to build school/professor
profile pages, then you can decrease a lot of the load by using
memcache to store profile page content. The first time a user looks up
info on a school/professor, you can cache that information in
memcache, then for subsequent visits you can pull data from memcache.
Also, you can async any updates to the database. Suppose someone
writes a review about a professor. It doesn't need to go onto the site
immediately (i think ratemyprofessor moderates postings as well).  You
can post any updates to the task queue, then have a backend post
updates from the queue to cloud sql. That way, it doesn't matter if
the database is slow; the backend can wait as long as necessary for
the insert to execute.
While I have some more ideas, I'd need to see your database schemata
and some example data to suggest more.
@eli
I have a table with 40k records, and a table with almost 12 million
records. If I'm only using a simple query, and the db has been given
time to load into memory, I get roughly the numbers you described.

Re: Using Ibatis with Google Cloud SQL

The class you should be using inside of AppEngine is com.google.appengine.api.rdbms.AppEngineDriver


Thanks,

Rob

Selecting project name

Hi all,

When I've created the first database on CloudSQL, the system asked me for a "project name". 

Now i cannot find how to change "project name", if i create a new instance, the previous name is automatically assigned and cannot be changed.

How can i change "project name" for new instances?

Thanks!

Using Ibatis with Google Cloud SQL

Hi all,

Is it possible to use Ibatis with GAE?. I have tried to use it, but it
seems that there is a problem with the Google Cloud SQL driver.

Caused by: java.lang.NoClassDefFoundError: java.util.prefs.Preferences
is a restricted class. Please see the Google App Engine developer's
guide for more details.
at
com.google.appengine.runtime.Request.process-1b8423f1cd7a0109(Request.java)
at java.util.prefs.Preferences.<clinit>(Preferences.java)
at com.google.cloud.sql.Driver.<clinit>(Driver.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:33)
at com.ibatis.common.beans.ClassInfo.instantiateClass(ClassInfo.java:
337)
at com.ibatis.common.resources.Resources.instantiate(Resources.java:
296)
at com.ibatis.common.resources.Resources.instantiate(Resources.java:
283)
at
com.ibatis.common.jdbc.SimpleDataSource.initialize(SimpleDataSource.java:
199)
at
com.ibatis.common.jdbc.SimpleDataSource.<init>(SimpleDataSource.java:
116)
at
com.ibatis.sqlmap.engine.datasource.SimpleDataSourceFactory.initialize(SimpleDataSourceFactory.java:
31)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser
$9.process(SqlMapConfigParser.java:220)
at
com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:
121)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:
105)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:
102)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:
102)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:51)
at
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:
46)
at
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:
39)
at
com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:
79)

Sunday, February 19, 2012

DatabaseMetaData on version 5.5

Migrate my test application failed due to DatabaseMetaData.

My test snippet as below:

String[] JDBC_METADATA_TABLE_TYPES = {"TABLE"};
Class.forName("com.google.appengine.api.rdbms.AppEngineDriver");
conn = DriverManager.getConnection(url, user, password);

String tableName = ...;

DatabaseMetaData databaseMetaData = conn.getMetaData();
ResultSet tables = databaseMetaData.getTables(null, null, tableName,
JDBC_METADATA_TABLE_TYPES);
boolean existed = tables.next();
// on my old mySQL instance (v5.1): existed = true
// on my new mySQL instance (v5.5): existed = false

I am sure the table tableName is existed in both instances.

Any help is appreciated.

Saturday, February 18, 2012

Re: eclipse arguments missing for each time

Total newbie here, but I believe this may be a parsing error. Try
using syntax without the "=", for example:
-Drdbms.server local

Friday, February 17, 2012

Re: Terrible performance when deployed to GAE

Derrick - do you have any sense of average read times on cloud sql for
even the simplest of lookups? I'm seeing 150-300ms noncached, 50
cached, and I'm wondering whether that's normal.

Thursday, February 16, 2012

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

What is the jdbc URL you are using?

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


The cli interface works fine, select, insert and update. And the application works for update and insert, just not select. But I can't figure out why.

randy@netbook:~$ appengine-java-sdk-1.6.1.1/bin/google_sql.sh esbowd1:prototype forecaster
sql> select * from forecasts;
+-------------+---------------+------------+--------------+-------------+------------+---------------+-----------+--------+
| forecast_id | forecast_date | require_by | storage_type | capacity_gb | forecaster | application   | servers   | active |
+-------------+---------------+------------+--------------+-------------+------------+---------------+-----------+--------+
|           1 |    2012-02-13 | 2012-02-13 |            1 |        1024 | forecaster | Application 1 | server1   |      1 |
|           2 |    2012-02-13 | 2012-02-13 |            1 |        1024 | forecaster | Application 1 | server1   |      0 |
|           3 |    2012-02-13 | 2012-02-13 |            1 |        1024 | forecaster | Application 1 | server1   |      1 |
|           4 |    2012-02-13 | 2012-02-13 |            1 |        2024 | forecaster | Applicatien 1 | server1   |      1 |
|           5 |    2012-02-13 | 2012-02-13 |            2 |        2024 | forecaster | Applicatien 1 | server1   |      1 |
|           6 |    2012-02-13 | 2012-02-13 |            2 |        2024 | forecaster | Application 1 | server1   |      1 |
|           7 |    2012-02-13 | 2012-02-13 |            2 |        2024 | forecaster | Application 1 | server1   |      1 |
|           8 |    2012-02-13 | 2012-02-13 |            2 |        2024 | forecaster | Application 1 | server1   |      1 |
|           9 |    2012-02-13 | 2012-01-01 |            2 |         111 | asdf       | NULL          | asd       |      1 |
|          10 |    2012-02-13 | 2012-02-02 |            2 |        1234 | asdf       | NULL          | cluser    |      1 |
|          11 |    2012-02-14 | 2012-01-01 |            2 |       11223 | asdf       | NULL          | bachelor  |      1 |
|          12 |    2012-02-14 | 2012-01-01 |            2 |        1122 | asdf       | NULL          | bachelor2 |      1 |
|          13 |    2012-02-14 | 2012-01-01 |            2 |        1122 | asdf       | NULL          | bachelor2 |      1 |
+-------------+---------------+------------+--------------+-------------+------------+---------------+-----------+--------+
13 rows in set (0.31 sec)



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

Sorry, I don't see any issues.  Can you use google_sql.sh to insert/select data?  Does it show you the data that you inserted with the application?

Ken

Wednesday, February 15, 2012

Re: Terrible performance when deployed to GAE

the app console is set to GMT -6:00

Re: Terrible performance when deployed to GAE

Hi Eli

what timezone are you in?

j


Re: Terrible performance when deployed to GAE

It's not clear to me - the error traceback, as you can see, doesn't
have to do with a specific query. And the request isn't showing up in
appstats because it fails. The ones that do succeed and do show up in
appstats show a ton of time taken for even the most simple queries
(like 300ms), and > 1 second for a single-varcharfield match on a
40,000 entry table.
Re: the abovementioned 1100ms query, this is what I see in appstats:
args = (u'jimmy4@yahoo.com',)
query = 'SELECT `rapleaf_engine_rapleafprofile`.`id`,
`r...h_user`.`id`) WHERE `auth_user`.`email` LIKE %s '
self =
CursorWrapper<cursor=Cursor<_conn=ApiProxyConnection<_deadline_seconds=30.0,
_dsn=None, ...>, ...>>
do those latencies sound way high to you?

Re: Terrible performance when deployed to GAE

I have actually rarely noticed any slow downs over the past week and a
half.

Re: Terrible performance when deployed to GAE

thanks
can you tell us what query it was getting stuck on?

j


Re: Terrible performance when deployed to GAE

Hi Joe,
happy to. Let's see:
instance: 2-appstats.simplerelevance
here's a copy from the log (I changed the api key slightly in the
interest of security):
2012-02-15 13:55:55.391 /api/v2/items?
api_key=90cefa0e8596a3bc3b5c&async=0&email=emilywhite@yahoo.com 500
60261ms 3kb Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.77 Safari/535.7
173.109.17.127 - elialbert [15/Feb/2012:11:55:55 -0800] "GET /api/v2/
items?api_key=90cefa0e8596a3bc3b5c&async=0&email=emilywhite@yahoo.com
HTTP/1.1" 500 3557 - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/
535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7" "2-
appstats.simplerelevance.appspot.com" ms=60261 cpu_ms=3867
api_cpu_ms=0 cpm_usd=0.107996
instance=00c61b117c2569016bd4065f1c17a790c5ba
This call resulted in a database timeout connection error because it
took so long (as you can see, 60 seconds). I made a separate post
about it in this group. A lot of my database calls are resulting in
similar issues.
Thanks in advance-
Eli

Re: Terrible performance when deployed to GAE

Hi Eli

We're always interested in hunting down incidents like.
It would be useful if you could supply specific times, dates, and instance names and the sample query if possible.

j

API call rdbms.CloseConnection() was explicitly cancelled?

Full traceback below. I'm seeing this a lot, especially from what I
bet are cold starts. I'm running cloud sql with django.

Any ideas?

Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/1/google/
appengine/runtime/wsgi.py", line 193, in Handle
result = handler(self._environ, self._StartResponse)
File "/base/python27_runtime/python27_lib/versions/third_party/
django-1.2/django/core/handlers/wsgi.py", line 255, in __call__
signals.request_finished.send(sender=self.__class__)
File "/base/python27_runtime/python27_lib/versions/third_party/
django-1.2/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/base/python27_runtime/python27_lib/versions/third_party/
django-1.2/django/db/__init__.py", line 84, in close_connection
conn.close()
File "/base/python27_runtime/python27_lib/versions/third_party/
django-1.2/django/db/backends/__init__.py", line 70, in close
self.connection.close()
File "/base/python27_runtime/python27_lib/versions/1/google/storage/
speckle/python/api/rdbms.py", line 523, in close
self.MakeRequest('CloseConnection', 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 308, in MakeSyncCall
rpc.CheckSuccess()
File "/base/python27_runtime/python27_lib/versions/1/google/
appengine/api/apiproxy_rpc.py", line 133, in CheckSuccess
raise self.exception
CancelledError: The API call rdbms.CloseConnection() was explicitly
cancelled.

Re: Terrible performance when deployed to GAE

Derrick - is this still a problem for you? I'm seeing some pretty
terrible latency on sql appengine-P, similar to what you're
describing. I wonder if anybody's figured out what's going on?

Tuesday, February 14, 2012

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

Here is the BD schema.

create table forecasts
(
forecast_id int unique not null auto_increment,
forecast_date DATE,
require_by DATE,
storage_type int,
capacity_gb int,
forecaster varchar(25),
application varchar(255),
servers varchar(255),
active boolean
);

And here are the functions from the MVC Controller. First the
getForecasts() that is the query that isn't working as expected. The
executeQuery() returns only an empty ResultSet with no records
fetched.

private ResultSet getForecasts()
{
//ResultSet set;
//String haveForecasts=(String)
currentSession.getAttribute("haveForecasts");
//if ( haveForecasts ==null || haveForecasts.equals("n"))
//{
//String getForecasts="select * from forecasts where
active=true";
String getForecasts="SELECT forecast_id, forecast_date,
require_by, storage_type, capacity_gb, forecaster, application,
servers, active FROM forecasts";

logger.info(getForecasts);
try
{
//set=stmt.executeQuery(getForecasts);
return(stmt.executeQuery(getForecasts));
//logger.info("Fetched Size: "+set.getFetchSize());
}
catch(Exception e)
{
e.printStackTrace();
logger.severe("On getting the Forecasts from Database\n"+e);
}
//}
return (ResultSet) null;
}


There is alot of stuff commented out that looks redundant, but this
was only for troubleshooting

This delete function works correctly.
private void deleteForecast(String passedID)
{
String delete_stmt="update forecasts set active=false where
forecast_id='"+passedID+"';";
logger.info(delete_stmt);
try
{
stmt.executeUpdate(delete_stmt);
}
catch(Exception e) {e.printStackTrace(); }
}

And here us how I initialized the DB.

else if ( google.equals("true"))
{
DriverManager.registerDriver(new AppEngineDriver());
logger.info("DB Parms: "+driver+" : "+url);

//Class.forName(driver).newInstance();
conn = DriverManager.getConnection(url);
}
else
{
logger.info("Unknown Database to open");
}
stmt=conn.createStatement();
logger.info("Database connection established");
}

Hope this help, there is alot of other code, but this is really all
that is involved in the query.

Any insight would be appreciated.

Randall

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

It might be a charset difference.

You'll need to include code and schema if you want anything more than guesses.

Ken


Incorrect SELECT results in GAE/SQL cloud JDBC?

I was wondering if anyone has ever heard of an issue like this.

I built an GAE app using the documented JDBC drivers and process for
initialing for integrating with the Google SQL Cloud. The app builds
and deploys fine, no errors or warnings.

When I deploy and launch the app locally on a Tomcat/MySQL platform,
everything works correctly, even the SELECT statement that is giving
me issued the GAE cloud.

When I push to GAE, and SQL Cloud, my select statement doesn't return
any rows, even though there are rows in the Cloud SQL DB. There are no
errors in the log, and my code verifies I am connected. I also know
I'm connected because I'm able to insert into the database using the
same Statement object with no problem. I've verified the insert on the
SQL Cloud CLI Tool. I've also confirmed the correctness of the select
statement with the API Tool as well. But when running within the GAE,
the ResultSet for my SELECT statement is empty.

Has anyone seen any issues like this? Or know of any fixed, etc?

I am intentionally not including the code in this initial post since
it's is pretty large and cumbersome, if required I can post it.

Any ideas or thoughts on this would be appreciated!

Re: Unexpected Error.... what?

Hi Brian
The new project ID is 277456819003. Appreciate the help!
-Keir

Monday, February 13, 2012

Re: Unexpected Error.... what?

Hi Keir,

A fix is underway. In the meantime, would you like to create a project using your consumer (e.g. gmail) account as a workaround? If so, you can go ahead and create a project using your consume account in devconsole, let me know its ID, and I'll send you an invite for that project id.

Thanks,
Brian


Re: Unexpected Error.... what?

Hi Keir,

This is a slightly different issue from the previous one. It seems like your google apps domain includes an upper case letter for some reason, and we're not expecting that. I'll take a look.

Thanks,
Brian

Re: Unexpected Error.... what?

I'm seeing the same error in my instance as well when trying to create
an instance. Project ID is 769919244453.
Thanks!

Friday, February 10, 2012

Re: Desarrollo

En algún lugar oí hablar de Quercus, un intérprete de PHP sobre Java, pero no se nada de él aparte de esto.

Thursday, February 9, 2012

Re: eclipse arguments missing for each time

This is the same method I used to do, but I need to setup each time, am I missing anything?

Thanks,
Bala


Re: eclipse arguments missing for each time

I had the same issue , but I figured out that if I set this up on the project (not one a class or html, jsp file), and everytime go to run the project through run-->Run Configurations-->your project-->debug (button) or run-->Debug Configurations-->your project-->run (button), your database setting should be there and will be used just fine.


eclipse arguments missing for each time


Hi Team,

My eclipse RUN arguments not saved permanently, I need to add this below for every start.

-Drdbms.server=local
-Drdbms.driver=com.mysql.jdbc.Driver
-Drdbms.url=jdbc:mysql://localhost:3306/db?user=root&password=root

Please let me know if I miss anything

Thanks,
Bala

Re: How to set autocommit Off

Got it, Thanks, Rob.

Re: How to set autocommit Off

Hi Pay,

We don't support setting init_connect.

Rob


Re: How to set autocommit Off

Dear Rob, 

thanks for reply.

Yes, I'm using JDBC and I know use setAutoCommit(false) to begin a transaction in session scope of Connection. 

But using a SQL User account without authority for auto-commit, can easily force programmer to use commit function to manage transaction.


Wednesday, February 8, 2012

Re: Django 1.3 problem

Bundling and uploading Django 1.3 with my app  worked fine. Thank you!

Re: Support Kanji Characters

On development, there are two things you need to watch for, one is the encoding used by the storage engine of your local mysql instance. The second is the encoding using by appengine (dev. server) to connect to your local mysql instance.

Both encodings should ideally match and support the characterset you are concerned about.

Note that in production, the connection encoding setting is ignored (you should even see a warning message in the appengine logs about that), and utf-8 is used by default. So if it works okay in production, this gives you a pretty good hint of what is it that is wrong with your dev. setup ;)



Re: Support Kanji Characters

I'm sorry but I don't understand your question.  Are you saying inserting UTF-8 characters works as expected on Cloud SQL but not in the devapp server?


Re: How to set autocommit Off

Are you using JDBC, or python?  jdbc requires autocommit to be set to true, so you can call setAutoCommit(false) on Connection.

Python's DPAPI driver requires is to be off, and is therefore off by default.

Rob



Re: Django 1.3 problem

I think you can also download the version of django that you want from the official website and unzip it in your application's folder, e.g. this would be including django yourself instead of using the version pre-bundled with appengine,

Re: Django 1.3 problem

Hi Marta


Django 1.3 is only available in the 25 runtime right now, so when runtime == "python27", the Django "latest" == "1.2".

We'll shortly be including Django 1.3 in the python27 runtime.  Until then, you can either fall back to 1.2, bundle and upload Django 1.3 with your app, or use the python(25) runtime.

Hope this helps

J

Re: Tenzing != Google Cloud SQL ?

correct.

jm.


Re: Django 1.3 problem

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

Django 1.3 problem

I'm trying to upload my project in django 1.3 to appengine, I fallowing the instrucions ( https://developers.google.com/cloud-sql/docs/django). 

In my app.yaml i have:

runtime: python27
api_version: 1
threadsafe: true

libraries:
- name: django
  version: "latest"

builtins:
- django_wsgi: on

However, after upload, I see in my logs that django 1.2 instead of 1.3 is used. (And I',m getting an error because I use staticfiles app)

Traceback (most recent call last):   File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 193, in Handle     result = handler(self._environ, self._StartResponse)   File "/base/python27_runtime/python27_lib/versions/third_party/django-1.2/django/core/handlers/wsgi.py", line 248, in __call__     response = self.get_response(request)   File "/base/python27_runtime/python27_lib/versions/third_party/django-1.2/django/core/handlers/base.py", line 141, in get_response     return self.handle_uncaught_exception(request, resolver, sys.exc_info()) 
.... TemplateSyntaxError: Caught ImportError while rendering: No module named staticfiles

What am I doing wrong? How can I force appenigne to use django-1.3?

Tenzing != Google Cloud SQL ?

Hi,

Can someone at Google confirms that Tenzing (http://research.google.com/pubs/pub37200.html) is not Google Cloud SQL which uses a real MySQL engine ? 

Regards

Sami

Tuesday, February 7, 2012

Re: Terrible performance when deployed to GAE

Joe,  If you want to email me at my person email, I'll ship you all the stuff you'll need.

- Derrick


Re: Terrible performance when deployed to GAE

Hi Derrick

We're very sorry about the problems you're having. We're working on performance improvements at the moment and it would be very helpful to us if you could send us a sample app to help us reproduce and track down the issue.

j

Re: Terrible performance when deployed to GAE

No worries on looking any further into this.
I've decided to hold off on deploying it here, until things seem to
stabilize.

Re: Terrible performance when deployed to GAE

No worries on looking any further into this.
I'm moving all my stuff off GAE effective immediately.

Sunday, February 5, 2012

How to set autocommit Off



I have a db user, john, who don't have SUPER privilege. 

I'd like john have no autocommit when connecting Cloud SQL.

As I know, to cause clients to begin with a default off, need to set the server's "init_connect" system variable.

How can I do? or no support now?

thanks, 
-Pay

Saturday, February 4, 2012

Thursday, February 2, 2012

Re: What's the roadmap

Hi Fabio, Will

We will be launching the product when its ready. Sorry I can't give you a date yet.

In the meantime we remain absolutely committed to the service, and are making improvements in performance, reliability, and features.

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.

J


Re: geospatial queries

the limitation of the spatial extension to myisam was removed in 5.0.16. Only myisam supports spatial indexes though. 

Re: My activation link expired

I'll send you another link

j


Re: Terrible performance when deployed to GAE

Now, it's going very fast!! And again, I've made no changes.
See the link: (sorry for the extra line-break, just trying to keep
this from being indexed by search engines).
http://1-0-3.pro
feval3.appspot.com/School/908/Western_Kentucky_University_(WKU)
Latencies from app engine log are: 11, 10, 9, 9, 164, 152, 12, 9, 11,
11, 10 ms
Network settings, in Chrome developer tools show the pages coming back
in ~55 milliseconds.
DOMContentLoaded: <100ms
This is what I like to see, now if only it were consistent.

Re: What's the roadmap

And especially prices & informations about what will be charged (will you charge read/write queries as you do for the datastore ?).

What's the roadmap

When do you estimate to release Cloud SQL as a stable version,
available for using in enterprise GAE applications?

Wednesday, February 1, 2012

No partitions allowed?

Hi, I was surprised to get an error saying that the --skip-partition option is enabled, so my ddl failed since all of my tables have carefully designed partitioning schemes for scalability and performance (every one of my search queries must take advantage of partition pruning).  There is no mention of PARTITION clauses being disallowed in the list of unsupported functions.

I really, REALLY hope this is something temporary and that you can enable it soon.  Without partitioning there is no way the search index I am using the SQL instance for is going to scale along with the rest of my app.


My activation link expired

Hello Support personnel

I did request a SQL service from you. But some how activation/welcome mail went to spam folder and it got deleted. How can I get restore or get a new one.

Thanks
G. Sridhara

Re: Terrible performance when deployed to GAE

I'm not too worried about the initial start up time.  On worried about it not getting better after 30 minutes and 300 requests.  I'm also worried about the fact that ots perfectly fine at times, but hit or miss at others.
How much ram are we talking regarding innoDB vs MyISAM?

Re: Terrible performance when deployed to GAE

Derick:  ... I told you :p


Re: Terrible performance when deployed to GAE

Also using high replication, yes.

Re: Terrible performance when deployed to GAE

Gotcha.
At times however (yesterday) it was/is blazingly fast.  Seems like ita spexific to an app engine VM. As any amount of time after a cold start (2 hrs) its still really slow (with no app changes) .
Thanks,
  Derrick

Re: Terrible performance when deployed to GAE

Thanks for the infos Derrick.

There's 2 contributing factors I can see right away.

1 - Your instance just started at 12:42; probably awaken by the GAE request. Instances are essentially swapped out when they don't see requests, so this is expected. After a restart, the cache is cold, so it need to read from disk more than if it was warm and is slower.
2 - You're using Myisam, which only gets a small amount of cache RAM (we currently dedicate most of the RAM to the innodb cache), so we expect queries using myisam to be significantly slower (on a local machine, your OS cache hides the disk accesses).

Now it'd be interesting to gather query-level latency measurements from your app, and compare against the console timing, to see if there's a huge difference. You could first start with a single query and then start varying them to see if cache misses trigger the multi second latencies you're seeing.

Also, is your application configured to be an HR app? If not, this would also contribute to additional latency between the app and the DB.

jm.



Re: Terrible performance when deployed to GAE

It's actually happening right now.


Took 7.29 seconds (after the app had already started up previously)

The SQL instance is : pr ofe val-db:pr ofe val-db  (without the spaces)


The Query

use pro feval;  (without the spaces)

select distinct * from (select match(p.fullname, p.schoolname) against('crawford') as score, p.professorId, p.schoolId, p.lname, p.fname, p.schoolName, p.ID,r.id as regionId, r.name as regionName, 'p' as searchtype
  from final_professors p, schools s, regions r
  where match(p.fullname, p.schoolname) against('crawford')  
  and p.schoolID  = s.id and s.regionID = r.id limit   0 , 41) a
  union
  select distinct * from (select  match(s.name) against('crawford') as score,0 as profesorId,s.id as schoolId,'' as LName,'' as FName,s.name as schoolName, 0 as ID,r.id as regionID, r.name as regionName, 's' as searchtype
  from schools s, regions r where (match(s.name) against('crawford') and s.regionID = r.id)  limit  0 , 41)b
  order by score desc;

From the console: 
Feb 1, 2012 12:45 PM (18 ms)

Any help would "greatly" be appreciated.

- Derrick


Re: Terrible performance when deployed to GAE

Hi Derrick

could you tell us when exactly you noticed the problem?

J


Re: Terrible performance when deployed to GAE

Very good to know, but I don't believe any of this is related to my
problem.

Re: Will the data-store of Google app engine be integrated into Google Cloud SQL?

Hi Lin


Will the data-store of Google app engine be integrated into Google Cloud SQL?

The GAE datastore and Cloud SQL are designed to be complementary:
The datastore is NoSQL database designed for massive scalability
Cloud SQL is a SQL database designed to provide robust 'ACID' transactions

J

Re: Terrible performance when deployed to GAE

When I was trying it I got the impression that the MySQL instance(s) would be created / killed depending on the load.

What I mean is that whenever I let the test application rest for a while, presumably the SQL instances were killed and next time I tried to issue a request it would take several seconds for the MySQL to start accepting connections again. 

I also suspect that it takes long time because the operation of instantiating a new SQL instance may involve copying the entire database (presumably saved in the form of a protobuffer somewhere) to the actual virtual instance that runs the MySQL process that ultimately answers the queries.

I can see how this could be the case as they may not want to waste resources keeping an instance alive that is just sitting idle all day.

If this is really the case, it shouldn't be a problem in production as the load would be continuous (hopefully :)). If your load is on/off, what you can do is set up a warm-up request in GAE via a cronjob, to issue say one request per minute to your application, with the sole purpose of preventing the database instance from being killed when there's no load.

You can also use the cron technique to validate the theory above, if you do, please post your findings in the group,

Hope this helps,

Reinaldo


Plans for Google Cloud SQL

We had a query from one of our trusted testers about our plans for Google Cloud SQL, and thought that you might be interested in the response.

We are very committed to Cloud SQL in the long term, not least because it is widely used within Google internally! It is an essential part of the Google Cloud platform.

We are currently concentrating on improving performance, and adding features such as scheduled backups. Once we are 100% happy with these then we will announce a full launch, along with our plans for charging for the service.

Hope this helps

J

Re: Terrible performance when deployed to GAE

I'm having the issue yet again, but it still seems related to GAE-J.
Requests that normally take well below 200ms are taking 4 to 5 seconds
(if I'm lucky).
I occasionally get requests which take over 20 to 30 seconds.

Re: After upgrade to 5.5 "Cannot load from mysql.proc"

You could probably try dropping and recreating the mysql.proc table with an empty table values.  Afterwards re-execute the create procedure statement to recreate the stored procedure.

Rob


Re: MySQL clients

Hi Fabio

Any admin or reporting client that uses JDBC should be able to connect to your Cloud SQL instance using the driver supplied in google_sql.jar.
We have only documented the use of SQuirrel since it is the client we recommend, though other users have reported connecting with Crystal Reports and DBViz. Let us know how you get on.



--
Joe Faith | Product Manager | Google Cloud

MySQL clients

Can I connect to Google Cloud SQL with any MySQL client, like Toad,
Mysql front, or any other?
Or do I have to use squirell, mandatory?
Thank you

After upgrade to 5.5 "Cannot load from mysql.proc"

> show procedure status;

Cannot load from mysql.proc. The table is probably corrupted

Please help me to resolve 

Re: Postgres

how about Postgres/PostGIS for spatial support?

Will the data-store of Google app engine be integrated into Google Cloud SQL?

Will the data-store of Google app engine be integrated into Google Cloud SQL?

PS: Do you have any information about the pricing information of Google Cloud SQL? 

Re: Postgres

I am looking for Window Functions in Postgres and I find no similar
function in MySQL.
All other features are in MySQL too... But Window Functions are still
great.
But if no plans for Postgres I will/must use MySQL.
Thanks