Re: [appengine-java] Re: GAE or EC2

2010-11-13 Thread Muhammad Ijaz Khan
Hi,
Anyone having any other reference to GAE/EC2 comparison or other literature
please share as I am working on a comparison assignment for these two for my
course project. Thanks.
regards,
Ijaz

On Tue, Nov 9, 2010 at 7:09 AM, Vikas Hazrati vhazr...@gmail.com wrote:

 You might also want to check out a detailed comparison on technical
 aspects here


 http://thoughts.inphina.com/2010/11/01/comparing-google-app-engine-and-amazon-ec2-on-technology/

 Regards | Vikas

 On Nov 9, 9:32 am, Didier Durand durand.did...@gmail.com wrote:
  Hi JY,
 
  I have used both: for a small company aiming at big applications, I
  would definitely go GAE because it's PaaS: you don't have to deal with
  the infrastructure which can become quite time consuming when your
  application gets big if on EC2 (you have to update/patch your images,
  take care of your scaling, etc.). It's probably not what you want to
  spend time on at start with limited resource.
 
  On the other side, GAE has of course limitations / restrictions: Java-
  only, datastore specific architecture, etc.
 
  To reassure you, (a) the code of GAE is open source (did not check if
  100%) and (b) some people are trying to replicate the system in an
  independent fashion to provide alternatives: check out the AppScale
  project athttp://
 googleappengine.blogspot.com/2010/10/research-project-appscale...
 
  regards
  didier
 
  On Nov 9, 2:59 am, JY jy2...@gmail.com wrote:
 
   I want to ask fellow GAE users whether you think GAE is good choice to
   build real business on?
   I have used GAE for some personal projects, and right now help a
   friend on a tiny start up (but with big dream). The project is related
   to social network - I am thinking of two options:
   1, GAE
   The benefits are obvious. However, it is also locking you inyou
   don't have much control over it. If you are unhappy later, you will
   have to redo the persistence layer and migrate data etc.
   2, EC2
   You have much more control, and if the start-up gets funding, it is
   easy to migrate to dedicated hosting or even its own data center. The
   down side is developer (me, and only me) will have to spend quite some
   time to take care of the infrastructure (although I like this kind of
   work...)
 
   I think my biggest concern of GAE is over the quality of service, and
   the data-store - if I go EC2, I probably will use a NoSQL solution
   like MogoDb, or Cassandra. The development efforts might be similar -
   all products are sort of young, hot, and limited.
 
   Thanks.
 
   JY

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Accessing Google spreadsheet using Java

2010-11-13 Thread Vikas Hazrati
We are directly using the spreadsheet API to manage data within the
spreadsheet, that seems to work fine for us

http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html

Regards | Vikas
www.inphina.com

On Nov 1, 3:55 pm, prakhil samar prakhil.purch...@gmail.com wrote:
 I have created a googlespreadsheetand I want to access its contents
 using java. I have created the following code:
 public static void main(String[] args) throws Exception{

         URL feedUrl = new URL();

                 SpreadsheetService myService = new
 SpreadsheetService(googleapps_spreadsheet);
                 myService.setUserCredentials(prakhil.purch...@gmail.com,
 purchase);
         SpreadsheetFeed resultFeed = myService.getFeed(feedUrl,
 SpreadsheetFeed.class);

         System.out.println(YourSpreadsheet:);
         for(int i=0; iresultFeed.getEntries().size(); i++){
                 SpreadsheetEntry entry = resultFeed.getEntries().get(i);
                 System.out.println(\t+
 entry.getTitle().getPlainText());

         }
     }

 It not giving any results. Can somebody who has used googlespreadsheetwith 
 java before, please suggest what is the mistake in
 the code.

 Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: App Engine Really Slow after certain time of no requests

2010-11-13 Thread zhiw...@gmail.com
http://code.google.com/intl/en/appengine/kb/java.html#What_Is_A_Loading_Request

On Nov 12, 1:48 am, GeneralSlaine lennart.ben...@gmail.com wrote:
 Hi all,

 I have had a number of performance issues on initial loading of my app
 engine application. Part of it is already solved by using Caching.
 However, my application is still very slow when first loading a
 servlet after a certain amount of time of inactivity (I think about 1
 minute).

 After this period of inactivity it takes from 3 to 6 seconds to load.
 Next requests take typically 400 MS.

 The initial load time is not acceptable for the actual application.
 Anyone any experience with this? How can I avoid this?

 I already considered implementing following solutions to keep
 application / servlet in memory
 1/ call application every minute from external application
 2/ setup a cron job performing a request every minute to actual
 servlet

 I think both are a solution but honestly not my preferred solution as
 I expect performance from this platform.

 BRL

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: App Engine Really Slow after certain time of no requests

2010-11-13 Thread GeneralSlaine
Thanks, this is exactly the info I looking for.

On 13 nov, 15:28, zhiw...@gmail.com zhiw...@gmail.com wrote:
 http://code.google.com/intl/en/appengine/kb/java.html#What_Is_A_Loadi...

 On Nov 12, 1:48 am,GeneralSlainelennart.ben...@gmail.com wrote:







  Hi all,

  I have had a number of performance issues on initial loading of my app
  engine application. Part of it is already solved by using Caching.
  However, my application is still very slow when first loading a
  servlet after a certain amount of time of inactivity (I think about 1
  minute).

  After this period of inactivity it takes from 3 to 6 seconds to load.
  Next requests take typically 400 MS.

  The initial load time is not acceptable for the actual application.
  Anyone any experience with this? How can I avoid this?

  I already considered implementing following solutions to keep
  application / servlet in memory
  1/ call application every minute from external application
  2/ setup a cron job performing a request every minute to actual
  servlet

  I think both are a solution but honestly not my preferred solution as
  I expect performance from this platform.

  BRL

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Timeout while deploying

2010-11-13 Thread nicanor.babula
Hi,

Sure thing!

