Re: [appengine-java] Re: Why should app startup times be a problem.

2010-03-31 Thread Jeff Schnitzer
On Wed, Mar 31, 2010 at 6:41 PM, jd  wrote:
>
> On Apr 1, 3:14 am, Jeff Schnitzer  wrote:
>> What does Twig do when someone issues a type-less query?
>>
>> datastore.find().addFilter("color", EQUAL, "green"). returnResultsNow()
>
> The expression above is actually not possible to enter using the
> fluent commands.  You can only set a filter on the interface that is
> returned from calling FindCommand.type(Class)
>
> It is also illegal according to the datastore docs for a Query with no
> kind:
>
> "Currently the only operations supported on a kind-less query are
> filter by __key__, ancestor, and order by __key__ ascending"

In other words, Twig cannot perform the simple query:

Iterable foo = ofy.query().ancestor(yourobject);

If you ever want to support something like this, you will need a
registration process.

If you ever want to support true polymorphic queries, you will need a
registration process.

Don't claim this short-sightedness as a feature.

Jeff

-- 
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: how to build same entity group

2010-03-31 Thread dreamy
now i have done it  by  part transaction.

use case: Person  buy three Telephone

update  Person property(and other sub class property)  ---use
transaction
update  three Telephone.person_id=person_id. not use
transaction

thanks to all

-- 
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: Why should app startup times be a problem.

2010-03-31 Thread jd


On Apr 1, 3:14 am, Jeff Schnitzer  wrote:
> What does Twig do when someone issues a type-less query?
>
> datastore.find().addFilter("color", EQUAL, "green"). returnResultsNow()

The expression above is actually not possible to enter using the
fluent commands.  You can only set a filter on the interface that is
returned from calling FindCommand.type(Class)

It is also illegal according to the datastore docs for a Query with no
kind:

"Currently the only operations supported on a kind-less query are
filter by __key__, ancestor, and order by __key__ ascending"

There are two reasons find() takes no class argument: to distinguish
the fluent command from the convenience methods.  Secondly, to allow
typeless ancestor or key range queries to be added in the future
without expanding the basic API.  In fact originally there was a
typeless find method that took a low-level query as a parameter - but
it wasn't useful enough to justify keeping.

John

-- 
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.



Re: [appengine-java] JDO Transactions in different entity groups

2010-03-31 Thread bimbo jones
Thanks,

I was doing some unnecessary transactions.

2010/3/31 Ikai L (Google) 

> Why not just store these all in the User entity? Then you don't have to
> worry about multiple retrievals and such. If you're concerned about indexes
> being created on null values, you could always just use the low-level API
> (if you are using Java) and store only the fields you need.
>
> Off topic because this is a style issue, but these are poor names for
> classes. It's not a relational database so "table" is inaccurate. Even if
> you were building objects to map to an RDBMS for persistence, a single
> instance of your object is not a table. It'd be a "FacebookAccount" or a
> "TwitterAccount".
>
>
> On Wed, Mar 31, 2010 at 7:49 AM, BimboJones wrote:
>
>> Hi,
>>
>> I have the following setup:
>>
>> FacebookTable {
>> String facebookid;
>> String globalid;
>> }
>>
>> TwitterTable {
>> String twitterid;
>> String globalid;
>> }
>>
>> GlobalUser{
>> String generatedKey;
>> List socialids;
>> List infos;
>> ..
>> }
>>
>> Suppose i want to create a user through Facebook i get a FacebookTable
>> that is connected to a GlobalUser, then i want to add a previous
>> Twitter account(with a GlobalUser) to that Facebook+GlobalUser, so i
>> have to merge the Informations and update the globalids.
>> I can't do that because these arent from the same entitygroup..
>> Any suggestions?
>>
>> the login process is like so:
>> -> User authenticates through Facebook -> fetch globalid from
>> FacebookTable -> fetch GlobalUser -> return session.
>>
>> --
>> 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.
>>
>>
>
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> http://googleappengine.blogspot.com | http://twitter.com/app_engine
>
> --
> 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.
>

-- 
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.



Re: [appengine-java] Re: GAE Plugin not working.

2010-03-31 Thread Keith Platfoot
Dennis,

Are you running Eclipse with Administrator privileges?  We've had other
users report they had to do so in order to successfully install the Google
Plugin for Eclipse.

Keith

On Tue, Mar 30, 2010 at 10:28 PM, dennisM  wrote:

> I can't get Appengine for Java 1.3.2 Eclipse plugin for Galileo to
> install properly on Windows 7. I get a variety of error messages about
> jars already being there,  I'll post more specific info about the
> errors shortly, but thought this might be familiar to others.
>
> Is there something special I need to do to get the plugin to work on
> Windows 7?
>
> On Mar 5, 2:33 pm, Ahmad  wrote:
> > I am also unable to install  gae plugin for eclipse 3.5 --
> > gelilio , on windows7
>
> --
> 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.
>
>

-- 
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.



Re: [appengine-java] Re: Errors after updating to 1.3.2

2010-03-31 Thread Max Ross (Google)
The method that can't be found was added in 1.3.2 so, as John says, this is
almost certainly a classpath problem.  My guess is that you have an old
version of appengine-api.jar on your classpath somewhere.

On Tue, Mar 30, 2010 at 8:26 PM, Featheast Lee wrote:

> I tried to do what you mentioned here, but seems no lucky.
>
> On Mar 31, 1:21 pm, John Patterson  wrote:
> > Looks like you have a class path problem.  Do you have different
> > versions of the app engine jars in your WEB-INF/lib dir?
> >
> > On 31 Mar 2010, at 09:18, Featheast Lee wrote:
> >
> >
> >
> > > I have updated my app engine to 1.3.2 a couple of days ago, and it
> > > runs well on the cloud. Today, when I trying to some testing on my
> > > local machine, an exception throws out whenever I try to use the PMF
> > > code:
> > >   PersistenceManager pm = PMF.get().getPersistenceManager();
> >
> > > Basically the exceptions stacks are:
> > >   Internal Server Error (500) - The server encountered an
> > > unexpected condition which prevented it from fulfilling the request
> > >   
> > >   Caused by: java.lang.NoSuchMethodError:
> > > com
> > > .google
> > > .appengine
> > > .api.datastore.DatastoreServiceFactory.getDatastoreService(Lcom/
> > > google/appengine/api/datastore/DatastoreServiceConfig;)Lcom/google/
> > > appengine/api/datastore/DatastoreService;
> >
> > > At first, I thought it is the problem of my newly added code, however,
> > > after several attempts, all failed no matter what change i made.
> > > Then I thought it might be the issue of SDK, after I switched back my
> > > app engine to 1.3.1, it works perfect.
> >
> > > But how can the same code runs well in the cloud, but failed in my
> > > local machine with different versions?
> >
> > > Anyone can give me some idea? Thanks.
> >
> > > PS: my test code is a pretty simple client code generate a GET method
> > > to the app engine project, and a datastore query will be called, the
> > > exception happens when the PMF is called.
> >
> > > --
> > > 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-java@googlegroups.com
> > > .
> > > To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> > > .
> > > For more options, visit this group athttp://
> 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.
>
>

-- 
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.



Re: [appengine-java] Re: Why should app startup times be a problem.

2010-03-31 Thread Jeff Schnitzer
On Wed, Mar 31, 2010 at 6:36 AM, John Patterson  wrote:
>
>  Unlike some of the other frameworks there is no "registration" process for
> your data model classes - each class is analyzed the first time it is used
> per server instance and the meta-data is cached for the duration of the
> instance.

What does Twig do when someone issues a type-less query?

datastore.find().addFilter("color", EQUAL, "green"). returnResultsNow()

Jeff

-- 
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: Why should app startup times be a problem.

2010-03-31 Thread Sarath
Blake,

The versions I have are primarily bare. And only used to measure bare
minimum *cold start up time*. The benchmark is ONLY for startup-time
measurement. And to show that the more (and heavy) libraries you add,
The more is the cold startup time. And THAT could be delt with other
technical solutions than to keep instances warm. That way all
container resources will be consumed sooner or later. Hence the very
few Java/Jee hosting providers.

I understand some code optimization need to be done on the application
to get better performance. No disagreement on that.My post only goes
to counter the aspect of keeping *warm instances*. As pointed out by
others, it  just is against the concept of *cloud*.

-Sarath.

On Mar 31, 8:05 pm, Blake  wrote:
> Cool post Sarath, thanks for sharing.
>
> I'm also scrambling to get better performance, but I'm getting nowhere
> near as high CPU times as you are.  What types of queries are you
> doing?  I've restructured my app so that all of my queries are by
> keys.  I've denormalized, serialized child objects into parents when I
> didn't need to query the children.
>
> I'm not going to assume I know what your app's doing, and starting
> handing out advice on ignorance, but we all need to accept that this
> isn't a traditional relational data store.  We need to do more with
> our write operations in preparation for specific read operations.
> Trade-offs need to be made with every request.  Even with 100 views
> per day, our app is basically in a system that's getting pummeled, so
> we need to code as if we're getting 1million pageviews per day.
>
> There's all kinds of tricks you can do (again, assuming you're not
> doing them already).  If the CSS is dynamically generated, cache it
> and/or store it as a text field in a table.  Use AJAX to give the
> perception of a quick-loading app by putting as much into the html
> files as you can, with spinners on the client as the data is loaded
> asynchronously.
>
> That extra work will even save you money once you get above the free
> quota.
>
> What are you doing in those requests that can't be cleaned up for
> better App Engine performance?
>
> - a side note to this thread, not necessarily Sarath -
> I agree with everyone on what "would be nice".  I'd love to make a
> fully relational database that handles ad hoc queries and no awareness
> of the underlying framework, but the system is what it is, so let's
> embrace it and squeeze every cpu clock cycle and millisecond of wait
> time out of it.  If we can't do that, then why don't we just move to
> LAMP hosts for $10/month?
>
> On Mar 31, 10:19 am, Sarath  wrote:
>
> > Here is some more insight.http://bit.ly/d2lOnv
>
> > Looks like I was way off on numbers for Grails. Like I said, We should
> > think less about work arounds, and frameworks-on-diet (not that they
> > dont work) and rather look at an out of box solution.
>
> > -Sarath.
>
> > On Mar 31, 2:29 am, Sarath  wrote:
>
> > > This is getting really interesting. I have been follwoing this post
> > > from a couple of days.
>
> > > I managed to see What exactly is ammounting to delayed startup.
>
> > > Some have suggested to remove spring/di/jpa/jdo. While this is true,
> > > it solves much of the problem - These are the reason why I would
> > > choose java over python.
>
> > > I may be wrong here - But I tried this experiment.
>
> > > I had four versions of a simple java app.
>
> > > one with grails
> > > one with spring (full di - context: scan etc)
> > > one with spring (lazyloading, )
> > > one with slim1.0
> > > one with NOTHING (only commons logging)
>
> > > I realised there are two parts to the load time.
>
> > > The load time from google.
> > > The load time from the libraries.
>
> > > I believe from a developers perspective the second one should NOT be
> > > considered for optimization.
>
> > > For #1 a recommendation is warm startup. While in theory it might
> > > sound good, the elasticity and managment will take it back to EC2 type
> > > like baz suggests.
>
> > > For my experiment the results are like this
>
> > > Version                                                                 - 
> > > Google Warmup - Framework Warmup
> > > with grails                                                               
> > >       -       ~9+ secs        -       ~4secs
> > > with spring (full di - context: scan etc)                               - 
> > >       ~4+ secs        -       ~3 secs
> > > with spring (lazyloading, )                                             - 
> > >       ~4 secs -       ~2 secs
> > > with slim1.0                                                            - 
> > >       ~2-3 secs       -       <1 secs
> > > with NOTHING (only commons logging)                     -       ~2 secs - 
> > >       <1 sec
>
> > > Now I dont know what exactly Google spins down - I assume just the
> > > apps - not the whole container. In which case, There is a lot of load
> > > while loading the libraries. I can only guess, 

Re: [appengine-java] JDO Transactions in different entity groups

2010-03-31 Thread Ikai L (Google)
Why not just store these all in the User entity? Then you don't have to
worry about multiple retrievals and such. If you're concerned about indexes
being created on null values, you could always just use the low-level API
(if you are using Java) and store only the fields you need.

Off topic because this is a style issue, but these are poor names for
classes. It's not a relational database so "table" is inaccurate. Even if
you were building objects to map to an RDBMS for persistence, a single
instance of your object is not a table. It'd be a "FacebookAccount" or a
"TwitterAccount".

On Wed, Mar 31, 2010 at 7:49 AM, BimboJones  wrote:

> Hi,
>
> I have the following setup:
>
> FacebookTable {
> String facebookid;
> String globalid;
> }
>
> TwitterTable {
> String twitterid;
> String globalid;
> }
>
> GlobalUser{
> String generatedKey;
> List socialids;
> List infos;
> ..
> }
>
> Suppose i want to create a user through Facebook i get a FacebookTable
> that is connected to a GlobalUser, then i want to add a previous
> Twitter account(with a GlobalUser) to that Facebook+GlobalUser, so i
> have to merge the Informations and update the globalids.
> I can't do that because these arent from the same entitygroup..
> Any suggestions?
>
> the login process is like so:
> -> User authenticates through Facebook -> fetch globalid from
> FacebookTable -> fetch GlobalUser -> return session.
>
> --
> 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.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
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: news on remote_api for java ?

2010-03-31 Thread Lorenzo Dee
I tried using the said configuration in my web.xml. I ran appcfg.py
download_data --url=http://localhost/remote_api ... But I couldn't get
it to work. I'm getting an "Authentication Failed" error:

error: [Errno 54] Connection reset by peer
[INFO] Authentication Failed

To further isolate things, I tested it with the sample Guestbook
application that comes with the SDK for Java. I added the entry in
web.xml. I tested using a browser, it redirects me to a login page.
So, I'm guessing the web.xml configuration works. I then tried running
appcfg.py download_data again. But I'm still getting the same error. I
don't think it's an authentication error (since I'm only running on
localhost).

I also added app.yaml and the necessary Python classes as exporters.

What's interesting is that I can download data from the Guestbook
application (written in Python) that comes with the SDK for Python.
Sorry, I'm not a Python expert. So, I'm not sure if appcfg.py
download_data works with a Java-based application (as indicated in the
documentation).

Any updates or documentation on this would be greatly appreciated.

Cheers


On Feb 25, 8:37 am, "Ikai L (Google)"  wrote:
> You should be able to connect this:
>
> 
> 
>   
>   
>     remoteapi
>     
> com.google.apphosting.utils.remoteapi.RemoteApiServlet
>   
>   
>     remoteapi
>     /remote_api
>   
>   
>     
>       remoteapi
>       /remote_api
>     
>     
>       admin
>     
>   
> 
>
> I'll dig for some sample code for the Java bulkloader. We're working
> on official docs.
>
>
>
> On Tue, Feb 9, 2010 at 1:22 AM, emerix  wrote:
> > Hi,
> > Does anybody have some news on the remote_api for java ? It would be
> > great to be able to use our JDO/JPA objects to interact with the
> > datastore without having to upload a version to appengine !
>
> > Thanx :)
> > emerix
>
> > --
> > 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.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App 
> Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
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: GAE Plugin not working.

2010-03-31 Thread dennisM
I can't get Appengine for Java 1.3.2 Eclipse plugin for Galileo to
install properly on Windows 7. I get a variety of error messages about
jars already being there,  I'll post more specific info about the
errors shortly, but thought this might be familiar to others.

Is there something special I need to do to get the plugin to work on
Windows 7?

On Mar 5, 2:33 pm, Ahmad  wrote:
> I am also unable to install  gae plugin for eclipse 3.5 --
> gelilio , on windows7

-- 
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] Discussion on will-it-play-in-app-engine

2010-03-31 Thread Haroon Idrees
Please Help
I want to test JSF 2.0 over google Appengine ,I followed all
instruction given at
https://sites.google.com/a/wildstartech.com/adventures-in-java/Java-Platform-Enterprise-Edition/JavaServer-Faces/sun-javaserver-faces-reference-implementation/configuring-jsf-20-to-run-on-the-google-appengine

But still getting this error


java.lang.NoClassDefFoundError: javax.naming.InitialContext is a
restricted class. Please see the Google  App Engine developer's guide
for

This change is only using 1.3.2 latest  sdk on ubuntu


-- 
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] JDO Transactions in different entity groups

2010-03-31 Thread BimboJones
Hi,

I have the following setup:

FacebookTable {
String facebookid;
String globalid;
}

TwitterTable {
String twitterid;
String globalid;
}

GlobalUser{
String generatedKey;
List socialids;
List infos;
..
}

Suppose i want to create a user through Facebook i get a FacebookTable
that is connected to a GlobalUser, then i want to add a previous
Twitter account(with a GlobalUser) to that Facebook+GlobalUser, so i
have to merge the Informations and update the globalids.
I can't do that because these arent from the same entitygroup..
Any suggestions?

the login process is like so:
-> User authenticates through Facebook -> fetch globalid from
FacebookTable -> fetch GlobalUser -> return session.

-- 
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.



Re: [appengine-java] Getting JDOObjectNotFoundException when trying to retrieve Child Object

2010-03-31 Thread Raymond Ling
You can not retrieve Child Object directly via Id with JDO.

GAE datastore keep a unique
keyfor
every storage object. For root object the key should be like
ObjectClassSimpleName#1 , while for child object the key would be
ParentObjectClassSimpleName#1/ChildObjectClassSimpleName#2 . (#1 and #2 is
the Id of the Object)