appId: domodentweb

and here is appengine.xml:

[code]
?xml version=1.0 encoding=utf-8?
appengine-web-app xmlns=http://appengine.google.com/ns/1.0;
applicationdomodentweb/application
version2g/version

sessions-enabledtrue/sessions-enabled
precompilation-enabledtrue/precompilation-enabled

!-- Configure java.util.logging --
system-properties
property name=java.util.logging.config.file value=WEB-INF/
logging.properties/
property name=com.google.gdata.DisableCookieHandler
value=true/
/system-properties

admin-console
page name=Gestione account url=/admin/ /
page name=Importazione treatments url=/admin/
importTreatments.jsp /
/admin-console

/appengine-web-app
[/code]

On 12 Nov, 21:38, Joakim Söderström joakim.soderst...@gmail.com
wrote:
 Sure, here are the appengine-web.xml files of our two main apps.

 I hope this helps!

 //Joakim

 2010/11/12 Ikai Lan (Google)
 ikai.l+gro...@google.comikai.l%2bgro...@google.com









  Do you guys have a sample appengine-web.xml and application IDs?

  --
  Ikai Lan
  Developer Programs Engineer, Google App Engine
  Blogger:http://googleappengine.blogspot.com
  Reddit:http://www.reddit.com/r/appengine
  Twitter:http://twitter.com/app_engine

  On Fri, Nov 12, 2010 at 2:00 AM, Didier Durand 
  durand.did...@gmail.comwrote:

  Hi

  Same thing here: I noticed that the messages in the deploying script
  have changed a little bit. I guess that Google team has made / is
  making an update on the infrastructure and it brings some issues...

  Some patience will probably solve it ;-)
  didier

  On Nov 12, 10:43 am, nicanor.babula nicanor.bab...@gmail.com
  wrote:
    Hi,

   I am experiencing the same problem with my application
   ID: domodentweb

   com.google.apphosting.utils.config.AppEngineConfigException: Received
   IOException parsing the input stream for G:/eclipseWorkspaces/
   workspace_jee_galileo/domodentweb/war\WEB-INF/web.xml
           at

  com.google.apphosting.utils.config.AbstractConfigXmlReader.getTopLevelNode(
   AbstractConfigXmlReader.java:
   210)
           at

  com.google.apphosting.utils.config.AbstractConfigXmlReader.parse(AbstractCo
   nfigXmlReader.java:
   228)
           at

  com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.jav
   a:
   142)
           at

  com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.jav
   a:
   22)
           at

  com.google.apphosting.utils.config.AbstractConfigXmlReader.readConfigXml(Ab
   stractConfigXmlReader.java:
   111)
           at

  com.google.apphosting.utils.config.WebXmlReader.readWebXml(WebXmlReader.jav
   a:
   73)
           at
   com.google.appengine.tools.admin.Application.init(Application.java:
   105)
           at

  com.google.appengine.tools.admin.Application.readApplication(Application.ja
   va:
   151)
           at

  com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.createAppAdmin(
   AppEngineBridgeImpl.java:
   204)
           at

  com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngin
   eBridgeImpl.java:
   265)
           at

  com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(De
   ployProjectJob.java:
   146)
           at

  org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorksp
   aceJob.java:
   38)
           at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
   Caused by: java.net.ConnectException: Connection timed out: connect
           at java.net.PlainSocketImpl.socketConnect(Native Method)
           at java.net.PlainSocketImpl.doConnect(Unknown Source)
           at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
           at java.net.PlainSocketImpl.connect(Unknown Source)
           at java.net.SocksSocketImpl.connect(Unknown Source)
           at java.net.Socket.connect(Unknown Source)
           at java.net.Socket.connect(Unknown Source)
           at sun.net.NetworkClient.doConnect(Unknown Source)
           at sun.net.www.http.HttpClient.openServer(UnknownSource)
           at sun.net.www.http.HttpClient.openServer(UnknownSource)
           at sun.net.www.http.HttpClient.init(Unknown Source)
           at sun.net.www.http.HttpClient.New(UnknownSource)
           at sun.net.www.http.HttpClient.New(UnknownSource)
            at
   sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
   Source)
           at
  sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
   Source)
           at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown
   Source)
           at
  sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
   Source)
           at
  org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
   Source)
           at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
   Source)
           at
  

Re: [appengine-java] Re: GAE or EC2

2010-11-13 Thread Tatyana
*
regarding SSL the same page says:

Custom Domain SSL*
Map your company’s domain over HTTPS to your App Engine applications
Status: In Development
Estimate: Limited Release by EOY 2010


On Sat, Nov 13, 2010 at 11:10 AM, Fred pfiste...@gmail.com wrote:

 Ikai raises good points and I can confirm that GAE is a different way
 of thinking and developing apps ... but also have to second that it's
 great fun once you get the hang of it.
 However @Ikai, the identity crisis has been noticed, people turned
 their backs and I'd assume it's largely to the matter of lacking
 communication. The GAE for Business site has been updated last on May
 19th (really?): http://code.google.com/appengine/business/roadmap.html
 ... many people are waiting forever for SSL for custom domains and
 business reliability. A level of confidence is hard to maintain if
 nobody knows where you guys are at and what's gonna happen next ;-)

 Keep communicating,
 Fred

 On Nov 13, 11:28 am, Muhammad Ijaz Khan aija...@gmail.com wrote:
  Hi,
  Anyone having any other reference to GAE/EC2 comparison or other
 literature
  please share as I am working on a comparison assignment for these two for
 my
  course project. Thanks.
  regards,
  Ijaz
 
  On Tue, Nov 9, 2010 at 7:09 AM, Vikas Hazrati vhazr...@gmail.com
 wrote:
   You might also want to check out a detailed comparison on technical
   aspects here
 
  http://thoughts.inphina.com/2010/11/01/comparing-google-app-engine-an.
 ..
 
   Regards | Vikas
 
   On Nov 9, 9:32 am, Didier Durand durand.did...@gmail.com wrote:
Hi JY,
 
I have used both: for a small company aiming at big applications, I
would definitely go GAE because it's PaaS: you don't have to deal
 with
the infrastructure which can become quite time consuming when your
application gets big if on EC2 (you have to update/patch your images,
take care of your scaling, etc.). It's probably not what you want to
spend time on at start with limited resource.
 
On the other side, GAE has of course limitations / restrictions:
 Java-
only, datastore specific architecture, etc.
 
To reassure you, (a) the code of GAE is open source (did not check if
100%) and (b) some people are trying to replicate the system in an
independent fashion to provide alternatives: check out the AppScale
project athttp://
   googleappengine.blogspot.com/2010/10/research-project-appscale...
 
regards
didier
 
On Nov 9, 2:59 am, JY jy2...@gmail.com wrote:
 
 I want to ask fellow GAE users whether you think GAE is good choice
 to
 build real business on?
 I have used GAE for some personal projects, and right now help a
 friend on a tiny start up (but with big dream). The project is
 related
 to social network - I am thinking of two options:
 1, GAE
 The benefits are obvious. However, it is also locking you inyou
 don't have much control over it. If you are unhappy later, you will
 have to redo the persistence layer and migrate data etc.
 2, EC2
 You have much more control, and if the start-up gets funding, it is
 easy to migrate to dedicated hosting or even its own data center.
 The
 down side is developer (me, and only me) will have to spend quite
 some
 time to take care of the infrastructure (although I like this kind
 of
 work...)
 
 I think my biggest concern of GAE is over the quality of service,
 and
 the data-store - if I go EC2, I probably will use a NoSQL solution
 like MogoDb, or Cassandra. The development efforts might be similar
 -
 all products are sort of young, hot, and limited.
 
 Thanks.
 
 JY
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Google App Engine for Java group.
   To post to this group, send email to
   google-appengine-j...@googlegroups.com.
   To unsubscribe from this group, send email to
   google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/google-appengine-java?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, 

[google-appengine] Datastore to reuse indexes

2010-11-13 Thread anatoliy
I have an entity with indexed property nss which is a collection.

Making query like (produced via Query.toString()):

SELECT __key__ FROM IndexRecord WHERE nss = qwe AND nss = wer AND nss
= ert AND nss = rty AND nss = tyu

causes randomly (e.g. it works occasionally) exceptions no matching
index found.. with indexes:
datastore-index kind=IndexRecord ancestor=false source=manual
property name=nss direction=asc/
property name=nss direction=asc/
property name=nss direction=asc/
/datastore-index

datastore-index kind=IndexRecord ancestor=false source=manual
property name=nss direction=asc/
property name=nss direction=asc/
property name=nss direction=asc/
property name=nss direction=asc/
/datastore-index

I expected that datastore is able to reuse same index for a property
if multiple filters specified. SDK does not generate index
declarations in the datastore-indexes-auto.xml file.

Strange thing that running that query from console works ok:

SELECT * FROM IndexRecord WHERE nss = 'qwe' AND nss = 'wer' AND nss =
'ert' AND nss = 'rty' AND nss = 'tyu' AND nss = 'tydu'

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Send mail: Authorized sender question

2010-11-13 Thread dflorey
Hi,
I'm working on an app that allows users to login with either a regular
Google or a Google Apps account.
As the app engine sdk does not yet provide OpenID+OAuth I'm using the
step2 implementation to authorize users.

Unfortunately the mail service does not know anything about the
current user when not using the built in auth functionality.
So only when using AuthSub I'm able to get access to the users data+am
able to send mails on his behalf.
But to work with AuthSub I've to create a dedicated application for
every domain because the access has to be restricted to this domain.

Is there a way to set the current user using the OpenID credentials?
Or  any other suggestions how to build an application that works with
both Google and Google apps account and lets me send mails on the
users behalf?

Thanks,

Daniel

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: how to *not* use _ah/queue/deferred?

2010-11-13 Thread Ivan Uemlianin
Dear 风笑雪

Thank you for your comment.

It's failing to find the request page because I've commented out the
url: /_ah/queue/deferred line in my app.yaml.

However, it's not just old tasks re-running: new tasks are being
created.

Is there any way I can stop these tasks being generated?  As far as I
can tell, there's nothing in my code which is generating them.

I purge the task queue, deleting all the tasks, and the queue just
fills up again.

I don't know what is creating these tasks or sending them to the
queue.  Can anyone advise how I can find out?

With thanks and best wishes

Ivan


On Nov 12, 4:16 am, 风笑雪 kea...@gmail.com wrote:
 The status was 404, means GAE tried to execute this task, but failed since
 it couldn't find the request page.

 So the task will run forever until the status become 2xx, that's why it
 always active.

 --
 keakon

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Re: how to *not* use _ah/queue/deferred?

2010-11-13 Thread Peter Petrov
Django-nonrel uses 'deferred' for various things internally - e.g. for
sending emails.

On Sat, Nov 13, 2010 at 1:44 PM, Ivan Uemlianin bigmarch2...@gmail.comwrote:

 Dear 风笑雪

 Thank you for your comment.

 It's failing to find the request page because I've commented out the
 url: /_ah/queue/deferred line in my app.yaml.

 However, it's not just old tasks re-running: new tasks are being
 created.

 Is there any way I can stop these tasks being generated?  As far as I
 can tell, there's nothing in my code which is generating them.

 I purge the task queue, deleting all the tasks, and the queue just
 fills up again.

 I don't know what is creating these tasks or sending them to the
 queue.  Can anyone advise how I can find out?

 With thanks and best wishes

 Ivan


 On Nov 12, 4:16 am, 风笑雪 kea...@gmail.com wrote:
  The status was 404, means GAE tried to execute this task, but failed
 since
  it couldn't find the request page.
 
  So the task will run forever until the status become 2xx, that's why it
  always active.
 
  --
  keakon

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To post to this group, send email to google-appeng...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] How do you use the development server for testing