When using JDO getObjectById, as my understanding, GAE will create a key (by
the class kind and id you passed), and retrieve the Object via this key. So
your code will be equal to:
Child child= pm.getObjectById(Child.class, childId);
=>
Key childKey = KeyFactory.createKey(Child.class.getSimpleName(), childId);
// retrieve Entity via childKey, and convert it to Child Object

Above code will not work, as the real key of the child should be created via
this:
Key parentKey = KeyFactory.createKey(Parent.class, parentId);
Key realChildKey = KeyFactory.createKey(parentKey, Child.class, childId);
// retrieve Entity via realChildKey, and convert it to Child Object

So, if decided to use
owned-relationship,
child object should be get by it's parent key combined with child key. Other
two solution for this issue:
1. Don't use owned-relationship, use Key reference instead. See
unowned-relationship
.
2. Query the child object by user defined property instead of Key or Id(
Id/Name is not key exactly).

I have been annoyed by this problem, too. It seems not a good idea to use
owned-relationship every place, but owned-relationship is high performance
than unowned-relationship. So there is a balance we should consider.


On Tue, Mar 30, 2010 at 4:56 PM, Emmanuel wrote:

> Hi,
>
> I'm fairly new to JDO and App Engine and actually facing an odd
> problem.
> I'm trying to retrieve a child object with the method
> pm.getObjectById(Child.class, Id) but this method throws me a
> JDOObjectNotFoundException. I'm sure that the child object exists and
> in facts, when I retrieve the parent object with the same method
> before calling it for the child object, everything works fine.
> It seems like I'm missing something so here is my code :
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Parent{
>
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Key key;
>
>@Persistent
>private String title;
>
>@Persistent(mappedBy="parent", defaultFetchGroup="true")
>private List childs;
>
>
>public Parent(String title, List childs) {
>super();
>this.title = title;
>this.childs = childs;
>this.configuration = configuration;
>this.utilisateur = utilisateur;
>this.commentaires = commentaires;
>}
> }
>
>
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Child{
>
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Key key;
>
>@Persistent
>private Parent parent;
>
>@Persistent
>private String title;
>
>@Persistent
>private String content;
>
>
>
>public Bloc(String title, String content) {
>super();
>this.title = title;
>this.content = content;
>}
>
> }
>
> And my code for getting the object :
>
> PersistenceManager pm = PMF.get().getPersistenceManager();
> Transaction tx = pm.currentTransaction();
> try{
>tx.begin();
>// If I add a line here : Parent parent =
> pm.getObjectById(Parent.class, parentId); the code works.
>Child child= pm.getObjectById(Child.class, childId); // childId is a
> long
>
>   //Code making changes to child object but it doesn't get that
> far...
>
>tx.commit();
> }
> finally{
>if(tx.isActive())
>tx.rollback();
> }
> pm.close();
>
> So here is my problem. Hope someone can help me ^^.
>
> --
> 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.
>
>


-- 
Best Regards,
>From Raymond Ling

-- 
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-ap

Re: [appengine-java] Re: App Engine SDK 1.3.2 is out!

2010-03-31 Thread Ikai L (Google)
Yep, it's the Java docs that say "exclusive". This could just be a
documentation error. We're sorting it out.

On Wed, Mar 31, 2010 at 5:18 AM, jacek.ambroziak
wrote:

> And in the Java documentation the last index argument is EXCLUSIVE
> as is standard in Java (so that end - start = length)(and so that the
> previous end can
> become start in a loop)
>
> On Mar 31, 12:34 am, Robin B  wrote:
> > The docs do mention the index values are inclusive:
> >
> > http://code.google.com/appengine/docs/python/blobstore/functions.html
> >
> > "Byte indexes are inclusive, with the first byte having an index of 0.
> > For example, a start_index of 9 and an end_index of 19 will return up
> > to 11 bytes, starting from the 10th byte (index 9) in the value."
> >
> > Robin
> >
> > On Mar 30, 5:21 pm, Ikai Lan  wrote:
> >
> >
> >
> > > I've reproduced the off-by-one error. Thanks for bringing this up.
> >
> > > On Mar 27, 8:32 am, "jacek.ambroziak" 
> > > wrote:
> >
> > > > fetchData is very useful. At the moment its implementation seems to
> > > > suffer from an off-by-one bug.
> > > > For instance, fetchData(key, 0, 1024) returns an array of length 1025
> > > > and
> > > > blobstoreService.fetchData(blobKey, 0,
> > > > BlobstoreService.MAX_BLOB_FETCH_SIZE)
> > > > will, I guess, attempt to read one byte too many and it fails with
> >
> > > >   com.google.appengine.api.blobstore.BlobstoreFailureException: An
> > > > unexpected error occurred.
> >
> > > > On Mar 25, 8:48 pm, "Ikai L (Google)"  wrote:
> >
> > > > > Check it out!
> >
> > > > >
> http://googleappengine.blogspot.com/2010/03/app-engine-sdk-132-releas...
> >
> > > > > Blog post:
> >
> > > > > App Engine SDK 1.3.2
> > > > > Released<
> http://googleappengine.blogspot.com/2010/03/app-engine-sdk-132-releas...>
> >
> > > > > Today we are excited to announce the release of version 1.3.2 of
> the App
> > > > > Engine SDK for both the Java and Python runtimes. 1.3.2 includes a
> number of
> > > > > changes and bug fixes.
> >
> > > > > For this release, we have concentrated on removing a number of
> limitations
> > > > > that have been affecting developers:
> >
> > > > >- Blobstore API - A new method
> > > > > (fetch_data<
> http://code.google.com/appengine/docs/python/blobstore/functions.html>
> > > > > for
> > > > >Python, fetchData<
> http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...>
> > > > > for
> > > > >Java) allows your application to request the contents of a Blob
> from within
> > > > >your application’s code.
> > > > >- URLFetch API - We’ve expanded the number of ports you can
> access with
> > > > >the URLFetch API. You can now access ports 80-90, 440-450, and
> 1024-65535.
> > > > >- Mail API - We’ve expanded the allowed mail attachments to
> include
> > > > >common document extensions including .doc, .ppt, and .xls.
> > > > >- Task Queue API - We’ve increased the maximum total Task Queue
> refill
> > > > >rate to 50 per second.
> >
> > > > > We’re also happy to announce, based on your feedback, a new Denial
> of
> > > > > Service (DoS) blocking system in App Engine. This system allows you
> to
> > > > > blacklist specific IP addresses from accessing your application,
> and to
> > > > > prevent them from costing your application money or eating up your
> quota.
> > > > > You can also view the top IPs that have accessed your application
> in the
> > > > > Admin Console, to help you figure out what IPs you may want to
> block. More
> > > > > information on this feature is available for
> > > > > Python<
> http://code.google.com/appengine/docs/python/config/dos.html>
> > > > > and Java <
> http://code.google.com/appengine/docs/java/config/dos.html>.
> >
> > > > > There’s a lot of other changes and fixes in this release, including
> a new
> > > > > Java version of the Appstats profiling tool, so read the release
> notes (
> > > > > Python <
> http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes>,
> > > > > Java<
> http://code.google.com/p/googleappengine/wiki/SdkForJavaReleaseNotes>)
> > > > > for a complete list of changes and download the new versions of the
> > > > > SDK
> > > > > .
> >
> > > > > Release Notes:
> >
> > > > > Version 1.3.2 - March 25, 2010
> >
> > > > >- New API to read the contents of uploaded Blobs (fetch_data)
> > > > >-http://code.google.com/p/googleappengine/issues/detail?id=2536
> >
> > > > >- URLFetch now supports accessing ports 80-90, 440-450, and
> 1024-65535
> > > > >- Mail API now allows common document formats as attachments
> > > > >   -
> http://code.google.com/p/googleappengine/issues/detail?id=494
> > > > >- The Task Queue API now supports adding multiple tasks in a
> single call
> > > > >to Queue.add()
> > > > >- Fixed charset handling for inbound emails
> > > > >   -
> http://code.google.com/p/googleappengine/issues/detail?id=2326
> > > > >- Fixed issue with compositi

[appengine-java] Re: App Engine Beginner + JDO beginner... Strange issue with Query

2010-03-31 Thread Jake
Hey Guit,

Could you also post the data object class code (Espace.class)?

In the meantime, you can also try some debugging alternatives with
http://www.datanucleus.org/products/accessplatform_1_0/jdo/jdoql.html
as your guide.

Jake

On Mar 30, 6:36 pm, Guit  wrote:
> Anybody ? Someone look at my class and say to me ot should work but it
> doesn t and i habe still no ide why ... Please :)
> On 30 mar, 00:09, Guit  wrote:
>
> > Hi everybody,
> > I am trying to build my application and i am facing a very strange
> > issue : here is the code :
> > PersistenceManager pm=PMF.get().getPersistenceManager();
>
> >                         Query query=pm.newQuery(Espace.class);
> >                         //query.setFilter("nom == paramAuthor");
> >                         //query.declareParameters("java.lang.String 
> > paramAuthor");
> >                         List results ;
> >                         results=(List) query.execute();//"_66");
> >                         for (int i=0;i >                                 Espace es=results.get(i);
> >                                 System.out.println(es.getNom());
> >                         }
> >                         return results;
> > When i run it i obtain a long list of name :
> > ...
> > _65
> > _66
> > _67
> > ...
>
> > When I remove comment and execute the query , i have no result...
> > I really don't understand why...
> > If you have an idea... it would be very nice to help me :)
> > Guit

-- 
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.



Re: [appengine-java] Re: AuthSub InvalidToken problem

2010-03-31 Thread m seleron
Hi,

I made a simple sample.

Please try.
I hope I can be of some help to you.

thanks.


2010/3/31 nicanor.babula :
> Hmm? No idea? ;)
> Thanks in advance.
>
> On Mar 30, 10:06 am, "nicanor.babula" 
> wrote:
>> That's all the code that deals with google services in my whole
>> application. The exception is raised on the following instruction:
>> [code]
>> CalendarEventFeed resultFeed = calendarService.query(myQuery,
>> CalendarEventFeed.class);
>> [/code]
>>
>> What about the environment? You are saying that I might have included
>> jars that could interfere with auth sub? Are there any known
>> conflictual libraries? I have simply included all the jars shipped
>> with the gdata-samples package.
>>
>> On Mar 30, 4:51 am, seleronm  wrote:
>>
>> > Hi,
>>
>> > I was not able to have them reproduce behavior though I tried a
>> > little.
>> > (It was possible to execute it normally).
>>
>> > Can post do you the source code further?
>> > I want to confirm behavior.
>>
>> > Or, the environment might be a cause.
>>
>> > thank.
>>
>> > > Come on!
>> > > Anyone, anything?
>>
>> > > Thanks.
>>
>> > > On Mar 26, 12:54 pm, "nicanor.babula" 
>> > > wrote:
>>
>> > > > Hi all,
>>
>> > > > I am facing a strange problem in with my app in GAE and I can't seem
>> > > > to figure it up by myself, so I hope you'll help me.. Here we are:
>>
>> > > > I do :
>>
>> > > > [code]
>> > > > String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, 
>> > > > "http://www.google.com/calendar/feeds/default/private/full";, false, 
>> > > > true);
>> > > > response.sendRedirect(authSubUrl);
>> > > > [/code]
>>
>> > > > in my servlet in order to get an auth subtoken. And the servlet at
>> > > > nextUrl does:
>> > > > [code]
>> > > > String oneTimeUseToken =
>> > > > AuthSubUtil.getTokenFromReply(request.getQueryString());
>> > > > if(oneTimeUseToken != null){
>> > > >   String sessionToken =
>> > > > AuthSubUtil.exchangeForSessionToken(oneTimeUseToken, null);
>> > > >   // persist the sessiontoken}
>>
>> > > > // redirect to the page using google services
>> > > > [/code]
>> > > > in order to retrieve and persist the sessiontokenalong with other
>> > > > user information.
>>
>> > > > The problem is that when later I do:
>> > > > [code]
>> > > > URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
>> > > > private/full");
>> > > > CalendarQuery myQuery = new CalendarQuery(feedUrl);
>> > > > CalendarService calendarService = new CalendarService("some-app-
>> > > > name");
>> > > > calendarService.setAuthSubToken(currentUser.authSubToken, null);
>> > > > CalendarEventFeed resultFeed = calendarService.query(myQuery,
>> > > > CalendarEventFeed.class);
>> > > > [/code]
>>
>> > > > It says that thetokenisinvalid, and raises this exception:
>> > > > [code]
>> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl getEventsDev:
>> > > > null
>> > > > com.google.gdata.util.AuthenticationException: OK
>> > > > 
>> > > > 
>> > > > Tokeninvalid-InvalidAuthSubtoken.
>> > > > 
>> > > > 
>> > > > Tokeninvalid-InvalidAuthSubtoken.
>> > > > Error 401
>> > > > 
>> > > > 
>>
>> > > >         at
>> > > > com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData
>> > > >  Request.java:
>> > > > 596)
>> > > >         at
>> > > > com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG
>> > > >  DataRequest.java:
>> > > > 563)
>> > > >         at
>> > > > com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques
>> > > >  t.java:
>> > > > 550)
>> > > >         at
>> > > > com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java
>> > > >  :
>> > > > 530)
>> > > >         at
>> > > > com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.
>> > > >  java:
>> > > > 535)
>> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1102)
>> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1044)
>> > > >         at 
>> > > > com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
>> > > > 662)
>> > > >         at com.google.gdata.client.Service.query(Service.java:1204)
>> > > >         at com.google.gdata.client.Service.query(Service.java:1145)
>> > > >         at
>> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl.getEventsDev(CalendarE
>> > > >  ventsServiceImpl.java:
>> > > > 133)
>> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
>> > > > Source)
>> > > >         at java.lang.reflect.Method.invoke(Unknown Source)
>> > > >         at
>> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
>> > > >  ethod_
>> > > > $1.run(Method_.java:165)
>> > > >         at java.security.AccessController.doPrivileged(Native Method)
>> > > >         at
>> > > > com.google.apphosting.runtime.security.shared.interce

[appengine-java] SSL handshake exception when uploading app?

2010-03-31 Thread Spines
I get:

javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No name matching
appengine.google.com found
Unable to update app: java.security.cert.CertificateException: No name
matching appengine.google.com found

when trying to update my app.

It just started this morning.  I've successfully been able to update
my app many times in the past.  Anyone else having this problem?

Not sure if this is related, but when I go to gmail.com this morning
on Chrome, it gives me a SSL certificate warning.  I've seen on
twitter that others are having this problem too.

-- 
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: Why should app startup times be a problem.

2010-03-31 Thread Blake
Cool post Sarath, thanks for sharing.

I'm also scrambling to get better performance, but I'm getting nowhere
near as high CPU times as you are.  What types of queries are you
doing?  I've restructured my app so that all of my queries are by
keys.  I've denormalized, serialized child objects into parents when I
didn't need to query the children.

I'm not going to assume I know what your app's doing, and starting
handing out advice on ignorance, but we all need to accept that this
isn't a traditional relational data store.  We need to do more with
our write operations in preparation for specific read operations.
Trade-offs need to be made with every request.  Even with 100 views
per day, our app is basically in a system that's getting pummeled, so
we need to code as if we're getting 1million pageviews per day.

There's all kinds of tricks you can do (again, assuming you're not
doing them already).  If the CSS is dynamically generated, cache it
and/or store it as a text field in a table.  Use AJAX to give the
perception of a quick-loading app by putting as much into the html
files as you can, with spinners on the client as the data is loaded
asynchronously.

That extra work will even save you money once you get above the free
quota.

What are you doing in those requests that can't be cleaned up for
better App Engine performance?

- a side note to this thread, not necessarily Sarath -
I agree with everyone on what "would be nice".  I'd love to make a
fully relational database that handles ad hoc queries and no awareness
of the underlying framework, but the system is what it is, so let's
embrace it and squeeze every cpu clock cycle and millisecond of wait
time out of it.  If we can't do that, then why don't we just move to
LAMP hosts for $10/month?