2010-11-13 Thread Wim den Ouden
Hi Zeynel,
Why do you use type(results)?
why not simple results_type = results
gr
wim

On Sat, Nov 13, 2010 at 6:34 AM, Zeynel azeyn...@gmail.com wrote:
 Hello,

 I am doing a lot of testing at this stage of learning App Engine but I
 am having some problems printing something like this:
 ...
 ...
 results = query.fetch(10)

 results_type = type(results)
 self.response.out.write(results_type)

 prints nothing (and no error message).

 If I do

 self.response.out.write(results)

 it prints the content of the results.

 How do you use the development server to debug? Thanks.

 --
 You received this message because you are subscribed to the Google Groups 
 Google App Engine group.
 To post to this group, send email to google-appeng...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine?hl=en.





-- 
gr
wdo

Demo free E-business: https://e-comm.appspot.com
Wim den Ouden Google App Engine (cloud)

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] How do you use the development server for testing

2010-11-13 Thread 风笑雪
results_type is always list.
self.response.out.write can accept a string object, so you need
self.response.out.write(str(results_type))

--
keakon


On Sat, Nov 13, 2010 at 8:10 PM, Wim den Ouden wdenou...@gmail.com wrote:

 Hi Zeynel,
 Why do you use type(results)?
 why not simple results_type = results
 gr
 wim

 On Sat, Nov 13, 2010 at 6:34 AM, Zeynel azeyn...@gmail.com wrote:
  Hello,
 
  I am doing a lot of testing at this stage of learning App Engine but I
  am having some problems printing something like this:
  ...
  ...
  results = query.fetch(10)
 
  results_type = type(results)
  self.response.out.write(results_type)
 
  prints nothing (and no error message).
 
  If I do
 
  self.response.out.write(results)
 
  it prints the content of the results.
 
  How do you use the development server to debug? Thanks.
 
  --
  You received this message because you are subscribed to the Google Groups
 Google App Engine group.
  To post to this group, send email to google-appeng...@googlegroups.com.
  To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.
 
 



 --
 gr
 wdo

 Demo free E-business: https://e-comm.appspot.com
 Wim den Ouden Google App Engine (cloud)

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To post to this group, send email to google-appeng...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Datastore to reuse indexes

2010-11-13 Thread 风笑雪
You don't need to define any composite indexes, it can use merge join.

--
keakon


On Sat, Nov 13, 2010 at 5:48 PM, anatoliy anatoliy.arteme...@gmail.comwrote:

 I have an entity with indexed property nss which is a collection.

 Making query like (produced via Query.toString()):

 SELECT __key__ FROM IndexRecord WHERE nss = qwe AND nss = wer AND nss
 = ert AND nss = rty AND nss = tyu

 causes randomly (e.g. it works occasionally) exceptions no matching
 index found.. with indexes:
 datastore-index kind=IndexRecord ancestor=false source=manual
property name=nss direction=asc/
property name=nss direction=asc/
property name=nss direction=asc/
 /datastore-index

 datastore-index kind=IndexRecord ancestor=false source=manual
property name=nss direction=asc/
property name=nss direction=asc/
property name=nss direction=asc/
property name=nss direction=asc/
 /datastore-index

 I expected that datastore is able to reuse same index for a property
 if multiple filters specified. SDK does not generate index
 declarations in the datastore-indexes-auto.xml file.

 Strange thing that running that query from console works ok:

 SELECT * FROM IndexRecord WHERE nss = 'qwe' AND nss = 'wer' AND nss =
 'ert' AND nss = 'rty' AND nss = 'tyu' AND nss = 'tydu'

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine group.
 To post to this group, send email to google-appeng...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Only one property per query may have inequality filters?

2010-11-13 Thread Remigius
I have performed some experiments. I generated test data on which an
IN query was performed. The test data consists of the following:

o an optional parent for all further test entities (i.e. the tests
were performed with and without common parent)
o a set of n referred entities, n taking the values 30, 50, 100, 500
o a set of n referrer entities, each having a field that contains
the key of one of the referred entities

For each experiment, there were two (no parent) resp. three (with
parent) queries, as follows (I hope the code can still be read after
reformatting in the post):

  public static final String parentEntityKind = TestInQueryParent;
  public static final String referredEntityKind =
TestInQueryReferred;
  public static final String referrerEntityKind =
TestInQueryReferrer;
  public static final String referrerField = ref;

  private void queryData(StringBuilder out) {
DatastoreServiceConfig config =
DatastoreServiceConfig.Builder.withDefaults();
DatastoreService datastoreService =
DatastoreServiceFactory.getDatastoreService(config);

if(withParent) {
  Query parentQuery = new Query(parentEntityKind);
  Entity parent =
datastoreService.prepare(parentQuery).asSingleEntity();
  out.append(fetched parent);
}

Query referredQuery = withParent ? new Query(referredEntityKind,
parent.getKey()) : new Query(referredEntityKind);
referredQuery.setKeysOnly();
long startTime = new Date().getTime();
IterableEntity referreds =
datastoreService.prepare(referredQuery).asIterable();
ArrayListEntity referredList = new ArrayListEntity();
for(Entity referred : referreds) {
  referredList.add(referred);
}
long endTime = new Date().getTime();
out.append(brfetched );
out.append(referredList.size());
out.append( referred entities in );
out.append(Log.timeDiff(startTime, endTime));

ListKey keyList = new ArrayListKey();
for (Entity entity : referredList) {
  keyList.add(entity.getKey());
}
Query inQuery = new Query(referrerEntityKind);
inQuery.addFilter(referrerField, Query.FilterOperator.IN,
keyList);
startTime = new Date().getTime();
ListEntity result =
datastoreService.prepare(inQuery).asList(FetchOptions.Builder.withDefaults());
endTime = new Date().getTime();
out.append(brfetched );
out.append(result.size());
out.append( referrer entities in );
out.append(Log.timeDiff(startTime, endTime));
  }