On Mar 31, 10:19 am, Sarath  wrote:
> Here is some more insight.http://bit.ly/d2lOnv
>
> Looks like I was way off on numbers for Grails. Like I said, We should
> think less about work arounds, and frameworks-on-diet (not that they
> dont work) and rather look at an out of box solution.
>
> -Sarath.
>
> On Mar 31, 2:29 am, Sarath  wrote:
>
> > This is getting really interesting. I have been follwoing this post
> > from a couple of days.
>
> > I managed to see What exactly is ammounting to delayed startup.
>
> > Some have suggested to remove spring/di/jpa/jdo. While this is true,
> > it solves much of the problem - These are the reason why I would
> > choose java over python.
>
> > I may be wrong here - But I tried this experiment.
>
> > I had four versions of a simple java app.
>
> > one with grails
> > one with spring (full di - context: scan etc)
> > one with spring (lazyloading, )
> > one with slim1.0
> > one with NOTHING (only commons logging)
>
> > I realised there are two parts to the load time.
>
> > The load time from google.
> > The load time from the libraries.
>
> > I believe from a developers perspective the second one should NOT be
> > considered for optimization.
>
> > For #1 a recommendation is warm startup. While in theory it might
> > sound good, the elasticity and managment will take it back to EC2 type
> > like baz suggests.
>
> > For my experiment the results are like this
>
> > Version                                                                 - 
> > Google Warmup - Framework Warmup
> > with grails                                                                 
> >     -       ~9+ secs        -       ~4secs
> > with spring (full di - context: scan etc)                               -   
> >     ~4+ secs        -       ~3 secs
> > with spring (lazyloading, )                                             -   
> >     ~4 secs -       ~2 secs
> > with slim1.0                                                            -   
> >     ~2-3 secs       -       <1 secs
> > with NOTHING (only commons logging)                     -       ~2 secs -   
> >     <1 sec
>
> > Now I dont know what exactly Google spins down - I assume just the
> > apps - not the whole container. In which case, There is a lot of load
> > while loading the libraries. I can only guess, (corrections expected
> > from technical team at google) most of the time take should be during
> > the class loading. Grails/Spring have a bunch of libraries that are
> > almost 1 mb some times.
>
> > An assumable solution would be to preload / share these libraries in
> > the parent classloader and  have some kind of manifest either in app-
> > web.xml or manifest.mf  to use them.  It may not be a fully loaded
> > osgi type of a stack but a noval hierachied classloading with ways to
> > selectively load libraries. Otherwise there be some other classloading
> > mechanism that is fast. like probably from memcache.
>
> > Google tech team - to comment/
>
> > I will try to upload some actual numbers from my logs and post the
> > information.
>
> > -Sarath
>
> > On Mar 31, 1:54 am, "Ikai L (Google)"  wrote:
>
> > > David, that post mirrors many of the points made here:
>
> > >http://www.answercow.com/201

[appengine-java] Re: Why should app startup times be a problem.

2010-03-31 Thread Sarath
Here is some more insight. http://bit.ly/d2lOnv

Looks like I was way off on numbers for Grails. Like I said, We should
think less about work arounds, and frameworks-on-diet (not that they
dont work) and rather look at an out of box solution.

-Sarath.


On Mar 31, 2:29 am, Sarath  wrote:
> This is getting really interesting. I have been follwoing this post
> from a couple of days.
>
> I managed to see What exactly is ammounting to delayed startup.
>
> Some have suggested to remove spring/di/jpa/jdo. While this is true,
> it solves much of the problem - These are the reason why I would
> choose java over python.
>
> I may be wrong here - But I tried this experiment.
>
> I had four versions of a simple java app.
>
> one with grails
> one with spring (full di - context: scan etc)
> one with spring (lazyloading, )
> one with slim1.0
> one with NOTHING (only commons logging)
>
> I realised there are two parts to the load time.
>
> The load time from google.
> The load time from the libraries.
>
> I believe from a developers perspective the second one should NOT be
> considered for optimization.
>
> For #1 a recommendation is warm startup. While in theory it might
> sound good, the elasticity and managment will take it back to EC2 type
> like baz suggests.
>
> For my experiment the results are like this
>
> Version                                                                 - 
> Google Warmup - Framework Warmup
> with grails                                                                   
>   -       ~9+ secs        -       ~4secs
> with spring (full di - context: scan etc)                               -     
>   ~4+ secs        -       ~3 secs
> with spring (lazyloading, )                                             -     
>   ~4 secs -       ~2 secs
> with slim1.0                                                            -     
>   ~2-3 secs       -       <1 secs
> with NOTHING (only commons logging)                     -       ~2 secs -     
>   <1 sec
>
> Now I dont know what exactly Google spins down - I assume just the
> apps - not the whole container. In which case, There is a lot of load
> while loading the libraries. I can only guess, (corrections expected
> from technical team at google) most of the time take should be during
> the class loading. Grails/Spring have a bunch of libraries that are
> almost 1 mb some times.
>
> An assumable solution would be to preload / share these libraries in
> the parent classloader and  have some kind of manifest either in app-
> web.xml or manifest.mf  to use them.  It may not be a fully loaded
> osgi type of a stack but a noval hierachied classloading with ways to
> selectively load libraries. Otherwise there be some other classloading
> mechanism that is fast. like probably from memcache.
>
> Google tech team - to comment/
>
> I will try to upload some actual numbers from my logs and post the
> information.
>
> -Sarath
>
> On Mar 31, 1:54 am, "Ikai L (Google)"  wrote:
>
> > David, that post mirrors many of the points made here:
>
> >http://www.answercow.com/2010/03/google-app-engine-cold-start-guide-f...
>
> > There's one or two more tips on that page.
>
> > On Tue, Mar 30, 2010 at 12:47 PM, David Chandler 
> > wrote:
>
> > > In the mean time, here are some ideas for reducing startup times by
> > > shrinking our apps. I went from 8.1s to 2.5s mainly by eliminating
> > > Guice, and I would expect similar results with Spring. I can
> > > definitely live with 2.5s...
>
> > >http://turbomanage.wordpress.com/2010/03/26/appengine-cold-starts-con...
>
> > > /dmc
>
> > > On Mar 30, 3:04 pm, Baz  wrote:
> > > > Great information, Ikai.
>
> > > > I really feel that "instances" should be completely avoided in concept
> > > and
> > > > language on the GAE. What if the feature was simply an enable/disable
> > > deal
> > > > called "Warm Scale". If it were enabled, then your *next* instance would
> > > > always be warm, regardless of how many instances you already had. This
> > > would
> > > > be most noticeable and suitable for low QPS production apps that are
> > > > constantly going from 0 to 1 instances (as you mentioned), but it could
> > > > still be important for others, say, for a super-high-profile site, or a
> > > > situation where your QPS is right at the threshold of instances and
> > > > oscillating back and forth between two instances. Whatever the 
> > > > situation,
> > > if
> > > > the solution were generalized like that, and most importantly not tied 
> > > > to
> > > a
> > > > SPECIFIC NUMBER of instances, it would be up to the user to decide how
> > > > important it was for them and whether to enable it.
>
> > > > Cheers,
> > > > Baz
>
> > > --
> > > 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...@googlegr

Re: [appengine-java] Re: Why should app startup times be a problem.

2010-03-31 Thread Tobias Rothe
looks interesting. I think I will give this a try.
Can someone give any advice on doing full-text search over datastore
entities? Compass+lucene is by far the heaviest part of my application.

On Wed, Mar 31, 2010 at 3:36 PM, John Patterson wrote:

>
> On 31 Mar 2010, at 17:58, Blake Caldwell wrote:
>
>> From the few hours I've spent with Twig, it seems easier -  not
>> harder than JDO for everything I'm doing.
>>
>
> Nice to hear.  You should get improved in ease of use from all of the
> non-standard persistence interfaces designed specifically at the datastore -
> just choose the features you need.  Twigs ObjectDatastore aims to be as
> efficient as hand coded low-level solutions with no startup overhead.
>  Unlike some of the other frameworks there is no "registration" process for
> your data model classes - each class is analyzed the first time it is used
> per server instance and the meta-data is cached for the duration of the
> instance.
>
> One user found that queries which had to be run as tasks previously with
> JDO could now be calculated on the fly in real time by using the
> ObjectDatastore.
>
> Performance can be compared directly to JDO - I believe that Twig is the
> only option which  allows you to reuse you stored JDO data - correct me if I
> am wrong on that.
>
>
>  If you want to use JPA or
>> JDO because you're already familiar with them, that's great and all,
>> but the mapping to BigTable isn't that straight forward, so cramming
>> the framework on top might not be the answer.
>>
>> Create a data store tier, wrap all Twig/Objectify logic in there, and
>> while your app won't be as portable as if you were using JDO, it'll
>> perform better, use less resources, and not be terribly dificult to
>> port later on, if you have to.
>>
>
> Exactly.  If you ever find yourself creating DTO's to abstract away details
> of the persistence framework you use then consider that data models in Twig
> *are* your DTOs - they have no dependencies at all.  Pure POJOs which are
> really simple to port to any persistence interface you choose.
>
> It also makes working with GWT a breeze because you can send a whole object
> graph over the wire without having to fetch each item by Key (or Key)
>
>
>> My $0.02
>>
>>
> $0.04 total
>
> --
> 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.
>
>

-- 
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: AuthSub InvalidToken problem

2010-03-31 Thread nicanor.babula
Hmm? No idea? ;)
Thanks in advance.