Log.timeDiff(startTime, endTime) computes the difference between start
time and end time and converts it to a String.

The results can be found here:

https://spreadsheets.google.com/ccc?
key=0AvB6ADVFJKfSdHRWYjhNUWVwLWJDX2lkWEdSVnpNREEhl=en

I have enabled appstats, but it is not feasible to add a screen shot
of the experiment with 500 entity pairs here. However, the picture is
very similar to the Python one (except for the lack of a limit of 30,
of course). It looks again as if the IN query is split into 500
individual queries that are executed sequentially, each of which takes
about 2-6ms elapse time, resulting in an RPC total of 2683ms (11305ms
api) and a Grand Total of 3192ms (11305ms cpu+api), which means that
it's not only possible to execute such queries, but moreover they
execute in a reasonnable amount of time. Of course, in this particular
case it would be easier to query the entities directly using a
get(ListKey) call, but if you have multiple referrers to query (like
an 1 to n relationship), you can't avoid this kind of query.

Cheers, Remigius.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Blobstore upload handler is Base64 encoding strings?

2010-11-13 Thread Satoshi
I wrote a test code, and verified this bug (it happens in Japanese as
well).

Here is the form:

form id='form_upload' action=$(_upload_url) method=POST
enctype=multipart/form-data
div class='dialog_field'
div class='field_name'File:/div
input type='file' name='file' /
input type='hidden' name='alt' value='main'/
/div
div class='dialog_field'
div class='field_name'Description/div
input type='text' name='desc' /
/div
/form

Satoshi


On Nov 12, 11:52 am, Ikai Lan (Google) ikai.l+gro...@google.com
wrote:
 Do you guys have any sample code? I'm testing this and seeing that the local
 dev server gives me some strange characters (I'm using Java). What does the
 form look like? How are you reading the input from the form submission?

 --
 Ikai Lan
 Developer Programs Engineer, Google App Engine
 Blogger:http://googleappengine.blogspot.com
 Reddit:http://www.reddit.com/r/appengine
 Twitter:http://twitter.com/app_engine

 On Fri, Nov 12, 2010 at 5:09 AM, msmart michael.martini...@gmail.comwrote:



  I ran into the same issue.

  Has anyone found the corresponding issue in the bug tracker (or a nice
  workaround)?

  Michael.

  On 26 Okt., 09:28, Kenneth goo...@kmacleod.ie wrote:
   This is a pretty shocking bug (or lack of documentation?) from
   Google.  There doesn't appear to be a consistent way to decode the
   post results that come from the BlobstoreUploadHandler.  There was a
   bug in the issues list for this but I can't find it.  I should put in
   another one really but there doesn't seem to be any point.

   What I do is when the user hits the submit button I send the form
   results via an ajax request and once that returns I submit the form to
   do the file upload.

   Pretty sad you have to do that and it means you're requiring
   javascript for something that really shouldn't need it.

   On Oct 25, 10:49 am, Agustin Horischnik agu...@gmail.com wrote:

Hey, no luck with this? Did you solve this at all?

On Aug 31, 12:40 pm, Agustin Horischnik agu...@gmail.com wrote:

 I think I'm having the same issue...

 I have a multi-part form posting to ablobstoreuploadhandler.
 There's four form fields:

 2 input type=file
 1 input type=text
 1 textarea

 Those map to...

 2blobstore.BlobReferenceProperty
 1 StringProperty
 1 TextProperty

 ... respectively, on my model class.

 And the problem is... when I submit an input string such as á é í ó
  ú
 and ñ, I get: IuEg6SDtIPMg+iBhbmQg8SI=, both on the StringProperty
 and TextProperty.
 At least, this is what I see on the Data viewer or when I output on
 the app.

 Any workarounds you can think of? Anybody else is having this
  problem?

 On Aug 3, 3:54 pm, ekampf eka...@gmail.com wrote:

  yep..
  It doesnt happend on the local dev server... its definately
  something
  undocumented happening on AppEngine

  On Aug 3, 10:54 am, alon alon.car...@gmail.com wrote:

   it outputs as abase64string? im guessing the post is multi-part
  post
   right?

   On Aug 3, 10:39 am, ekampf eka...@gmail.com wrote:

This happens when text fields are sent via POST and go through
  the
   Blobstoreuploadhandler.
When English text is used I get the text.
When Hebrew is used I get abase64string...

I'm not looking at the datastore dashboard. I'm looking at the
  actual
POST data (via logging)

On Aug 3, 10:18 am, alon alon.car...@gmail.com wrote:

 Does that happen everytime on theblobstoreonly api? or
  regular text -

  datastore?

 One more thing, there is a huge difference on how the text is
  being
 displayed on the datastore dashboard. are you sure its being
  saved as
base64? the pageencodingfor the production datastore browser
  is
 massed up and cant display hebrew correctly in oppose to the
  local dev
 version which has utf8encodingdisplay.

 On Jul 23, 2:09 pm, ekampf eka...@gmail.com wrote:

  I have a form with a file input and a text input field.
  When users type Hebrew text I get aBase64encoded string on
  the
  server. When typing English I get a nonBase64string.
  On the development server I get a regular Unicode string
  (what I'd
  expect)

  Cant find any mentions of this in the docs.
  What the behavior I should expect on production? Is this a
  bug?

  --
  You received this message because you are subscribed to the Google Groups
  Google App Engine group.
  To post to this group, send email to google-appeng...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine+unsubscr...@googlegroups.comgoogle-appengine%2Bunsubscrib 
  e...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine?hl=en.

-- 
You received this message because you are 

[google-appengine] Re: Blobstore upload handler is Base64 encoding strings?

2010-11-13 Thread Satoshi
I also wrote an upload code in Objective-C, explicitly specifying the
Content-Type: text/plain; charset=UTF-8,
but got the same result as HTML form sample above.

日本語 becomes 5pel5pys6Kqe

Satoshi

On Nov 13, 7:01 am, Satoshi satoshi.nakaj...@gmail.com wrote:
 I wrote a test code, and verified this bug (it happens in Japanese as
 well).

 Here is the form:

 form id='form_upload' action=$(_upload_url) method=POST
 enctype=multipart/form-data
     div class='dialog_field'
         div class='field_name'File:/div
         input type='file' name='file' /
         input type='hidden' name='alt' value='main'/
     /div
     div class='dialog_field'
         div class='field_name'Description/div
         input type='text' name='desc' /
     /div
 /form

 Satoshi

 On Nov 12, 11:52 am, Ikai Lan (Google) ikai.l+gro...@google.com
 wrote:



  Do you guys have any sample code? I'm testing this and seeing that the local
  dev server gives me some strange characters (I'm using Java). What does the
  form look like? How are you reading the input from the form submission?

  --
  Ikai Lan
  Developer Programs Engineer, Google App Engine
  Blogger:http://googleappengine.blogspot.com
  Reddit:http://www.reddit.com/r/appengine
  Twitter:http://twitter.com/app_engine

  On Fri, Nov 12, 2010 at 5:09 AM, msmart michael.martini...@gmail.comwrote:

   I ran into the same issue.

   Has anyone found the corresponding issue in the bug tracker (or a nice
   workaround)?

   Michael.

   On 26 Okt., 09:28, Kenneth goo...@kmacleod.ie wrote:
This is a pretty shocking bug (or lack of documentation?) from
Google.  There doesn't appear to be a consistent way to decode the
post results that come from the BlobstoreUploadHandler.  There was a
bug in the issues list for this but I can't find it.  I should put in
another one really but there doesn't seem to be any point.

What I do is when the user hits the submit button I send the form
results via an ajax request and once that returns I submit the form to
do the file upload.

Pretty sad you have to do that and it means you're requiring
javascript for something that really shouldn't need it.

On Oct 25, 10:49 am, Agustin Horischnik agu...@gmail.com wrote:

 Hey, no luck with this? Did you solve this at all?

 On Aug 31, 12:40 pm, Agustin Horischnik agu...@gmail.com wrote:

  I think I'm having the same issue...

  I have a multi-part form posting to ablobstoreuploadhandler.
  There's four form fields:

  2 input type=file
  1 input type=text
  1 textarea

  Those map to...

  2blobstore.BlobReferenceProperty
  1 StringProperty
  1 TextProperty

  ... respectively, on my model class.

  And the problem is... when I submit an input string such as á é í ó
   ú
  and ñ, I get: IuEg6SDtIPMg+iBhbmQg8SI=, both on the 
  StringProperty
  and TextProperty.
  At least, this is what I see on the Data viewer or when I output on
  the app.

  Any workarounds you can think of? Anybody else is having this
   problem?

  On Aug 3, 3:54 pm, ekampf eka...@gmail.com wrote:

   yep..
   It doesnt happend on the local dev server... its definately
   something
   undocumented happening on AppEngine

   On Aug 3, 10:54 am, alon alon.car...@gmail.com wrote:

it outputs as abase64string? im guessing the post is multi-part
   post
right?

On Aug 3, 10:39 am, ekampf eka...@gmail.com wrote:

 This happens when text fields are sent via POST and go through
   the
Blobstoreuploadhandler.
 When English text is used I get the text.
 When Hebrew is used I get abase64string...

 I'm not looking at the datastore dashboard. I'm looking at the
   actual
 POST data (via logging)

 On Aug 3, 10:18 am, alon alon.car...@gmail.com wrote:

  Does that happen everytime on theblobstoreonly api? or
   regular text -

   datastore?

  One more thing, there is a huge difference on how the text 
  is
   being
  displayed on the datastore dashboard. are you sure its being
   saved as
 base64? the pageencodingfor the production datastore browser
   is
  massed up and cant display hebrew correctly in oppose to the
   local dev
  version which has utf8encodingdisplay.

  On Jul 23, 2:09 pm, ekampf eka...@gmail.com wrote:

   I have a form with a file input and a text input field.
   When users type Hebrew text I get aBase64encoded string on
   the
   server. When typing English I get a nonBase64string.
   On the development server I get a regular Unicode string
   (what I'd
   expect)

   Cant find any mentions of this in the docs.
   What the behavior I should expect on production? Is this a
   bug?

   --
   You received this message because you are subscribed to the Google Groups
   Google App 

Re: [google-appengine] Re: Blobstore upload handler is Base64 encoding strings?

2010-11-13 Thread Chris Copeland
In Python the text is encoded as quoted printable (I think).

See issue 
#3761http://code.google.com/p/googleappengine/issues/detail?id=3761and
Stack
Overflow 
questionhttp://stackoverflow.com/questions/3624226/encoding-problem-in-app-engine-when-submitting-multipart-form-data-forms.


I've worked around it by decoding with quopri if the post is coming through
the blob uploader.

On Sat, Nov 13, 2010 at 9:30 AM, Satoshi satoshi.nakaj...@gmail.com wrote:

 I also wrote an upload code in Objective-C, explicitly specifying the
 Content-Type: text/plain; charset=UTF-8,
 but got the same result as HTML form sample above.

 日本語 becomes 5pel5pys6Kqe

 Satoshi

 On Nov 13, 7:01 am, Satoshi satoshi.nakaj...@gmail.com wrote:
  I wrote a test code, and verified this bug (it happens in Japanese as
  well).
 
  Here is the form:
 
  form id='form_upload' action=$(_upload_url) method=POST
  enctype=multipart/form-data
  div class='dialog_field'
  div class='field_name'File:/div
  input type='file' name='file' /
  input type='hidden' name='alt' value='main'/
  /div
  div class='dialog_field'
  div class='field_name'Description/div
  input type='text' name='desc' /
  /div
  /form
 
  Satoshi
 
  On Nov 12, 11:52 am, Ikai Lan (Google) 
  ikai.l+gro...@google.comikai.l%2bgro...@google.com
 
  wrote:
 
 
 
   Do you guys have any sample code? I'm testing this and seeing that the
 local
   dev server gives me some strange characters (I'm using Java). What does
 the
   form look like? How are you reading the input from the form submission?
 
   --
   Ikai Lan
   Developer Programs Engineer, Google App Engine
   Blogger:http://googleappengine.blogspot.com
   Reddit:http://www.reddit.com/r/appengine
   Twitter:http://twitter.com/app_engine
 
   On Fri, Nov 12, 2010 at 5:09 AM, msmart michael.martini...@gmail.com
 wrote:
 
I ran into the same issue.
 
Has anyone found the corresponding issue in the bug tracker (or a
 nice
workaround)?
 
Michael.
 
On 26 Okt., 09:28, Kenneth goo...@kmacleod.ie wrote:
 This is a pretty shocking bug (or lack of documentation?) from
 Google.  There doesn't appear to be a consistent way to decode the
 post results that come from the BlobstoreUploadHandler.  There was
 a
 bug in the issues list for this but I can't find it.  I should put
 in
 another one really but there doesn't seem to be any point.
 
 What I do is when the user hits the submit button I send the form
 results via an ajax request and once that returns I submit the form
 to
 do the file upload.
 
 Pretty sad you have to do that and it means you're requiring
 javascript for something that really shouldn't need it.
 
 On Oct 25, 10:49 am, Agustin Horischnik agu...@gmail.com wrote:
 
  Hey, no luck with this? Did you solve this at all?
 
  On Aug 31, 12:40 pm, Agustin Horischnik agu...@gmail.com
 wrote:
 
   I think I'm having the same issue...
 
   I have a multi-part form posting to ablobstoreuploadhandler.
   There's four form fields:
 
   2 input type=file
   1 input type=text
   1 textarea
 
   Those map to...
 
   2blobstore.BlobReferenceProperty
   1 StringProperty
   1 TextProperty
 
   ... respectively, on my model class.
 
   And the problem is... when I submit an input string such as á
 é í ó
ú
   and ñ, I get: IuEg6SDtIPMg+iBhbmQg8SI=, both on the
 StringProperty
   and TextProperty.
   At least, this is what I see on the Data viewer or when I
 output on
   the app.
 
   Any workarounds you can think of? Anybody else is having this
problem?
 
   On Aug 3, 3:54 pm, ekampf eka...@gmail.com wrote:
 
yep..
It doesnt happend on the local dev server... its definately
something
undocumented happening on AppEngine
 
On Aug 3, 10:54 am, alon alon.car...@gmail.com wrote:
 
 it outputs as abase64string? im guessing the post is
 multi-part
post
 right?
 
 On Aug 3, 10:39 am, ekampf eka...@gmail.com wrote:
 
  This happens when text fields are sent via POST and go
 through
the
 Blobstoreuploadhandler.
  When English text is used I get the text.
  When Hebrew is used I get abase64string...
 
  I'm not looking at the datastore dashboard. I'm looking
 at the
actual
  POST data (via logging)
 
  On Aug 3, 10:18 am, alon alon.car...@gmail.com wrote:
 
   Does that happen everytime on theblobstoreonly api? or
regular text -
 
datastore?
 
   One more thing, there is a huge difference on how the
 text is
being
   displayed on the datastore dashboard. are you sure its
 being
saved as
  base64? the pageencodingfor the production datastore
 browser
is
   massed up and cant display hebrew correctly in oppose
 to the
local dev
   version which 

[google-appengine] Re: A huge amount of DB timeout in the last 10 hours

2010-11-13 Thread Alexander W.
My app had 10.000 requests today (so far) and I got 30
DeadlineExceededErrors. They all occured when saving an object to the
database via the model .put() method. I hope they'll fix the
DeadlineExceededErrors problem in the near future, because it's the
only thing that bothers me. Apart from that App Engine is an amazing
technology.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Blobstore upload is failing with mysterious signature verification failed redirect

2010-11-13 Thread Michael Bayne
I just added upload support to my app using the BlobStore. Everything
works peachily in the dev environment, but now that I'm trying to use
the functionality in production, uploads are resulting in a redirect
to http://www.google.com/search?q=signature+verification+failed; which
is rather mysterious to say the least.

Not that those results are visible in my app, since I am doing the
uploading via GWT, but when I look at the results manually, they don't
yield anything particularly informative.

The only thing I've been able to find on the Interwebs about this at
all is one guy's tweet saying:

If you find your AppEngine app on upload randomly redirecting people to
a search for signature verification failed, that's a blobstore bug

This was from a few days ago. No indication of any workarounds, or if
perhaps this might get fixed. Is the blobstore just broken right now?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: A huge amount of DB timeout in the last 10 hours

2010-11-13 Thread Francois Masurel
Yep, got a few DB timeouts too.

It's rather unusual for me.

On Nov 13, 2:56 am, Raymond C. windz...@gmail.com wrote:
 My app is having a very large amount of DB timeout in the last 10
 hours (2% of all request).  Anyone else having the same problem?

 Yet the status page says nothing...

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: Can Java and Python coexist in the same app?

2010-11-13 Thread Jorge Guberte
Thank you!

On 12 nov, 17:34, Alexander Mills alexander.mi...@psycle.com wrote:
 I am currently doing this - as long as you reflect the Python model in
 the Java, it will be fine.

 Version 1 of my app is Java, Version 2 is Python - I have had issues
 with the Java model being slightly different to the Python model and
 overwriting (then Python can't read the updated model)

 Typically, when you have two versions, the first (or non-default)
 version is only accessible via 1.latest.appid.appspot.com

 Hope this helps,

 Alexander

 On Nov 12, 2:55 pm, Jorge Guberte jorgegube...@gmail.com wrote:







  I need to have a Java instance fetching data directly from the
  Python's instance datastore. I don't know if that's possible at all.
  Is the datastore transparent/unique, or each instance (if they can
  indeed coexist) has its separate datastore? Suming it up: how can a
  Java app fetch data from the datastore of a Python app, and vice-versa?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Re: Only one property per query may have inequality filters?

2010-11-13 Thread Robert Kluin
Interesting results.  Thanks for the info.



Robert







On Sat, Nov 13, 2010 at 09:11, Remigius remigius.stal...@gmail.com wrote:
 I have performed some experiments. I generated test data on which an
 IN query was performed. The test data consists of the following:

 o an optional parent for all further test entities (i.e. the tests
 were performed with and without common parent)
 o a set of n referred entities, n taking the values 30, 50, 100, 500
 o a set of n referrer entities, each having a field that contains
 the key of one of the referred entities

 For each experiment, there were two (no parent) resp. three (with
 parent) queries, as follows (I hope the code can still be read after
 reformatting in the post):

  public static final String parentEntityKind = TestInQueryParent;
  public static final String referredEntityKind =
 TestInQueryReferred;
  public static final String referrerEntityKind =
 TestInQueryReferrer;
  public static final String referrerField = ref;

  private void queryData(StringBuilder out) {
    DatastoreServiceConfig config =
 DatastoreServiceConfig.Builder.withDefaults();
    DatastoreService datastoreService =
 DatastoreServiceFactory.getDatastoreService(config);

    if(withParent) {
      Query parentQuery = new Query(parentEntityKind);
      Entity parent =
 datastoreService.prepare(parentQuery).asSingleEntity();
      out.append(fetched parent);
    }

    Query referredQuery = withParent ? new Query(referredEntityKind,
 parent.getKey()) : new Query(referredEntityKind);
    referredQuery.setKeysOnly();
    long startTime = new Date().getTime();
    IterableEntity referreds =
 datastoreService.prepare(referredQuery).asIterable();
    ArrayListEntity referredList = new ArrayListEntity();
    for(Entity referred : referreds) {
      referredList.add(referred);
    }
    long endTime = new Date().getTime();
    out.append(brfetched );
    out.append(referredList.size());
    out.append( referred entities in );
    out.append(Log.timeDiff(startTime, endTime));

    ListKey keyList = new ArrayListKey();
    for (Entity entity : referredList) {
      keyList.add(entity.getKey());
    }
    Query inQuery = new Query(referrerEntityKind);
    inQuery.addFilter(referrerField, Query.FilterOperator.IN,
 keyList);
    startTime = new Date().getTime();
    ListEntity result =
 datastoreService.prepare(inQuery).asList(FetchOptions.Builder.withDefaults());
    endTime = new Date().getTime();
    out.append(brfetched );
    out.append(result.size());
    out.append( referrer entities in );
    out.append(Log.timeDiff(startTime, endTime));
  }

 Log.timeDiff(startTime, endTime) computes the difference between start
 time and end time and converts it to a String.

 The results can be found here:

 https://spreadsheets.google.com/ccc?
 key=0AvB6ADVFJKfSdHRWYjhNUWVwLWJDX2lkWEdSVnpNREEhl=en

 I have enabled appstats, but it is not feasible to add a screen shot
 of the experiment with 500 entity pairs here. However, the picture is
 very similar to the Python one (except for the lack of a limit of 30,
 of course). It looks again as if the IN query is split into 500
 individual queries that are executed sequentially, each of which takes
 about 2-6ms elapse time, resulting in an RPC total of 2683ms (11305ms
 api) and a Grand Total of 3192ms (11305ms cpu+api), which means that
 it's not only possible to execute such queries, but moreover they
 execute in a reasonnable amount of time. Of course, in this particular
 case it would be easier to query the entities directly using a
 get(ListKey) call, but if you have multiple referrers to query (like
 an 1 to n relationship), you can't avoid this kind of query.

 Cheers, Remigius.

 --
 You received this message because you are subscribed to the Google Groups 
 Google App Engine group.
 To post to this group, send email to google-appeng...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Re: Can Java and Python coexist in the same app?

2010-11-13 Thread Pedro Ferreira
Jorge,

obrigado pelo comprometimento!

Agradeço memso

Abraço

Boa noite!


Em 13-11-2010 23:29, Jorge Guberte escreveu:
 Thank you!

 On 12 nov, 17:34, Alexander Mills alexander.mi...@psycle.com wrote:
 I am currently doing this - as long as you reflect the Python model in
 the Java, it will be fine.

 Version 1 of my app is Java, Version 2 is Python - I have had issues
 with the Java model being slightly different to the Python model and
 overwriting (then Python can't read the updated model)

 Typically, when you have two versions, the first (or non-default)
 version is only accessible via 1.latest.appid.appspot.com

 Hope this helps,

 Alexander

 On Nov 12, 2:55 pm, Jorge Guberte jorgegube...@gmail.com wrote:







 I need to have a Java instance fetching data directly from the
 Python's instance datastore. I don't know if that's possible at all.
 Is the datastore transparent/unique, or each instance (if they can
 indeed coexist) has its separate datastore? Suming it up: how can a
 Java app fetch data from the datastore of a Python app, and vice-versa?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: How do you use the development server for testing

2010-11-13 Thread Zeynel
On Nov 13, 7:10 am, Wim den Ouden wdenou...@gmail.com wrote:
 why not simple results_type = results

Yes, thanks, this

self.response.out.write(C_RESULT: %s  %
(C_RESULT))

returns

C_RESULT: [__main__.Rep object at 0x044F0630]

Is there a way to print the contents of this object without iterating?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.