On Mar 30, 10:06 am, "nicanor.babula" 
wrote:
> That's all the code that deals with google services in my whole
> application. The exception is raised on the following instruction:
> [code]
> CalendarEventFeed resultFeed = calendarService.query(myQuery,
> CalendarEventFeed.class);
> [/code]
>
> What about the environment? You are saying that I might have included
> jars that could interfere with auth sub? Are there any known
> conflictual libraries? I have simply included all the jars shipped
> with the gdata-samples package.
>
> On Mar 30, 4:51 am, seleronm  wrote:
>
> > Hi,
>
> > I was not able to have them reproduce behavior though I tried a
> > little.
> > (It was possible to execute it normally).
>
> > Can post do you the source code further?
> > I want to confirm behavior.
>
> > Or, the environment might be a cause.
>
> > thank.
>
> > > Come on!
> > > Anyone, anything?
>
> > > Thanks.
>
> > > On Mar 26, 12:54 pm, "nicanor.babula" 
> > > wrote:
>
> > > > Hi all,
>
> > > > I am facing a strange problem in with my app in GAE and I can't seem
> > > > to figure it up by myself, so I hope you'll help me.. Here we are:
>
> > > > I do :
>
> > > > [code]
> > > > String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, 
> > > > "http://www.google.com/calendar/feeds/default/private/full";, false, 
> > > > true);
> > > > response.sendRedirect(authSubUrl);
> > > > [/code]
>
> > > > in my servlet in order to get an auth subtoken. And the servlet at
> > > > nextUrl does:
> > > > [code]
> > > > String oneTimeUseToken =
> > > > AuthSubUtil.getTokenFromReply(request.getQueryString());
> > > > if(oneTimeUseToken != null){
> > > >   String sessionToken =
> > > > AuthSubUtil.exchangeForSessionToken(oneTimeUseToken, null);
> > > >   // persist the sessiontoken}
>
> > > > // redirect to the page using google services
> > > > [/code]
> > > > in order to retrieve and persist the sessiontokenalong with other
> > > > user information.
>
> > > > The problem is that when later I do:
> > > > [code]
> > > > URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/
> > > > private/full");
> > > > CalendarQuery myQuery = new CalendarQuery(feedUrl);
> > > > CalendarService calendarService = new CalendarService("some-app-
> > > > name");
> > > > calendarService.setAuthSubToken(currentUser.authSubToken, null);
> > > > CalendarEventFeed resultFeed = calendarService.query(myQuery,
> > > > CalendarEventFeed.class);
> > > > [/code]
>
> > > > It says that thetokenisinvalid, and raises this exception:
> > > > [code]
> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl getEventsDev:
> > > > null
> > > > com.google.gdata.util.AuthenticationException: OK
> > > > 
> > > > 
> > > > Tokeninvalid-InvalidAuthSubtoken.
> > > > 
> > > > 
> > > > Tokeninvalid-InvalidAuthSubtoken.
> > > > Error 401
> > > > 
> > > > 
>
> > > >         at
> > > > com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData
> > > >  Request.java:
> > > > 596)
> > > >         at
> > > > com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG
> > > >  DataRequest.java:
> > > > 563)
> > > >         at
> > > > com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques
> > > >  t.java:
> > > > 550)
> > > >         at
> > > > com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java
> > > >  :
> > > > 530)
> > > >         at
> > > > com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.
> > > >  java:
> > > > 535)
> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1102)
> > > >         at com.google.gdata.client.Service.getFeed(Service.java:1044)
> > > >         at 
> > > > com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
> > > > 662)
> > > >         at com.google.gdata.client.Service.query(Service.java:1204)
> > > >         at com.google.gdata.client.Service.query(Service.java:1145)
> > > >         at
> > > > cri.domodentweb.server.rpc.CalendarEventsServiceImpl.getEventsDev(CalendarE
> > > >  ventsServiceImpl.java:
> > > > 133)
> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
> > > > Source)
> > > >         at java.lang.reflect.Method.invoke(Unknown Source)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_
> > > > $1.run(Method_.java:165)
> > > >         at java.security.AccessController.doPrivileged(Native Method)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_.privilegedInvoke(Method_.java:
> > > > 163)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_.invoke_(Method_.java:
> > > > 124)
> > > >         at
> > 

[appengine-java] Re: bouncycastle add provider failure

2010-03-31 Thread ZaeX
Hi, Alan:

Thanks for the reply.

In order to make some BC functionalities to work on GAE, I tried some
workaround like using directly the BC lightweight api and  modify some
BC's code from XXXFactory.getInstance(xxx, "BC") to the corresponding
spi classes.

This method works some time, but it usually turned out to be a great
mess.
Don't know if there're other easy workarounds.

On Mar 29, 5:31 pm, Alan Kennedy  wrote:
> [ZaeX]
>
> > I have tried to add the bouncycastle JCE provider in the code, it
> > works in Eclipse jetty server, but failed on GAE.
> > I wonder if it's because my coding mistake or 'Security.addProvider'
> > is forbidden by GAE.
>
> It is currently not possible to add security providers to appengine.
>
> Add support for BouncyCastle JCE 
> providerhttp://code.google.com/p/googleappengine/issues/detail?id=1612
>
> Alan.

-- 
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.



Re: [appengine-java] Re: Why should app startup times be a problem.

2010-03-31 Thread John Patterson


On 31 Mar 2010, at 17:58, Blake Caldwell wrote:

From the few hours I've spent with Twig, it seems easier -  not
harder than JDO for everything I'm doing.


Nice to hear.  You should get improved in ease of use from all of the  
non-standard persistence interfaces designed specifically at the  
datastore - just choose the features you need.  Twigs ObjectDatastore  
aims to be as efficient as hand coded low-level solutions with no  
startup overhead.  Unlike some of the other frameworks there is no  
"registration" process for your data model classes - each class is  
analyzed the first time it is used per server instance and the meta- 
data is cached for the duration of the instance.


One user found that queries which had to be run as tasks previously  
with JDO could now be calculated on the fly in real time by using the  
ObjectDatastore.


Performance can be compared directly to JDO - I believe that Twig is  
the only option which  allows you to reuse you stored JDO data -  
correct me if I am wrong on that.



If you want to use JPA or
JDO because you're already familiar with them, that's great and all,
but the mapping to BigTable isn't that straight forward, so cramming
the framework on top might not be the answer.

Create a data store tier, wrap all Twig/Objectify logic in there, and
while your app won't be as portable as if you were using JDO, it'll
perform better, use less resources, and not be terribly dificult to
port later on, if you have to.


Exactly.  If you ever find yourself creating DTO's to abstract away  
details of the persistence framework you use then consider that data  
models in Twig *are* your DTOs - they have no dependencies at all.   
Pure POJOs which are really simple to port to any persistence  
interface you choose.


It also makes working with GWT a breeze because you can send a whole  
object graph over the wire without having to fetch each item by Key  
(or Key)




My $0.02



$0.04 total

--
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: how to build same entity group

2010-03-31 Thread dreamy
Thanks to Chau Huynh.

as you said, how to  find all  the list of   telephone( has belong to
a person )? because of these telephone can't sale again.

-- 
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 SDK 1.3.2 is out!

2010-03-31 Thread jacek.ambroziak
And in the Java documentation the last index argument is EXCLUSIVE
as is standard in Java (so that end - start = length)(and so that the
previous end can
become start in a loop)

On Mar 31, 12:34 am, Robin B  wrote:
> The docs do mention the index values are inclusive:
>
> http://code.google.com/appengine/docs/python/blobstore/functions.html
>
> "Byte indexes are inclusive, with the first byte having an index of 0.
> For example, a start_index of 9 and an end_index of 19 will return up
> to 11 bytes, starting from the 10th byte (index 9) in the value."
>
> Robin
>
> On Mar 30, 5:21 pm, Ikai Lan  wrote:
>
>
>
> > I've reproduced the off-by-one error. Thanks for bringing this up.
>
> > On Mar 27, 8:32 am, "jacek.ambroziak" 
> > wrote:
>
> > > fetchData is very useful. At the moment its implementation seems to
> > > suffer from an off-by-one bug.
> > > For instance, fetchData(key, 0, 1024) returns an array of length 1025
> > > and
> > > blobstoreService.fetchData(blobKey, 0,
> > > BlobstoreService.MAX_BLOB_FETCH_SIZE)
> > > will, I guess, attempt to read one byte too many and it fails with
>
> > >   com.google.appengine.api.blobstore.BlobstoreFailureException: An
> > > unexpected error occurred.
>
> > > On Mar 25, 8:48 pm, "Ikai L (Google)"  wrote:
>
> > > > Check it out!
>
> > > >http://googleappengine.blogspot.com/2010/03/app-engine-sdk-132-releas...
>
> > > > Blog post:
>
> > > > App Engine SDK 1.3.2
> > > > Released
>
> > > > Today we are excited to announce the release of version 1.3.2 of the App
> > > > Engine SDK for both the Java and Python runtimes. 1.3.2 includes a 
> > > > number of
> > > > changes and bug fixes.
>
> > > > For this release, we have concentrated on removing a number of 
> > > > limitations
> > > > that have been affecting developers:
>
> > > >    - Blobstore API - A new method
> > > > (fetch_data
> > > > for
> > > >    Python, 
> > > > fetchData
> > > > for
> > > >    Java) allows your application to request the contents of a Blob from 
> > > > within
> > > >    your application’s code.
> > > >    - URLFetch API - We’ve expanded the number of ports you can access 
> > > > with
> > > >    the URLFetch API. You can now access ports 80-90, 440-450, and 
> > > > 1024-65535.
> > > >    - Mail API - We’ve expanded the allowed mail attachments to include
> > > >    common document extensions including .doc, .ppt, and .xls.
> > > >    - Task Queue API - We’ve increased the maximum total Task Queue 
> > > > refill
> > > >    rate to 50 per second.
>
> > > > We’re also happy to announce, based on your feedback, a new Denial of
> > > > Service (DoS) blocking system in App Engine. This system allows you to
> > > > blacklist specific IP addresses from accessing your application, and to
> > > > prevent them from costing your application money or eating up your 
> > > > quota.
> > > > You can also view the top IPs that have accessed your application in the
> > > > Admin Console, to help you figure out what IPs you may want to block. 
> > > > More
> > > > information on this feature is available for
> > > > Python
> > > > and Java .
>
> > > > There’s a lot of other changes and fixes in this release, including a 
> > > > new
> > > > Java version of the Appstats profiling tool, so read the release notes (
> > > > Python ,
> > > > Java)
> > > > for a complete list of changes and download the new versions of the
> > > > SDK
> > > > .
>
> > > > Release Notes:
>
> > > > Version 1.3.2 - March 25, 2010
>
> > > >    - New API to read the contents of uploaded Blobs (fetch_data)
> > > >    -http://code.google.com/p/googleappengine/issues/detail?id=2536
>
> > > >    - URLFetch now supports accessing ports 80-90, 440-450, and 
> > > > 1024-65535
> > > >    - Mail API now allows common document formats as attachments
> > > >       -http://code.google.com/p/googleappengine/issues/detail?id=494
> > > >    - The Task Queue API now supports adding multiple tasks in a single 
> > > > call
> > > >    to Queue.add()
> > > >    - Fixed charset handling for inbound emails
> > > >       -http://code.google.com/p/googleappengine/issues/detail?id=2326
> > > >    - Fixed issue with compositing background colors in dev_appserver
> > > >    - New feature in the datastore to specify whether to use strong or
> > > >    eventually consistent reads (the default is strong)
> > > >    - New datastore feature allows setting deadlines for operations
> > > >    - Increased the maximum Task Queue refill rate from 20/s to 50

[appengine-java] Discussion on will-it-play-in-app-engine

2010-03-31 Thread Haroon Idrees
I tried JSF 2.0 on App engine I got this error

 [java] java.lang.NoClassDefFoundError: javax.naming.InitialContext is
a restricted class. Please see the Google  App Engine developer's
guide for more details.
 [java] at
com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:
51)
 [java] at
com.sun.faces.config.WebConfiguration.processJndiEntries(WebConfiguration.java:
578)
 [java] at
com.sun.faces.config.WebConfiguration.(WebConfiguration.java:
114)
 [java] at
com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:
174)
 [java] at
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:
161)

My Web.xml


http://java.sun.com/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>
 
  
javax.faces.STATE_SAVING_METHOD
server
  
  
  javax.faces.DEFAULT_SUFFIX
.xhtml
  
  
  
com.sun.faces.expressionFactory
com.sun.el.ExpressionFactoryImpl
  

  

  Set this flag to true if you want the JavaServer Faces
  Reference Implementation to validate the XML in your
  faces-config.xml resources against the DTD. Default
  value is false.

com.sun.faces.validateXml
true
  
  
  

  When enabled, the runtime initialization and default
ResourceHandler
  implementation will use threads to perform their functions. Set
this
  value to false if threads aren't desired (as in the case of
running
  within the Google Application Engine).

  Note that when this option is disabled, the ResourceHandler will
not
  pick up new versions of resources when ProjectStage is
development.

com.sun.faces.enableThreading
false
  
  
com.sun.faces.enableJNDI
false
  

Faces Servlet
javax.faces.webapp.FacesServlet
1


Faces Servlet
/faces/*



30



index.jsp



-- 
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: Workaround for Spring transactions throw GenericSignatureFormatError

2010-03-31 Thread objectuser
Thanks, Thomas.  It certainly seems like it's worth a shot!

On Mar 30, 11:23 pm, Thomas  wrote:
> Hi kevin:
>
>     Yes, my workaround is just a proxy which route every pmf requests
> back to the original instance return by
> JDOHelper.getPersistenceManagerFactory.
>
>     I used jdo transaction manager and aop and it worked on gae host
> after applying the workaround. My spring version is 2.0.8 but I think
> it could also work on spring 2.5.
>
> Thomas

-- 
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: Spring 2.5 Transactions - anyone got this working?

2010-03-31 Thread objectuser
Check your pointcut ... is com.myapp.dao... correct?

If that's correct, then I don't see anything amiss; it looks really
good.  Are you even able to setup a test where it works?  Or are you
doing it from a test?

Oh, and check the use of pm.close().  That should be taken care of by
Spring I think.  I don't do it in my app anyway.

If those don't work, then I'll looks again.

On Mar 30, 3:04 pm, Carl Ballantyne  wrote:
> Hi objectuser,
>
> Thanks for the links - very helpful. I have had a look and studied
> them. I am trying to get your example to work but am getting the
> error.
>
> org.springframework.transaction.CannotCreateTransactionException:
> Could not open JDO PersistenceManager for transaction; nested
> exception is java.lang.IllegalStateException: No JDO
> PersistenceManager bound to thread, and configuration does not allow
> creation of non-transactional one here
> at
> org.springframework.orm.jdo.JdoTransactionManager.doBegin(JdoTransactionManager.java:
> 359)
>
> As far as I can see I have set up everything as should be but am
> missing something obvious because it just will not work. It might be
> something to do with the aop config but I cannot be sure. I have read
> the Spring documentation and your example which are very similar.
> Below is my revised spring xml and I have included example dao code as
> well. If anyone can see what I am doing wrong please correct me.
> Thanks.
>
> SPRING XML
> -
>
> 
>         
> 
>
>  class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
>         
> 
>
>  class="org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy">
>  ref="persistenceManagerFactory" />
> 
> 
>
>  class="org.springframework.orm.jdo.JdoTransactionManager">
>          ref="persistenceManagerFactoryProxy" />
> 
>
> 
>         
>              rollback-for="Throwable"  />
>              for="Throwable"/>
>              for="Throwable" />
>              for="Throwable" />
>             
>         
> 
>
> 
>         
>     
> 
>
> DAO
> -
>
> public class ProjectDaoJdoImpl implements ProjectDao {
>
>         private PersistenceManagerFactory pmf;
>
>          public void setPmf(final PersistenceManagerFactory pmf) {
>                 this.pmf = pmf;
>             }
>          private PersistenceManager getPersistenceManager() {
>                  return pmf.getPersistenceManager();
>             }
>
>          public Project read(Long id) {
>                 PersistenceManager pm = getPersistenceManager();
>
>                 try {
>                         Project project = pm.getObjectById(Project.class,id);
>                         return project;
>                 } finally {
>                         pm.close();
>                 }
>
>         }
>
> }

-- 
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.



Re: [appengine-java] Re: Why should app startup times be a problem.

2010-03-31 Thread Blake Caldwell
Yeah, that blog post was awesome. I started moving to Twig last night.
I understand and appreciate the concerns of others that frameworks are
our friends, and that it's not unreasonable to use them, but at the
same time, CPU and network optimization are even more important, so
long as the barrier to achieve them isn't too high.

 From the few hours I've spent with Twig, it seems easier -  not
harder than JDO for everything I'm doing. If you want to use JPA or
JDO because you're already familiar with them, that's great and all,
but the mapping to BigTable isn't that straight forward, so cramming
the framework on top might not be the answer.

Create a data store tier, wrap all Twig/Objectify logic in there, and
while your app won't be as portable as if you were using JDO, it'll
perform better, use less resources, and not be terribly dificult to
port later on, if you have to.

My $0.02


---
Sent from my iPad

On Mar 31, 2010, at 6:23 AM, SRF  wrote:

> David, Ikai:
>
> Thanks very much for those blog posts on reducing the cold start
> time.  I think 1 to 2 seconds is reasonable.  I'm definitely going to
> take a closer look at Objectify.
>
> ++Steve
>
> On Mar 30, 4:54 pm, "Ikai L (Google)"  wrote:
>> David, that post mirrors many of the points made here:
>>
>> http://www.answercow.com/2010/03/google-app-engine-cold-start-guide-
>> f...
>>
>> There's one or two more tips on that page.
>>
>> On Tue, Mar 30, 2010 at 12:47 PM, David Chandler
>> wrote:
>>
>>
>>
>>
>>
>>> In the mean time, here are some ideas for reducing startup times by
>>> shrinking our apps. I went from 8.1s to 2.5s mainly by eliminating
>>> Guice, and I would expect similar results with Spring. I can
>>> definitely live with 2.5s...
>>
>>> http://turbomanage.wordpress.com/2010/03/26/appengine-cold-starts-con
>>> ...
>>
>>> /dmc
>>
>>> On Mar 30, 3:04 pm, Baz  wrote:
 Great information, Ikai.
>>
 I really feel that "instances" should be completely avoided in
 concept
>>> and
 language on the GAE. What if the feature was simply an enable/
 disable
>>> deal
 called "Warm Scale". If it were enabled, then your *next*
 instance would
 always be warm, regardless of how many instances you already had.
 This
>>> would
 be most noticeable and suitable for low QPS production apps that
 are
 constantly going from 0 to 1 instances (as you mentioned), but it
 could
 still be important for others, say, for a super-high-profile
 site, or a
 situation where your QPS is right at the threshold of instances and
 oscillating back and forth between two instances. Whatever the
 situation,
>>> if
 the solution were generalized like that, and most importantly not
 tied to
>>> a
 SPECIFIC NUMBER of instances, it would be up to the user to
 decide how
 important it was for them and whether to enable it.
>>
 Cheers,
 Baz
>>
>>> --
>>> 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>> appengine-java%2B unsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>> --
>> Ikai Lan
>> Developer Programs Engineer, Google App Enginehttp://
>> googleappengine.blogspot.com|http://twitter.com/app_engine
>
> --
> 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-java@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
> .
>

-- 
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: Why should app startup times be a problem.

2010-03-31 Thread SRF
David, Ikai:

Thanks very much for those blog posts on reducing the cold start
time.  I think 1 to 2 seconds is reasonable.  I'm definitely going to
take a closer look at Objectify.

++Steve

On Mar 30, 4:54 pm, "Ikai L (Google)"  wrote:
> David, that post mirrors many of the points made here:
>
> http://www.answercow.com/2010/03/google-app-engine-cold-start-guide-f...
>
> There's one or two more tips on that page.
>
> On Tue, Mar 30, 2010 at 12:47 PM, David Chandler wrote:
>
>
>
>
>
> > In the mean time, here are some ideas for reducing startup times by
> > shrinking our apps. I went from 8.1s to 2.5s mainly by eliminating
> > Guice, and I would expect similar results with Spring. I can
> > definitely live with 2.5s...
>
> >http://turbomanage.wordpress.com/2010/03/26/appengine-cold-starts-con...
>
> > /dmc
>
> > On Mar 30, 3:04 pm, Baz  wrote:
> > > Great information, Ikai.
>
> > > I really feel that "instances" should be completely avoided in concept
> > and
> > > language on the GAE. What if the feature was simply an enable/disable
> > deal
> > > called "Warm Scale". If it were enabled, then your *next* instance would
> > > always be warm, regardless of how many instances you already had. This
> > would
> > > be most noticeable and suitable for low QPS production apps that are
> > > constantly going from 0 to 1 instances (as you mentioned), but it could
> > > still be important for others, say, for a super-high-profile site, or a
> > > situation where your QPS is right at the threshold of instances and
> > > oscillating back and forth between two instances. Whatever the situation,
> > if
> > > the solution were generalized like that, and most importantly not tied to
> > a
> > > SPECIFIC NUMBER of instances, it would be up to the user to decide how
> > > important it was for them and whether to enable it.
>
> > > Cheers,
> > > Baz
>
> > --
> > 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 > unsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App 
> Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
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.



Re: [appengine-java] Wiki on GAE

2010-03-31 Thread Alan Kennedy
[moissinac]
> Do you know some wiki solution runing on GAE?

Have you looked in the App Gallery?

http://appgallery.appspot.com/results?q=wiki

Although all the ones listed there seem to be in python.

Does it need to be in java?

Alan.

-- 
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: Wiki on GAE

2010-03-31 Thread moissinac
J'ai trouvé peu de choses
Surtout des solutions qui dépendent soit d'un système de fichiers,
soit d'une base SQL et donc ne sont pas rapidement transposables sur
GAE
Juste un projet en cours pour GAE qui se déclare lui-même très
préliminaire

http://jamwiki.org/wiki/en/User:axelclk
http://code.google.com/p/gwtwiki/wiki/Development#info.bliki.gae

A suivre

-- 
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: Why should app startup times be a problem.

2010-03-31 Thread Toby
Hello,

Thank you Sarath for this very nice wrap up and for the figures. I
totally agree with your findings.

To abandon all use of frameworks even the ones provided by GAE (e.g.
JDO) would mean to give up a lot of benefits and to end up with messy
code especially for large application. Also frameworks might provide
features that are not available through any low level API. In my
application I need e.g. full-text search which is not supported by
GAE(!). So I use the compass framework and lucene which seems to be
the only option at the moment. To load the search engine is even
adding to my spin-up time and I do not see a good way to solve this
problem.

Frameworks and libraries are not only just about software engineering
or design pattern. They most of all  provide us with additional
functionality and free us from the task of rewriting what was done
before. So eventually you end up with a bunch of jar in your project.
And loading them seems to be what kills the spin-up time.

Warmed instances seems to be the best fix for the moment. But from a
CO2 perspective we should avoid such wasteful solutions. On the longer
term there should be something else. Maybe to do a memory snapshot of
the JVM when it is suspended and to kind of keep that in local storage
or cache. The class loader is another idea. Even though it might
become a nightmare with all the different versions. And finally I
think the functionality of GAE should be extended and optimized. I do
not understand why suddenly JDO or JPA is at disposition, even if it
is part of the core SDK. In my case I would appreciate if GAE would
include full-text search. And I am sure there is other functionality
that could become part of the platform.

Tobias


On Mar 30, 11:29 pm, Sarath  wrote:
> This is getting really interesting. I have been follwoing this post
> from a couple of days.
>
> I managed to see What exactly is ammounting to delayedstartup.
>
> Some have suggested to remove spring/di/jpa/jdo. While this is true,
> it solves much of theproblem- These are the reason why I would
> choose java over python.
>
> I may be wrong here - But I tried this experiment.
>
> I had four versions of a simple javaapp.
>
> one with grails
> one with spring (full di - context: scan etc)
> one with spring (lazyloading, )
> one with slim1.0
> one with NOTHING (only commons logging)
>
> I realised there are two parts to the load time.
>
> The load time from google.
> The load time from the libraries.
>
> I believe from a developers perspective the second oneshouldNOT be
> considered for optimization.
>
> For #1 a recommendation is warmstartup. While in theory it might
> sound good, the elasticity and managment will take it back to EC2 type
> like baz suggests.
>
> For my experiment the results are like this
>
> Version                                                                 - 
> Google Warmup - Framework Warmup
> with grails                                                                   
>   -       ~9+ secs        -       ~4secs
> with spring (full di - context: scan etc)                               -     
>   ~4+ secs        -       ~3 secs
> with spring (lazyloading, )                                             -     
>   ~4 secs -       ~2 secs
> with slim1.0                                                            -     
>   ~2-3 secs       -       <1 secs
> with NOTHING (only commons logging)                     -       ~2 secs -     
>   <1 sec
>
> Now I dont know what exactly Google spins down - I assume just the
> apps - not the whole container. In which case, There is a lot of load
> while loading the libraries. I can only guess, (corrections expected
> from technical team at google) most of the time takeshouldbe during
> the class loading. Grails/Spring have a bunch of libraries that are
> almost 1 mb sometimes.
>
> An assumable solution would be to preload / share these libraries in
> the parent classloader and  have some kind of manifest either inapp-
> web.xml or manifest.mf  to use them.  It may not be a fully loaded
> osgi type of a stack but a noval hierachied classloading with ways to
> selectively load libraries. Otherwise there be some other classloading
> mechanism that is fast. like probably from memcache.
>
> Google tech team - to comment/
>
> I will try to upload some actual numbers from my logs and post the
> information.
>
> -Sarath
>
> On Mar 31, 1:54 am, "Ikai L (Google)"  wrote:
>
> > David, that post mirrors many of the points made here:
>
> >http://www.answercow.com/2010/03/google-app-engine-cold-start-guide-f...
>
> > There's one or two more tips on that page.
>
> > On Tue, Mar 30, 2010 at 12:47 PM, David Chandler 
> > wrote:
>
> > > In the mean time, here are some ideas for reducingstartuptimesby
> > > shrinking our apps. I went from 8.1s to 2.5s mainly by eliminating
> > > Guice, and I would expect similar results with Spring. I can
> > > definitely live with 2.5s...
>
> > >http://turbomanage.wordpress.com/2010/03/26/appengine

[appengine-java] _ah_SESSION index on _expires property

2010-03-31 Thread Peter Ondruska
I am trying to automatically cleanup expired session by deleting
records from _ah_SESSION. Instead of iterating through all records I
tried to filter on _expires but it does not work because it is not
indexed. Manual index creation failed. Is the index missing by design?
Peter

-- 
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.