[appengine-java] Class not being enhanced

2009-08-20 Thread jd

Hi,

I am getting an error Caused by:
org.datanucleus.exceptions.ClassNotPersistableException: The class
"com.example.Update" is not persistable

The datanucleus console shows this:

DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
DataNucleus Enhancer completed with success for 4 classes. Timings :
input=303 ms, enhance=120 ms, total=423 ms. Consult the log for full
details

Where can I view the log on a mac to see what might be the problem?

Thanks,

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



[appengine-java] Re: Class not being enhanced

2009-08-20 Thread jd

Figured it out:

On my mac the enhancement log goes to /var/folders/T4/
T4W7RbfJF0CmVJO2UEnIIU+++TI/-Tmp-/

Also, to fix my problem I just needed to add a new folder to in
Eclipse to the ORM settings panel.

Cheers,

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



[appengine-java] Local transactions do not rollback

2009-08-20 Thread jd

Hi,

I am using the local sdk datastore to save several thousand of objects
and when an exception occurs the data is not rolled-back and the data
is still in the datastore.

I can see in the log

INFO: Time to persist datastore: 1140 ms

which seems to indicate the data is being flushed to disk.  Is this
documented somewhere?

Thanks,

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



[appengine-java] Owned relationship with generated parent key

2009-08-21 Thread jd

Hi,

I want to create an owned one to many relationship where the key for
the parent is auto generated.

Is this possible to to in a single transaction?  Or do I need to
commit the parent first so I can then get its key and set the parent
key on the child?

Thanks,

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



[appengine-java] Re: Maven

2009-08-23 Thread jd



On Aug 23, 2:46 am, Marcel Overdijk  wrote:

> > Has anyone had a better luck with this?

I gave up on the mvn-appengine-plugin as the dependancies were broken
and no one seems to maintain it.  I also had a crack at using the
datanucleus plugin but gave up after running into some problems with
different versions to app engine.  I think I was also having problems
enhancing JDO classes because Eclipse builds incrementally but the
maven plugin had to be run each build.  I decided to use maven to
manage all dependancies _except_ for appengine and gwt and just use
the Eclipse plugin for those.  That means configuring maven to use
the /war folder.

Now at least I get the enhancer running incrementally and can deploy
at the click of a button.

JD
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Inheritance in JDO

2009-08-23 Thread jd

Hi,

I have a structure similar to this this:


class Zoo
{
  Animal animal;
}

class Zebra implements Animal
{
}

class Donkey implements Animal
{
}

All classes are annotated as PersistenceCapable etc and enhanced.  I
get this error:

javax.jdo.JDOUserException: Field "animal" is declared as a reference
type (interface/Object) but no implementation classes of "Animal" have
been found!

Any suggestions?  BTW, the cos are very sparse when it comes to
persisting class hierarchies.

Thanks,

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



[appengine-java] Re: Local transactions do not rollback

2009-09-22 Thread jd

Sorry for the late response - I expected to be automatically notified
but I guess I need to star my own topics.

Yes the version was 1.2.1 so I expect that was it although I have not
tested again with 1.2.5

Cheers

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



[appengine-java] Local datastore slow

2009-09-22 Thread jd

Hi,

I am testing my app locally and finding that storing entities is very
slow.  I have less than 500 entities of and the time to persist the
datastore seems to be increasing:

INFO: Time to persist datastore: 43293 ms

Then occasionally I get an exception:

Caused by:
com.google.appengine.api.datastore.DatastoreFailureException: handle
104 not found
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError
(DatastoreApiHelper.java:42)
at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
(DatastoreApiHelper.java:56)


Many fields are indexed.  My local_db.bin file is about 1.5 MB

Is this simply a limitation of the local datastore?

Thanks,

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



[appengine-java] Delete all from datastore

2009-09-24 Thread jd

Hi, is it possible to delete all entities from the datastore?  I can
see how I can delete  entities from a single kind at a time but do not
know how to query for all kinds or list all kinds.

Thanks,

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



[appengine-java] Re: Local datastore slow

2009-09-24 Thread jd

The entities are small in terms of bytes but each has about 80 indexed
properties and there are about 300" exception.  It seems to happen
after I get a message like "persisted datastore in 22058 ms"


On Sep 22, 4:58 pm, Toby Reyelts  wrote:
> 1) What size entities are you saving to the datastore?
>
> 2) Can you see if increasing your heap space helps? If you're running from
> the command line, use:
> --jvm_flag=-Xmx1G
>
> If you're using the Eclipse plugin, you can just set -Xmx1G in the launch
> config.
>
> 3) If that doesn't help, can you post a sample app that reproduces the
> problem?
>
>
>
> On Tue, Sep 22, 2009 at 6:36 AM, jd  wrote:
>
> > Hi,
>
> > I am testing my app locally and finding that storing entities is very
> > slow.  I have less than 500 entities of and the time to persist the
> > datastore seems to be increasing:
>
> > INFO: Time to persist datastore: 43293 ms
>
> > Then occasionally I get an exception:
>
> > Caused by:
> > com.google.appengine.api.datastore.DatastoreFailureException: handle
> > 104 not found
> >        at
> > com.google.appengine.api.datastore.DatastoreApiHelper.translateError
> > (DatastoreApiHelper.java:42)
> >        at
> > com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
> > (DatastoreApiHelper.java:56)
>
> > Many fields are indexed.  My local_db.bin file is about 1.5 MB
>
> > Is this simply a limitation of the local datastore?
>
> > Thanks,
>
> > 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-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
-~--~~~~--~~--~--~---



[appengine-java] Re: Delete all from datastore

2009-09-25 Thread jd

No this is not for local unit tests but for clearing all datastore
entities.

If there is a way to list current Kinds or select all entities of any
kind I could manage this.

On Sep 24, 5:42 pm, leszek  wrote:
> If you want to clean your local datastore with respect to junit tests
> - look at this link:
>
> http://code.google.com/appengine/docs/java/howto/unittesting.html
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Twig - Alternative to JDO

2009-10-27 Thread jd

Hi,

While working on my latest project I created a small framework as an
alternative to using JDO for storing objects in the datastore.  I've
called it Twig and made it open source to share the love.  I hope it
can save others as much time and frustration as it has saved me.

http://code.google.com/p/twig-persist/

My goal was to make something that was easy to configure and extend
with code.  Its still very early days and many features are relatively
untested but is useful enough to overcome many of the problems I had
using the standard persistence API's.

Feedback is very welcome

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



[appengine-java] Re: conceptual question: parent Key

2009-10-29 Thread jd

Another benefit is that you can do an ancestor query without a kind.
i.e. show all descendants of an entity regardless of their kinds.
Also you can query for descendants regardless of whether they are
direct descendants (children) or not (e.g. grandchildren).  I guess
you could simulate the last point with a range query but you would
then not be able to add another inequality filter.

Twig makes it easy to define an object reference as a parent, child or
independent entity without dealing with Keys at all.  This makes
working with Entity Groups and transactions a breeze

http://code.google.com/p/twig-persist/

and you can still easily use low-level queries.


On Oct 29, 6:21 pm, Roy Smith  wrote:
> Resistance is futile :-)
>
> It only enforces referential integrity in that you specify the parent at
> entity creation time. LLAPI does NOT prevent you subsequently deleting a
> parent and thus orphaning the child.
>
> The main benefit is that the 2 entities formed as a parent/child in this way
> form an entity group and thus may be involved in an atomic transaction. This
> is also the downside in that there is a persistence overhead when persisting
> am entity group.
>
> So it depends on your application whether you should manually maintain your
> own relationships using foreign keys (cheap, but no transactions) or use
> LLAPI (expensive but supports transactions).
>
> If you google this group for "entity group", and also the GAE documentation
> you will see a lot of discussion.
>
>
>
> On Thu, Oct 29, 2009 at 11:00 AM, K.Honsali  wrote:
>
> > typo: desired issue => desired value
>
> > On 29 oct, 11:58, "K.Honsali"  wrote:
> > > Salaam,
>
> > > Using the low-level datastore api;
>
> > > I have some resistance understanding the benefit of instantiating an
> > > Entity with a parent Key.
> > > Since I can just set a property , ParentId , with the desired issue.
>
> > > Does BigTable ensure integrity constraints if I indicate the parent
> > > Key using the former method?
>
> > > Thanks!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[appengine-java] Repeated "Request was aborted" errors

2009-12-07 Thread jd
Hi,

I am getting errors on every other request like this:

Request was aborted after waiting too long to attempt to service your
request. Most likely, this indicates that you have reached your
simultaneous dynamic request limit. This is almost always due to
excessively high latency in your app. Please see
http://code.google.com/appengine/docs/quotas.html for more details.

which are then followed by a restart of the container and then the
next request will give the error again.

As the container is restarting and only one request is processes I
think something else must be causing the error apart from too many
connections.

Any ideas?

Thanks,

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.




[appengine-java] Re: Repeated "Request was aborted" errors

2009-12-08 Thread jd
target-rooms

On Dec 8, 1:07 am, Don Schwarz  wrote:
> What's your app id?
>
>
>
> On Sun, Dec 6, 2009 at 10:19 AM, jd  wrote:
> > Hi,
>
> > I am getting errors on every other request like this:
>
> > Request was aborted after waiting too long to attempt to service your
> > request. Most likely, this indicates that you have reached your
> > simultaneous dynamic request limit. This is almost always due to
> > excessively high latency in your app. Please see
> >http://code.google.com/appengine/docs/quotas.htmlfor more details.
>
> > which are then followed by a restart of the container and then the
> > next request will give the error again.
>
> > As the container is restarting and only one request is processes I
> > think something else must be causing the error apart from too many
> > connections.
>
> > Any ideas?
>
> > Thanks,
>
> > 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 > 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] Loading request time

2009-12-08 Thread jd
Hi,

My application takes over 10 seconds on loading requests to output its
log messages.  During this time, simultaneous requests are aborted
because they cannot be serviced within the 10 second limit.

What is the best way to optimise startup time?  I have already turned
on precompilation.  Is the number of dependancies an important factor?

Thanks,

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.




[appengine-java] Re: Loading request time

2009-12-12 Thread jd
The logs show that Guice is taking 5 seconds to build the Injector.  I
have tried setting Guice to development mode in the hope that it would
start up faster but it takes about the same as production.

Does anyone else find Guice slow to start?

On top of this delay it is taking 7 seconds before my application code
is even called so loading requests always take longer than the 10
second limit and the simultaneous requests are aborted.  I assume the
only option is to keep the app warm by pinging it.

On Dec 11, 7:50 am, "Ikai L (Google)"  wrote:
> Yes, loading dependencies can add to your startup time. Are you initializing
> anything on startup?
>
>
>
>
>
> On Tue, Dec 8, 2009 at 10:29 PM, jd  wrote:
> > Hi,
>
> > My application takes over 10 seconds on loading requests to output its
> > log messages.  During this time, simultaneous requests are aborted
> > because they cannot be serviced within the 10 second limit.
>
> > What is the best way to optimise startup time?  I have already turned
> > on precompilation.  Is the number of dependancies an important factor?
>
> > Thanks,
>
> > 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 > 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

--

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: where I should put the Task Queue code?

2009-12-13 Thread jd
Hi, task queues are just a way to call a url some time in the future.
As Jason mentioned above, for a tasks "handler" you should probably
just create a servlet (extend HttpServlet) because you do not need to
generate a nice webpage as the result of the call - no one will see
it.  In the HttpServlet.service(...) method write your code to
actually handle the task making sure that it won't take longer than 30
seconds.  This method will be called for POSTs or GETs to its url.
Then you need to define the url that will call this servlet in your
web.xml file.  If you are just using the default queue then you should
map /_ah/queue/default to your "handler" servlet.

To execute your task you could either call the url directly in a
browser, from your GWT client or from other server side code.  But you
probably want to use the TaskQueue to schedule the call for some time
in the future from some other server side code like within your GWT
RPC servlet.

On Dec 14, 4:53 am, John V Denley  wrote:
> Well put Rusty, thats exactly the frustration im having!!! LOL
>
> On Dec 13, 9:42 pm, Rusty Wright  wrote:
>
>
>
> > What method gets called in your code when your app receives a GET request?  
> > Or a POST request?  I think that's what you're looking for.  Unfortunately 
> > the documentation for these frameworks sometimes tries to sugar coat things 
> > and hide ("abstract away") these low level details, or they assume it's 
> > obvious how things work, which it may be to to some but not all of us.
>
> > John V Denley wrote:
> > > LOL - damn... though it shouldnt matter whats being used for the front
> > > end reallymaybe Im asking the wrong question!!
>
> > > Does anyone else have any idea how to explain what the entry point is
> > > within the java code, or where the code is that actually executes what
> > > thetaskqueueis supposed to do? Does anyone know how to ask the
> > > question Im trying to ask?!
>
> > > On Dec 13, 8:22 pm, Rusty Wright  wrote:
> > >> Heh, I'm on the flip side; I don't know anything about GWT.
>
> > >> John V Denley wrote:
> > >>> Thanks for this Rusty, Im not sure I understand all of it right away
> > >>> (perhaps with more investigation I will work it out)
> > >>> However Its worth mentioning that as far as I know Im not using Spring
> > >>> or Stripes or Struts (not even sure what any of these are!)
> > >>> I am using native GWT (v2.0)/GAE(v1.2.8) and using RPC to make calls
> > >>> to the server side.
> > >>> I have tried creating a "public" function in my main java file (right
> > >>> above the onModuleLoad() function) as follows:
> > >>>     public void testqueues()
> > >>>     {
> > >>>            Window.alert("hello test queues");
> > >>>     }
> > >>> The thinking then being that I might be able to make a call to
> > >>>http://your-gae-app.appspot.com/testqueuesanditwould show the alert
> > >>> box. (I would like to prove this in the dev environment, but Im not
> > >>> sure how to do this now that the URL for that is currently
> > >>>http://localhost:/IDeBanet.html/testqueues?gwt.codesvr=192.168.0)
> > >>> Its entirely possible that I have totally misunderstood how this is
> > >>> meant to be working and if so I apologise for asking stupid questions,
> > >>> or making incorrect/confusing statements, but it seems theres no real
> > >>> way of figuring out this stuff until you just try to implement it! Ive
> > >>> learnt a huge amount about web development and in particular GWT/GAE
> > >>> over the last 4-5 months!!
> > >>> Cheers,
> > >>> J
> > >>> On Dec 13, 5:46 am, Rusty Wright  wrote:
> >  I think I got the gist of it.  As a test I modified the Stripes action 
> >  bean that handles my first page and added the following to its 
> >  @DefaultHandler method:
> >    finalQueuequeue= QueueFactory.getDefaultQueue();
> >   queue.add(TaskOptions.Builder.url("/zugzug.zug")); // web.xml maps 
> >  *.zug to stripes
> >  It's adding ataskto thequeue.
> >  Then I created an action bean for thegaetaskqueueautomaton to poke:
> >    @UrlBinding("/zugzug.zug")
> >    public class TaskQueueActionBean implements ActionBean { ...
> >  and its @DefaultHandler method contains:
> >    @SuppressWarnings("unchecked")
> >    final List headerNames =
> >            Collections.list(getContext().getRequest().getHeaderNames());
> >    this.log.debug("header names: {}", headerNames);
> >  And then the log received:
> >    header names: [Content-Type, User-Agent, Referer, Host, 
> >  X-AppEngine-QueueName, X-AppEngine-TaskName, 
> >  X-AppEngine-TaskRetryCount, Content-Length]
> >  The first time I tried it I forgot to create the corresponding jsp 
> >  view file, zugzug.jsp (which is essentially empty), and 
> >  thetaskqueueautomaton kept retrying because stripes was returning an 
> >  error because the jsp file was missing; lots of those log.debug lines 
> >  in the log file.  After I fixed that then it wa

[appengine-java] Re: Many "Request was aborted after waiting too long to attempt to service your request" errors

2009-12-17 Thread jd
If your cron job has to wait longer than 10 seconds while your app is
reloading you will get this message.  Do you also see a "loading
request" in the logs just after or before this error message?  If so
then it is interesting that despite your 1 minute "ping", engine is
still swapping out your app.


On Dec 16, 10:04 pm, Fabrizio  wrote:
> Hello,
>
> I have a cron job (1/m).  I get many random errors like:
> 12-16 06:43AM 34.115 /"myurl.."   500 10020ms 0cpu_ms 0kb
> "Request was aborted after waiting too long to attempt to service your
> request. Most likely, this indicates that you have reached your
> simultaneous dynamic request limit. This is almost always due to
> excessively high latency in your app."
>
> I think it's not caused by "simultaneous dynamic request limit". I
> make only 1 request/minute.
> I also noticed an high time (more than 1ms).
>
> When it works, the log is like this:
>   12-16 06:48AM 20.059 /"myurl..."   200 156ms 191cpu_ms
> 95api_cpu_ms 0kb
>
> Why some requests work and other crash? I don't change anything
> between them.
>
>    Fabrizio

--

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: embedding parent object in parent-child relation with jdo

2009-12-18 Thread jd
Could you not split your query into two?  The first to find the parent
and the second to return all children with an ancestor query.
Alternatively, Twig makes embedding objects very simple.  If you use
the AnnotationTypesafeDatastore you can achieve the above with a
single annotation:

@Component
Parent parent;

However, currently Twig does not support the parent being _both_ an
embedded "component" and an "entity".  It must be one of the other.
It will support this type of denormalisation in the next release which
I hope to get out a week or so after new year.

http://code.google.com/p/twig-persist/

John

On Dec 19, 3:58 am, Eugene Kuleshov  wrote:
>   It shouldn't be needed, since according to the docs [1], the Key
> type is only required to record parent relation in the child.
>   But I tried it anyways and got pretty much the same exception:
>
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
>         at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK
> (DatastoreTable.java:356)
>         at org.datanucleus.store.appengine.DatastoreTable.buildMapping
> (DatastoreTable.java:285)
>         at org.datanucleus.store.appengine.DatastoreManager.buildStoreData
> (DatastoreManager.java:405)
> ...
>
>   regards,
>   Eugene
>
> [1]http://code.google.com/appengine/docs/java/datastore/creatinggettinga...
>
> On Dec 18, 2:33 pm, Rusty Wright  wrote:
>
>
>
> > Try making the parent's primary key be Key instead of String.
>
> > Eugene Kuleshov wrote:
> > >   I am using the app engine SDK 1.3.0 with the latest Google Eclipse
> > > plugin.
>
> > >   Currently, in order to be able to run queries on attributes of the
> > > parent object I have to embed parent object into a child. So, I have
> > > created the following classes
>
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > > public class Parent {
> > >   @PrimaryKey @Persistent String parentName;
> > >   @Persistent(mappedBy = "parent") List children = new
> > > ArrayList();
>
> > >   public Parent(String parentName) { this.parentName = parentName; }
> > >   public void setParentName(String parentName) { this.parentName =
> > > parentName; }
> > >   public String getParentName() { return parentName; }
> > >   public List getChildren() { return children; }
> > >   public void addChild(Child child) {
> > >     child.setParent(this);
> > >     children.add(child);
> > >   }
> > > }
>
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > > public class Child {
> > >   @PrimaryKey
> > >   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key
> > > childKey;
> > >   @Persistent String childName;
>
> > >   @Embedded(
> > >     members = { @Persistent(name = "parentName", column =
> > > "childParentName") },
> > >     ownerMember = "children")
> > >   @Persistent Parent parent;
>
> > >   public Child(String childName) { this.childName = childName; }
> > >   public void setChildName(String childName) { this.childName =
> > > childName; }
> > >   public String getChildName() { return childName; }
> > >   public void setParent(Parent parent) { this.parent = parent; }
> > >   public Parent getParent() { return parent; }
> > > }
> > >   and then I created a simple test to verify if I can persist and run
> > > queries on those objects:
>
> > > public class ParentTest {
> > >   public static void main(String[] args) {
> > >     Parent parent1 = new Parent("parent1");
> > >     parent1.addChild(new Child("child1"));
> > >     parent1.addChild(new Child("child2"));
>
> > >     Parent parent2 = new Parent("parent2");
> > >     parent2.addChild(new Child("child3"));
>
> > >     ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());
> > >     ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")) { });
>
> > >     ApiProxyLocalImpl proxy = (ApiProxyLocalImpl) ApiProxy.getDelegate
> > > ();
> > >     proxy.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY,
> > > Boolean.TRUE.toString());
>
> > >     PersistenceManagerFactory pmf =
> > > JDOHelper.getPersistenceManagerFactory("transactions-optional");
> > >     PersistenceManager pm = pmf.getPersistenceManager();
> > >     Transaction tx = pm.currentTransaction();
> > >     try {
> > >       tx.begin();
> > >       pm.makePersistent(parent1);
> > >       tx.commit();
>
> > >       tx.begin();
> > >       pm.makePersistent(parent2);
> > >       tx.commit();
>
> > >       Query query2 = pm.newQuery(Child.class);
> > >       query2.setFilter("parent.parentName==parentNameParam");
> > >       query2.declareParameters("java.lang.String parentNameParam");
> > >       List results2 = (List) query2.executeWithArray
> > > ("parent1");
> > >       System.err.println(results2);
> > >     } finally {
> > >       if (tx.isActive()) {
> > >         tx.rollback();
> > >       }
> > >       pm.close();
> > >     }
> > >   }
> > > }
>
> > >   The DataNucleus Enhancer runs ok on the above code, but when I run
> > > my test app, I am getting an IndexOutOfBo

[appengine-java] Re: GWT + GAE Performance

2009-12-19 Thread jd
A pure GWT application is a lot less demanding on server side
resources as most of the UI processing is off loaded to the client.
Also, a problem that I have run into with running a traditional web
framework on GAE is that "loading requests" can take a long time and
cause requests to be aborted (if longer than 10s).  That is, the first
hit must load your app onto a server instance and Wicket, in my case,
is taking some time to initialise.  GWT only requires a lightweight
servlet to respond to RPC calls which is much faster to load.

On Dec 19, 7:05 am, James H  wrote:
> I began using GAE for a project earlier this year and am aware of the
> throughput documented in the GAE docs and this forum.  Now, I am
> considering using GWT as the front-end to my GAE application.
>
> Can anyone share their experience in regard to performance when using
> GWT with GAE?  For example, does GWT introduce alot of overhead as
> compared to a Struts/JSP solution?
>
> Can anyone share their experience in regard to CPU Quota usage when
> using GWT with GAE?  Or any other resource quota related?
>
> Given a 1000 or 10,000 simultaneous users, what would their response
> time be like when comparing GWT vs Struts/JSP both on GAE?  I need GWT
> on GAE to support the potential for a very large number of
> simultaneous users.
>
> Thanks, J

--

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: Datastore W/O JDO or JPA??

2009-12-28 Thread jd
Twig http://code.google.com/p/twig-persist/

I think its the only one that doesn't make you deal with Keys
(including JDO) ... correct me if Im wrong here.  You just use normal
object references to other entities and define them as @Parent's
@Child'ren or even @Component's so that its properties are embedded.

On Dec 28, 9:01 am, Iqbal Yusuf Dipu  wrote:
> We have Siena and SimpleDS as alternative to JDO and JPA. Are there
> any other libraries exist?
>
> Thanks.

--

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: custom vs. generated keys / storage?

2010-01-04 Thread jd
The encoded "Entity Key" is a representation that includes your key
name, entity kind, ancestors and app id - encoded into a form that is
safe to use in urls etc.  Keeping your keys small and kinds small
(i.e. using short class names) will reduce storage space of keys in
the DS.  In Twig (i.e. not JDO) you can keep the names of your classes
as you like and then override typetoKind(Type) to return abbreviated
names.  I found that this saves a significant amount of space in my
app that has many relations between entities.

http://code.google.com/p/twig-persist/

On Jan 4, 5:01 pm, phraktle  wrote:
> Hi,
>
> I'm generating my own entity keys, with new Entity("Foo", "myId"). I
> noticed that in the DataStore viewer, these entities still seem to
> have a default key:
>
> Decoded entity key: Foo: name=myId
> Entity key:
> ahFzY2FyYWJyZWNvbW1lbmRlcnJACxIVUHJvZHVjdFJlY29tbWVuZGF0aW9uIiU1OTg1MEMzMzM 
> wOUZGRjV8MjAxMDAxMDQwMTAzNTN8cHJvZF8wDA
>
> So the "Entity key" here still seems to be generated by GAE. Why is
> this needed? I do have a primary key already. So does it get stored as
> simply another indexed column? Does this impact storage space too? I
> don't need the GAE entity key at all, and would prefer not having to
> pay for its storage either :)
>
> Thanks,
>   Viktor

--

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: Incoming mail handler runs slow

2010-01-06 Thread jd
To avoid these long "loading requests" you can either make your app
faster to load or keep it warm by pinging a page with a cron job, say
every minute.  Cron jobs will only work on the default (live) version
so I wrote a PingTaskServlet that simply places another task in the
queue and finishes.

On Dec 30 2009, 2:13 pm, Derek Battams  wrote:
> I've written an incoming mail handler and it works, that is, it does
> what I want it to do, but it runs slow, very slow.  However, I'm not
> sure why it's so slow because I'm using theQuotaServiceto time how
> long the doPost() method of my email handler servlet is running and
> it's returning 0.00 CPU seconds and 0.04 API seconds, yet the logs
> routinely report the requests taking over 1ms.
>
> I notice that if I fire two emails in rapid succession at my app then
> usually the first one reports as taking 1+ ms to run then the
> second one will run in under 150ms, which is confusing me even more.
> It's almost like the app is having to spin up on every email it
> receives, but 10+ seconds for the spin up seems way too long.  Is
> there something I should be watching out for when writing incoming
> email handlers?
-- 
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] QuotaService

2010-01-06 Thread jd
Hi, Should the QuotaService be working?  I always get 0 for
getCpuTimeInMegaCycles()
-- 
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 my app on GAE first access is so slow

2010-01-06 Thread jd
I use a task to ping itself every minute... no need to use external
servers.  I find that one minute seems enough but that occasionally
there are still loading requests as Google serves my request from a
different server - maybe to rebalance load?  The app is much more
responsive now but I assume that the only real solution is to speed up
the start up time.  Unfortunately, I chose to use Wicket and Guice -
both of which take too much time up front to initialize.

On Jan 6, 9:33 pm, Jorge  wrote:
> It´s been a lot of discussion about this topic lately. See for
> instance "Tragedy of the Commons, and Cold Starts".
>
> I own dedicated servers with other hosts and what I´ve been doing is
> automatically generating http request to my GAE app every 40 seconds.
> I started with 60 seconds and that became insufficient. Nevertheless,
> the Tragedy of the Commons seams to be real, because now 40 seconds is
> not enough to keep the app warm.
>
> My hope is Google will come up with a satisfactory solution soon.
> Maybe a fee to keep your application warm. I agree the cold startup
> time is absolutely unacceptable.
>
> Jorge Gonzalez
>
> On Nov 12 2009, 6:56 am, DrMorten 
> wrote:
>
>
>
> > 1 minute works for me, I used a commercial service that tracks uptime
> > to check it.
> > Trouble is that the commercial service checks randomly from different
> > locations all over the world.
> > meaning that the application loads out of memory because its hosted in
> > different locations, effectivly killing my CPU qouta.
>
> > On Nov 12, 3:36 am, "zhiw...@gmail.com"  wrote:
>
> > > i only test it in my country, i don't know whether it is still
> > > effective for request that from a foreign country. but to me it is
> > > enough
>
> > > On Nov 12, 10:30 am, "zhiw...@gmail.com"  wrote:
>
> > > > i turn it to 1min, the cron job access a servlet that do nothing just
> > > > for active the app. every 24h it only used 1% of the free cpu-time .
> > > > now at least when i access my app, it was not slow like before. but
> > > > sometime the app still be inactive, although the cron job active the
> > > > app, when i access sush as mainpage, it still took sometime
> > > > to load the servlet. gae doc wrote:  doesn't work , the
> > > > servlet will be load on first accessed.  i think use cron job to
> > > > access mainpage is better. now i have not try ths.
>
> > > > On Nov 12, 5:04 am, James H  wrote:
>
> > > > > So, 1-3 minute intervals seem to do the trick?  Is this technique
> > > > > still working for you?
>
> > > > > On Nov 10, 8:24 pm, "zhiw...@gmail.com"  wrote:
>
> > > > > > i think the gae cloud envrionment does not have the region concept.
> > > > > > every app run on a virtual server , the cron job is used to make the
> > > > > > virtual server active.  if the virtual server is active, when access
> > > > > > the app, there is no need to reinit such as spring listener etc, so
> > > > > > delay time is short, that is so simple  i think.
>
> > > > > > On Nov 10, 7:30 am, James H  wrote:
>
> > > > > > > How would a single cron task really help in an environment where
> > > > > > > multitudes of app servers are involved based on demand, geography,
> > > > > > > etc?  So, how will the task that just ran help someone in U.S. and
> > > > > > > simultaneously help someone in Russia on the same app?  I assume 
> > > > > > > they
> > > > > > > are potentially running on different app servers.
>
> > > > > > > On Nov 10, 1:51 am, m seleron  wrote:
>
> > > > > > > > Thank you for useful information.
>
> > > > > > > > Though various situations are thought
> > > > > > > > I think that a detailed analysis might be necessary to decrease 
> > > > > > > > the CPU TIME.
>
> > > > > > > > thunks
>
> > > > > > > > 2009/11/10 zhiw...@gmail.com :
>
> > > > > > > > > now i set the schedule time to 3min, it seems work, every 
> > > > > > > > > time i
> > > > > > > > > access my app, i can hardly feel slow. my cron job access a 
> > > > > > > > > servlet
> > > > > > > > > that do nothing and just for active my app. set the schedule 
> > > > > > > > > time to
> > > > > > > > > 1min is better i think,although it will take some cpu time.
>
> > > > > > > > > On Nov 9, 11:31 pm, m seleron  wrote:
> > > > > > > > >> I'm sorry very much.
>
> > > > > > > > >> It examined.
> > > > > > > > >> ServletContextListener#contextDestoryed was not called.
> > > > > > > > >> It was necessary to examine it accurately.
>
> > > > > > > > >> Nichole.
> > > > > > > > >> Thank you for advice.
>
> > > > > > > > >> Does not the page access speed become early?
>
> > > > > > > > >> When you access that I think access speed is open in since 
> > > > > > > > >> the second
> > > > > > > > >> times always
> > > > > > > > >> because by the thing that keeps being accessed with cron
>
> > > > > > > > >> If the display speed is still slow, the cause might be 
> > > > > > > > >> different.
>
> > > > > > > > >> thanks,
>
> > > > > > > > >> On Nov 9, 11:30 pm, "zhiw...@gmail.com"  
> > > > > 

[appengine-java] Re: TaskQueue 10s limit? really?

2010-01-10 Thread jd
Tasks can use 30 seconds before a DeadlineExceededExecption is
thrown.  What you are seeing is a task being fired while your
application is loading.  If your app takes more than 10 seconds to
load you can get these.  The only solution is to improve the startup
time of your app which can be a very difficult process - especially if
you have already invested development time in a web framework which
takes some time to initialise.

A question to Google: is it possible to store the memory image of a
running instance rather than re-initialising applications each time
one is needed?

On Jan 10, 5:53 am, Locke  wrote:
> Just to clarify, here's what I'm interpreting as "google killing my
> TaskQueues after 10 seconds." See where it says "10064ms 0cpu_ms"?
> This was waiting for a URLFetch to timeout after 10 seconds, but it
> was killed before URLFetch could return. 10 seconds is much less than
> 30 seconds...
>
> "01-09 11:26AM 03.652 /hook/do_ava_check 500 10064ms 0cpu_ms 0kb
> AppEngine-Google; (+http://code.google.com/appengine)
> 0.1.0.2 - - [09/Jan/2010:11:26:13 -0800] "POST /hook/do_ava_check HTTP/
> 1.1" 500 0
> ...
> Request was aborted after waiting too long to attempt to service your
> request. ..."
>
> If I am interpreting my logs wrong, let me know...
>
> On Jan 9, 3:52 pm, Locke  wrote:
>
>
>
> > Python supports asynchronous URLFetch, but Java doesn't. So if we need
> > to do any asynchronous URLFetching, our only option is to use the
> > TaskQueue, right?
>
> > Well, I always thought our apps had 30 seconds to complete their
> > business. Since URLFetch calls can take up to 10 seconds to complete,
> > 30 seconds is more than enough. So I wrote an "asynchronous_urlfetch"
> > function which simply used the TaskQueue to post a URL to a webhook
> > which called URLFetch. Not as good as the Python way, but it should
> > work just fine.
>
> > But it doesn't! My logs are full of "500 ... Request was aborted after
> > waiting too long to attempt to service your request." for the
> > aforementioned webhook. Aparently, rather than giving the normal 30
> > seconds, App Engine is killing my TaskQueues after only 10! So if my
> > URLFetch takes 10 seconds, the entire webhook dies!
>
> > Am I interpreting this right? Are TaskQueues really getting killed
> > after 10 rather than 30 seconds? If so, could we please get this
> > rectified?
>
> > And, really, time spent waiting on URLFetch should not count against
> > us, anyway! That's outside of our control and is certainly NOT
> > indicative of problems with our apps.
-- 
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] HardDeadlineExceededError stack trace

2010-01-12 Thread jd
Hi,

>From a task servlet I catch DeadlineExceededException put another task
on the queue to continue the work.  This was working well until a few
days ago - recently it has been throwing a HardDeadlineExceededError
after the new ask is added to the queue resulting in many tasks
executing (i.e. the original task retries)

When I get a HardDeadlineExceededError the stack trace seems to be the
same as that which caused the original DeadlineExceededException.  Is
this right?  I expected to see a different stack trace in code that is
placing the task on the queue or writing a response.

Cheers,

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.




[appengine-java] Re: Any examples for low level datastore? or suggest another way?

2010-01-15 Thread jd
Hi Philip,

I would think using plain Java objects to represent a table and its
columns would be a better approach than using the low-level API
directly.  For example, you probably want to keep some fixed info
about a table like its name, creation date, sort fields etc - and then
a collection of Column instances with fixed fields for data type name,
restrictions etc.

I believe that Twig is the only library that can store objects with
entire collections embedded as components.  So the Columns could
actually be stored in the same entity as the Table.  This means that
querying or reading Tables is _much_ faster.  If the tables are read
more than written this would be ideal.

Docs are a bit light but basically you just define an embedded
collection like this:

class Table
{
  @Key String name;
  @Component Collection columns;
}

and thats it!  The columns are then stored as a multi-valued property
so you can even query properties them like "show all tables with a
column named 'age'".

more info and the source here: http://code.google.com/p/twig-persist/

JD

On Jan 15, 10:35 am, Joel Weight  wrote:
> Wow, biggest code review ever for me.  As a disclaimer, this is my first
> app-engine app, and I'm learning as I go along with the rest of you, so I'm
> sure there are plenty of shortcomings in this approach that I'll have to
> address as I get further along in my development.  Also, since that link
> points directly to my subversion repository, it's probably going to be
> changing over time.  That said, I thought the example at the bottom of the
> package-summary page that was linked in the OP was quite a good start.
>
> Joel
>
> On Thu, Jan 14, 2010 at 7:36 PM, Rusty Wright wrote:
>
>
>
> > Joel Weight wrote a data store service that I thought was easy to
> > understand.  Reading his code made me realize that what's in the data store
> > is basically the fields of the object, without the object itself; therefore
> > to "re-hydrate" an object from the data store, you first instantiate/new the
> > object, then fetch its row from the data store, then for each property you
> > got from the data store, call the object's setter with it.
>
> >http://kenai.com/projects/seedsofchance/sources/subversion/content/so...
>
> > philip wrote:
>
> >> Hi All,
>
> >> I want to use the low level datastore, I looked at the documentation
> >> and it looks ... complex.
>
> >>http://code.google.com/intl/zh-HK/appengine/docs/java/javadoc/com/goo...
>
> >> Basically, I have a client program which needs to create tables and
> >> their entities dynamically, so the columns would change over time.
> >> This does not fit well with JDO as it works for fixed column entitys
> >> that are annotated. So I thought to use the low level API but it looks
> >> difficult. Is there any example code around?
>
> >> Alternatively, can someone suggest another way?
>
> >> Phil
>
> > --
> > 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.
-- 
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 store/retrieve inheritance and composition in Datastore

2010-01-15 Thread jd
You mean you want to use OO in Java?  Then you need Twig

http://code.google.com/p/twig-persist/

It supports polymorphic relations and inheritance just like your
example with no configuration

For example you could have:

class D
{
  Collection cs;
}

which could contain A's or B's.

To speed up querying and loading D's you can define them to be
embedded as components:

class D
{
  @Component(polymorphic=true) Collection cs;
}

The polymorphic flag is needed to tell Twig to store the actual class
of the embedded component as an extra property which it needs a read-
time to create the instance.  Usually this is not needed because Twig
can use the generic type of the Field to know that the Collection is
of C's.

JD

On Jan 15, 3:59 am, Federico Keen  wrote:
> Hi guys, I'm trying to use the datastore with a model like this:
>
> Class A extends C
> {
>     �...@persistent
>      private String a1;
>
> }
>
> Class B extends C
> {
>     �...@persistent
>      private String b1;
>     �...@persistent
>      private D dAttribute;
>
> }
>
> Class D
> {
>     �...@persistent
>      private String d1;
>
> }
>
> Class C
> {
>     �...@primarykey
>     �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>      private Key id;
>
>     �...@persistent
>      private double c1;
>     �...@persistent
>      private double c2;
>
> }
>
> How should I declare this in Java?
> How can I make queries? The following queries are failing and I don't
> can't find more help!
>
>         public List get( String minC1, String maxC1 ) {
>                 PersistenceManager pm = WherePersistanceManagerFactory.get
> ().getPersistenceManager();
>                 Query query = pm.newQuery(A.class);
>                 query.setFilter("c1 >= " + minC1 + " && c1 <= " + maxC1);
>                 return (List) query.execute();
>         }
>
>         public List get( String minC1, String maxC1 ) {
>                 PersistenceManager pm = WherePersistanceManagerFactory.get
> ().getPersistenceManager();
>                 Query query = pm.newQuery(B.class);
>                 query.setFilter("c1 >= " + minC1 + " && c1 <= " + maxC1 + " &&
> dAttribute.d1 = someConstant");
>                 return (List) query.execute();
>         }
> I can't understand how to store/retrieve classes that inherit from
> other classes or classes as attributes of other classes. I always get
> an error saying that the subclass hasn't got the superclass attribute
> or that the class that has a reference to the other class cannot find
> that attribute.
> Can anyone help me?
> Thanks!
-- 
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: Can an Integer be a primary key for JDO?

2010-01-16 Thread jd
Keys can either have a system generated long "id" (not set by you) or
a String "name".

There used to be no way to create an Entity with a long - but now (as
of 1.2.7?) there is a constructor Entity(Key) and you can create a key
with a long.  But the docs say:

"Creating an entity for the purpose of insertion (as opposed to
update) with a key that has its id field set is strongly discouraged
unless the key was returned by a KeyRange."

So basically the answer is still no.

Twig gets around this by converting whatever field you declare as a
@Key into a String and back again - even Integers.

On Jan 16, 7:02 pm, Bert Peters  wrote:
> I was just wondering whether I could use an Integer for a primary key
> in JDO, as it would be a great convenience in my application.
> I couldn't really find an answer to this in the documentation, so I
> ask you. Can I?
-- 
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: String as Primary key in JDO

2010-01-16 Thread jd
Just String#toLowerCase() the key when you store them

On Jan 17, 1:11 am, sahil mahajan  wrote:
> I am using String as primary key in JDO. But it is case sensitive. It
> considers "name" and "NAME" as different. Can I make it case sensitive?
>
> --
> Regards
> Sahil Mahajan
-- 
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: Cannot have a java.lang.Long primary key and be a child object

2010-01-16 Thread jd
You cannot create a data model in JDO-GAE that is agnostic of its
environment.

Twig allows your domains classes to use any key type you want or even
none at all.

class Parent
{
String name;
@Entity(relation=child) Child child;
}
class Child
{
String name;
}

This will be correctly stored without any extra configuration

http://code.google.com/p/twig-persist/

Its an option if your time is worth more than the small degree of
portability you gain using a standard.

On Jan 15, 9:24 pm, Carl Ballantyne  wrote:
> Hi All,
>
> I have two classes, a Parent and a Child. (See below for code) The
> Parent class contains a reference to a Child instance. However when I
> try and save a Parent instance I get the following error: Cannot have
> a java.lang.Long primary key and be a child object.
>
> The error is clear enough and upon searching around I have found the
> solution is to convert the primary key of my Child class to Key.
> However this just does not sit well with me that I have to modify my
> domain classes with proprietary google classes to suit the datastore.
> Is there no other way to do this without resorting to custom APIs at
> the domain level? Or is this a limitation of JDO and I need to do a
> bit more research?
>
> Cheers,
> Carl.
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Parent {
>
>         @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         private Long id;
>         @Persistent
>         private String name;
>
>         @Persistent
>         private Child child;
>
>         public Long getId() {
>                 return id;
>         }
>         public void setId(Long id) {
>                 this.id = id;
>         }
>         public String getName() {
>                 return name;
>         }
>         public void setName(String name) {
>                 this.name = name;
>         }
>         public Child getChild() {
>                 return child;
>         }
>         public void setChild(Child child) {
>                 this.child = child;
>         }
>
> }
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Child {
>
>         @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         private Long id;
>         @Persistent
>         private String name;
>
>         public Long getId() {
>                 return id;
>         }
>         public void setId(Long id) {
>                 this.id = id;
>         }
>         public String getName() {
>                 return name;
>         }
>         public void setName(String name) {
>                 this.name = name;
>         }
>
>
>
> }
-- 
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: Memcache question

2010-01-18 Thread jd
There is no event mechanism with memcache.  You would need to store
items in memcache and the datastore at the same time.  If memcache
doesn't have it check the datastore.

On Jan 18, 4:44 am, Andrei  wrote:
> Is there a way to code Memcache that would notify when particular
> entry is about to expire
> so i can store it in DB?
> Thanks
-- 
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: 1000 Entity limit

2010-01-18 Thread jd
You can iterate over _more_ than 1000 results.

>From the horses mouth (sorry Don):

http://groups.google.com/group/google-appengine-java/browse_thread/thread/4dc3cd9e6113fe16#

On Jan 17, 11:58 pm, Paul Jacobs  wrote:
> Can I get a quick confirmation?
>
> The 1000 entity limit for any query works as described when I test.
>
> But in a quick test, something like:
>
>                 for (int i = 0;i < 2000; i += 400)
>                 {
>                         for (Entity row : 
> pqt.asIterable(FetchOptions.Builder.withLimit
> (400).offset(i))) {
>
>                        // yadda
>
>                         }
>
>                 }
>
> seems to work.
>
> I haven't benchmarked it: is this slow on subsequent increments of the
> offset?
>
> Any comments appreciated.
-- 
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] Task queues and transaction support

2010-01-25 Thread JD
The Queue interface has a method:
TaskHandle add(Transaction txn,
   TaskOptions taskOptions)


How does one get a handle on
com.google.appengine.api.datastore.Transaction in the first place ?
The persistent manager only returns  a transaction of type
javax.jdo.Transaction  which is not compatible with
com.google.appengine.api.datastore.Transaction expected by the task
queue API.


Is this a bug ?

JD

-- 
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] How to get application version from within code ?

2010-03-03 Thread JD
Is there anyway to get the application version  (from appengine-
web.xml) ?

In python the version is put in os environment, wondering if java has
something similar.

Thx

-- 
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] App Engine Plugin for Eclipse Stuck During Install Ubuntu 9.10

2010-03-03 Thread JD
I try to install the plugin for eclipse through eclipse's install new
software, however after it resolves dependencies and asks me to accept
the license, it hangs at 4% during the install.  Eclipse itself
doesn't hang, but the install never moves past 4%.  I've let it sit on
the install for about an hour now, but no progress is ever made.
Anyone else having this issue with eclipse and ubuntu 9.10?

-- 
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] TransactionalTaskException when enqueuing more than 5 tasks

2010-03-08 Thread JD
I am enqueuing tasks within a transaction.


tx.begin()

for (int i=0;i<10;i++) {
  Queue queue = QueueFactory.getDefaultQueue();
  TaskOptions task = url("/taskurl");
  task.param("param", "value");
  queue.add(task);
}
tx.commit();


I constantly get TransactionalTaskException when enqueuing task number
#6  (everything until number 5 goes through without issues).

Is there a limit on the number of tasks which can be enqueued within a
transaction ?


com.google.appengine.api.labs.taskqueue.TransactionalTaskException
at
com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:
50)
at
com.google.appengine.api.labs.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java:
32)
at
com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:
241)
at
com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:
231)

Caused by: java.lang.IllegalArgumentException:
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
33)
at
com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:
51)
... 51 more

-- 
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 query objects with criterias defined in child entities

2010-03-15 Thread jd


On Mar 15, 4:40 pm, Jeff Schnitzer  wrote:

>  * Get all the parent userids of the results, putting them in a hashset.

As long as the results are sorted on the same fields there is no need
to load all ids into a hashset.  You can just use the "zig-zag" method
to filter results that are in both iterators.

-- 
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] Problem with login when testing locally

2010-03-23 Thread JD
I'm getting this exception trying to use GAE to login in my local
environment.

java.lang.NullPointerException
at
com.google.appengine.api.users.dev.LoginCookieUtils.encodeEmailAsUserId(LoginCookieUtils.java:
89)
at
com.google.appengine.api.users.dev.LoginCookieUtils.createCookie(LoginCookieUtils.java:
41)
at
com.google.appengine.api.users.dev.LocalLoginServlet.doPost(LocalLoginServlet.java:
90)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
362)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at
net.sourceforge.stripes.action.ForwardResolution.execute(ForwardResolution.java:
110)
at net.sourceforge.stripes.controller.DispatcherHelper
$7.intercept(DispatcherHelper.java:508)
at
net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:
158)
at
net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:
99)
at
net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:
155)
at
net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:
113)
at
net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:
155)
at
net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:
74)
at
net.sourceforge.stripes.controller.DispatcherHelper.executeResolution(DispatcherHelper.java:
502)
at
net.sourceforge.stripes.controller.DispatcherServlet.executeResolution(DispatcherServlet.java:
286)
at
net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:
170)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1093)
at
net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:
247)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
121)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
360)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
139)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:352)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
506)
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:844)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
396)
at org.mortbay.thread.BoundedThreadPool
$PoolT

[appengine-java] Re: GPE 1.3 Tutorial?

2010-03-24 Thread jd


On Mar 24, 3:53 am, Keith Platfoot  wrote:
> It is still possible to
> use the Google Plugin for Eclipse with an App Engine project, but it may
> require a few hacks or manual steps in order to keep the runtime WAR
> directory in sync with your changes.  

I found this Eclipse plugin, FileSync, really useful to keep /src/main/
webapp in sync with /target/myapp-deploy-dir/

http://andrei.gmxhome.de/filesync/usage.html

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



[appengine-java] Re: Class XXX has multiple relationship fields of type YYYY

2010-05-03 Thread jd
Yep, many to many relationships work well.  They can also be
polymorhic and use inheritance with no problems.

On May 3, 12:09 am, Michael Shtelma  wrote:
> Hi all,
>
> I have looked at twig, I liked it a lot, but there is one issue about many
> to many relationships. Does Twig support them?
>
> Sincerely,
> Michael Shtelma
>
> On Sun, Mar 28, 2010 at 5:25 PM, John Patterson wrote:
>
>
>
> > There are alternatives: Twig, Objectify, SimpleDS, Slim3, Siena.  Take your
> > pick and get your app working today.
>
> > On 28 Mar 2010, at 21:47, Trung wrote:
>
> >  Hi GAE team,
>
> >> Any workarounds for this issue?
>
> >> Thanks
>
> >> On Feb 14, 8:55 am, Payam  wrote:
>
> >>> The problem is still not solved.
> >>> Although you can "persist" an object with multiple relations of the
> >>> same type. When you actually query the object, the retrieved object
> >>> has duplicates for the multiple relations.
> >>> As in, if I were to persist instances A, B inside C. When I query for
> >>> C, both objects retrieved will be A. There will be no B.
>
> >>> This is a serious bug!
>
> >>> On Jan 26, 4:54 pm, oth  wrote:
>
> >>>  Michael,
>
> >>>  In your jdoconfig.xml file add this entry:
>
> >>>    name="datanucleus.appengine.allowMultipleRelationsOfSameType"
>  value="true"/>
>
> >>>  Thanks
>
> >>>  On Jan 26, 3:12 pm, Michael Shtelma  wrote:
>
> >>>  Hi all,
>
> >>>  I am also experiencing this problem on GAE 1.3.0.
> > Using multipleRelationsOfSameTypeAreErrors helps not in all cases,
> > when I am trying to read such entities I get mentioned exception.
> > Are the any solution for the 1.3.0 ?
>
> >>>  Thanks,
> > Michael
>
> >>>  On Jan 21, 9:20 am, cowper  wrote:
>
> >>>  Hi,
> >>  I have a similar issue with 1.3.0 however it arises when the types
> >> are the same and not related to inheritance of any type.
>
> >>>  The work around suggested doesn't seem to work. Is the workaround
> >> valid for 1.3.0?
>
> >>>  thx,
>
> >>>  Conor
>
> >>>  On Dec 4 2009, 9:52 pm, "Max Ross (Google)" 
> >>>  +appeng...@google.com> wrote:
>
> >>> SDK 1.2.8 contains a new check that detects if one of your JDO or JPA
> >>> model
> >>> objects has two relationship fields of the same type.  For example:
>
> >>>  class A {
> >>>  List bList;
> >>>  List anotherBList;
>
> >>>  }
>
> >>>  Unfortunately I was a little too aggressive with this check, so the
> >>> following also run afoul of the check:
>
> >>>  abstract class B {}
>
> >>>  class C extends B {}
> >>> class D extends B {}
>
> >>>  class A {
> >>>  List cList:
> >>>  List dList;
>
> >>>  }
>
> >>>  If you get an exception that says
>
> >>>  Class XXX has multiple relationship fields of type .  This is not
> >>> yet
> >>> supported.
>
> >>>  and your class hierarchy resembles the one above, you can disable this
> >>> check
> >>> by with the following config property:
>
> >>>   >>> name="datanucleus.appengine.multipleRelationsOfSameTypeAreErrors"
> >>> value="true"/>
>
> >>>  We'll get this fixed shortly.
>
> >>>  Sorry for the trouble,
> >>> Max
>
> >> --
> >> 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.
>
> --
> 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 
> 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.



[appengine-java] Re: Class XXX has multiple relationship fields of type YYYY

2010-05-03 Thread jd


On May 2, 2:40 pm, jtuchscherer  wrote:
> John, are you saying that Twig, Objectify, SimpleDS, Slim3 and Siena
> don't have this problem?

I can only definitivly speak for Twig but I am certain that the others
also would not suffer this problem or many many of the other issues
with JDO-GAE.

> If yes, which one can you recommend?

Well as founder of Twig I would of course recommend it!  :)

However, the other projects all have strengths which you might want to
look into.  Comparing Twig with the other non-standard datastore
interfaces I would say it has a slightly higher level of abstraction
which has the advantage of making your code simple at the cost of
being less aware of when each peice of data is loaded.

> I am a
> little bit reluctant to use anything that makes your code tied to GAE.
> The beauty of JDO/JPA is that I can use the same code and deploy
> anywhere else.

I think you will find that this is not an easily achievable goal.

> But if that is my only option to get around this
> limitation I probably would use Twig, Objectify ...

You will certainly save yourself a LOT of time and grey hairs.

-- 
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: Class XXX has multiple relationship fields of type YYYY

2010-05-03 Thread jd

On May 4, 12:02 am, Michael Shtelma  wrote:
> Hi,
>
> do you have some sort of example or tutorial for the many to many relations

No example project yet, sorry.  I plan on making some maven archetypes
in the next couple of months e.g. GWT+Guice+Sitebricks+Twig

However, Twig aims to be as unobtrusive as possible so you just code
your data models as you naturally would in Java.  A many to many is
simply:

class A
{
  List bs;
}

class B
{
  List as;
}

No annotations are needed here because the default behaviour is to
store all reachable instances as "independent" entities.  When you
store an A like this:

datastore.store(myA);

twig will recursively store all B's in its list and then recursively
store all A's in its list etc.  However, it will never store the same
instance twice because it keeps record of which instances are already
"associated" with the ObjectDatastore and handles the keys for you.


-- 
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: Class XXX has multiple relationship fields of type YYYY

2010-05-03 Thread jd


On May 4, 12:02 am, Michael Shtelma  wrote:
> When I have tried using them, I got really strange exception.
> Twig was not able to determine the key for some dependent entities...I think
> I was doing smth wrong...

Ah yes, when you have circular references and you use "auto
generated" (default) keys you will need to store those items first.
For more details we can discuss further on the Twig discussion group.

-- 
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] Transaction exception when not using a transaction ?

2010-06-02 Thread JD
I have a PersistenceManager

PersistenceManager pm = PMF.get().getPersistenceManager();

which I use to do a bunch of operations on different objects, but
WITHOUT transaction (run queries, store entities and lookup entities).


I then close the manager with pm.close() and get this obscure error
that complains about multiple entity groups inside a transaction even
though I am not using a transaction (you will notice that the error is
not the usual one where it prints the different entity groups).

I am not 100% confident but have the impression that this error
started happening with the 1.3.4 release.
100% reproducible use case. Would appreciate input from App Engine
developers.

com.myapp.servlet.task.PopulateUserPages doAction: Illegal argument
javax.jdo.JDOFatalUserException: Illegal argument
at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:
344)
at
org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:
281)
at com.myapp.dao.jdo.DatastoreService.release(DatastoreService.java:
631)
at
com.myapp.servlet.AbstractBaseServlet.releaseService(AbstractBaseServlet.java:
243)
at
com.myapp.servlet.task.PopulateUserPages.doAction(PopulateUserPages.java:
132)
at com.myapp.servlet.task.Dispatcher.doAction(Dispatcher.java:35)
at com.myapp.servlet.task.TaskServlet.doAction(TaskServlet.java:36)
at
com.myapp.servlet.AbstractBaseServlet.doGenericAction(AbstractBaseServlet.java:
194)
at
com.myapp.servlet.AbstractBaseServlet.doPost(AbstractBaseServlet.java:
84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
511)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:
97)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
35)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
418)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
238)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:923)
at
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
135)
at
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
250)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5838)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5836)
at
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:
24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
398)
at com.google.net.rpc.impl.Server$2.run(Server.java:852)
at
com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:
56)
at
com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:
576)
at com.google.net.rpc.impl.Server.startRpc(Server.java:807)
at com.google.net.rpc.impl.Server.processRequest(Server.java:369)
at
com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:
442)
at
com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:
319)
at
com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:
290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:
474)

[appengine-java] Re: Transaction exception when not using a transaction ?

2010-06-03 Thread JD
I added a call to flush() after every change on the PM-managed object,
but that did not help.

Also doing a pm.flush() does not throw this exception, but doing a
pm.close() does - which seems to be contrary to your reasoning (I
would expect flush to throw the same exception if multiple entity
groups were at cause).


On Jun 3, 1:33 am, Millisecond  wrote:
> Even though you're not using transactions, I think it's trying to make
> the .close() call atomic (maybe with an internal implicit
> transaction), failing or succeeding as a whole.  And as I understand
> it, entities not in the same group can be stored on separate machines
> so can't be operated on atomically.
>
> I've worked around this by calling a flush() after most any change on
> a PM-managed object until close().  If this has a huge number of reqs/
> s, you may want to re-architect to get the objects in the same entity
> group as multiple flushes won't be very efficient.
>
> -C
>
> On Jun 2, 8:26 pm, JD  wrote:
>
> > I have a PersistenceManager
>
> > PersistenceManager pm = PMF.get().getPersistenceManager();
>
> > which I use to do a bunch of operations on different objects, but
> > WITHOUT transaction (run queries, store entities and lookup entities).
>
> > I then close the manager with pm.close() and get this obscure error
> > that complains about multiple entity groups inside a transaction even
> > though I am not using a transaction (you will notice that the error is
> > not the usual one where it prints the different entity groups).
>
> > I am not 100% confident but have the impression that this error
> > started happening with the 1.3.4 release.
> > 100% reproducible use case. Would appreciate input from App Engine
> > developers.
>
> > com.myapp.servlet.task.PopulateUserPages doAction: Illegal argument
> > javax.jdo.JDOFatalUserException: Illegal argument
> >         at
> > org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(Nuc 
> > leusJDOHelper.java:
> > 344)
> >         at
> > org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:
> > 281)
> >         at com.myapp.dao.jdo.DatastoreService.release(DatastoreService.java:
> > 631)
> >         at
> > com.myapp.servlet.AbstractBaseServlet.releaseService(AbstractBaseServlet.ja 
> > va:
> > 243)
> >         at
> > com.myapp.servlet.task.PopulateUserPages.doAction(PopulateUserPages.java:
> > 132)
> >         at com.myapp.servlet.task.Dispatcher.doAction(Dispatcher.java:35)
> >         at com.myapp.servlet.task.TaskServlet.doAction(TaskServlet.java:36)
> >         at
> > com.myapp.servlet.AbstractBaseServlet.doGenericAction(AbstractBaseServlet.j 
> > ava:
> > 194)
> >         at
> > com.myapp.servlet.AbstractBaseServlet.doPost(AbstractBaseServlet.java:
> > 84)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> >         at 
> > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> > 511)
> >         at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1166)
> >         at
> > com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlo 
> > bUploadFilter.java:
> > 97)
> >         at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1157)
> >         at
> > com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionF 
> > ilter.java:
> > 35)
> >         at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1157)
> >         at
> > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans 
> > actionCleanupFilter.java:
> > 43)
> >         at org.mortbay.jetty.servlet.ServletHandler
> > $CachedChain.doFilter(ServletHandler.java:1157)
> >         at
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> > 388)
> >         at
> > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> > 216)
> >         at
> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
> > 182)
> >         at
> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
> > 765)
> >         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
> > 418)
> >         at
> > com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionH 
> > andlerMap.java:
> &

[appengine-java] Re: Transaction exception when not using a transaction ?

2010-06-04 Thread JD
After debugging, I was able to get rid of the exception by removing a
pm.newQuery() which was happening on a different entity group.

To me this is a bug in App Engine, as there is no reason the query on
a particular entity group should fail outside a transaction.

On Jun 3, 12:25 pm, Millisecond  wrote:
> Hmmm.
>
> How is your object model structured?  Do entities have other entities
> as direct references?
>
> If you have "class A { B b }" and setting b to an instance of B that
> already existed might throw the error you're seeing.
>
> I changed my structure to be "class A { String bKey }" for a variety
> of other reasons, but guess it also may have gotten around this
> problem.
>
> Alternatively, post as much code as you can and I'll see if anything
> else rings a bell, early on I spent a frustrated day or two working
> around this exception in a variety of places so know it can be
> frustrating.
>
> -C
>
> On Jun 3, 6:33 am, JD  wrote:
>
> > I added a call to flush() after every change on the PM-managed object,
> > but that did not help.
>
> > Also doing a pm.flush() does not throw this exception, but doing a
> > pm.close() does - which seems to be contrary to your reasoning (I
> > would expect flush to throw the same exception if multiple entity
> > groups were at cause).
>
> > On Jun 3, 1:33 am, Millisecond  wrote:
>
> > > Even though you're not using transactions, I think it's trying to make
> > > the .close() call atomic (maybe with an internal implicit
> > > transaction), failing or succeeding as a whole.  And as I understand
> > > it, entities not in the same group can be stored on separate machines
> > > so can't be operated on atomically.
>
> > > I've worked around this by calling a flush() after most any change on
> > > a PM-managed object until close().  If this has a huge number of reqs/
> > > s, you may want to re-architect to get the objects in the same entity
> > > group as multiple flushes won't be very efficient.
>
> > > -C
>
> > > On Jun 2, 8:26 pm, JD  wrote:
>
> > > > I have a PersistenceManager
>
> > > > PersistenceManager pm = PMF.get().getPersistenceManager();
>
> > > > which I use to do a bunch of operations on different objects, but
> > > > WITHOUT transaction (run queries, store entities and lookup entities).
>
> > > > I then close the manager with pm.close() and get this obscure error
> > > > that complains about multiple entity groups inside a transaction even
> > > > though I am not using a transaction (you will notice that the error is
> > > > not the usual one where it prints the different entity groups).
>
> > > > I am not 100% confident but have the impression that this error
> > > > started happening with the 1.3.4 release.
> > > > 100% reproducible use case. Would appreciate input from App Engine
> > > > developers.
>
> > > > com.myapp.servlet.task.PopulateUserPages doAction: Illegal argument
> > > > javax.jdo.JDOFatalUserException: Illegal argument
> > > >         at
> > > > org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(Nuc
> > > >  leusJDOHelper.java:
> > > > 344)
> > > >         at
> > > > org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:
> > > > 281)
> > > >         at 
> > > > com.myapp.dao.jdo.DatastoreService.release(DatastoreService.java:
> > > > 631)
> > > >         at
> > > > com.myapp.servlet.AbstractBaseServlet.releaseService(AbstractBaseServlet.ja
> > > >  va:
> > > > 243)
> > > >         at
> > > > com.myapp.servlet.task.PopulateUserPages.doAction(PopulateUserPages.java:
> > > > 132)
> > > >         at 
> > > > com.myapp.servlet.task.Dispatcher.doAction(Dispatcher.java:35)
> > > >         at 
> > > > com.myapp.servlet.task.TaskServlet.doAction(TaskServlet.java:36)
> > > >         at
> > > > com.myapp.servlet.AbstractBaseServlet.doGenericAction(AbstractBaseServlet.j
> > > >  ava:
> > > > 194)
> > > >         at
> > > > com.myapp.servlet.AbstractBaseServlet.doPost(AbstractBaseServlet.java:
> > > > 84)
> > > >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> > > >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> > > 

[appengine-java] Re: Transaction exception when not using a transaction ?

2010-06-08 Thread JD
I am not using a transaction (see original POST), which is the
problem.

On Jun 4, 11:03 am, Chau Huynh  wrote:
> Did you have different entity groups inside a transaction?
> Google have a constraint of what can be done in a transaction 
> herehttp://code.google.com/appengine/docs/python/datastore/transactions.h...
>
> On Fri, Jun 4, 2010 at 5:45 PM, JD  wrote:
> > After debugging, I was able to get rid of the exception by removing a
> > pm.newQuery() which was happening on a different entity group.
>
> > To me this is a bug in App Engine, as there is no reason the query on
> > a particular entity group should fail outside a transaction.
>
> > On Jun 3, 12:25 pm, Millisecond  wrote:
> > > Hmmm.
>
> > > How is your object model structured?  Do entities have other entities
> > > as direct references?
>
> > > If you have "class A { B b }" and setting b to an instance of B that
> > > already existed might throw the error you're seeing.
>
> > > I changed my structure to be "class A { String bKey }" for a variety
> > > of other reasons, but guess it also may have gotten around this
> > > problem.
>
> > > Alternatively, post as much code as you can and I'll see if anything
> > > else rings a bell, early on I spent a frustrated day or two working
> > > around this exception in a variety of places so know it can be
> > > frustrating.
>
> > > -C
>
> > > On Jun 3, 6:33 am, JD  wrote:
>
> > > > I added a call to flush() after every change on the PM-managed object,
> > > > but that did not help.
>
> > > > Also doing a pm.flush() does not throw this exception, but doing a
> > > > pm.close() does - which seems to be contrary to your reasoning (I
> > > > would expect flush to throw the same exception if multiple entity
> > > > groups were at cause).
>
> > > > On Jun 3, 1:33 am, Millisecond  wrote:
>
> > > > > Even though you're not using transactions, I think it's trying to
> > make
> > > > > the .close() call atomic (maybe with an internal implicit
> > > > > transaction), failing or succeeding as a whole.  And as I understand
> > > > > it, entities not in the same group can be stored on separate machines
> > > > > so can't be operated on atomically.
>
> > > > > I've worked around this by calling a flush() after most any change on
> > > > > a PM-managed object until close().  If this has a huge number of
> > reqs/
> > > > > s, you may want to re-architect to get the objects in the same entity
> > > > > group as multiple flushes won't be very efficient.
>
> > > > > -C
>
> > > > > On Jun 2, 8:26 pm, JD  wrote:
>
> > > > > > I have a PersistenceManager
>
> > > > > > PersistenceManager pm = PMF.get().getPersistenceManager();
>
> > > > > > which I use to do a bunch of operations on different objects, but
> > > > > > WITHOUT transaction (run queries, store entities and lookup
> > entities).
>
> > > > > > I then close the manager with pm.close() and get this obscure error
> > > > > > that complains about multiple entity groups inside a transaction
> > even
> > > > > > though I am not using a transaction (you will notice that the error
> > is
> > > > > > not the usual one where it prints the different entity groups).
>
> > > > > > I am not 100% confident but have the impression that this error
> > > > > > started happening with the 1.3.4 release.
> > > > > > 100% reproducible use case. Would appreciate input from App Engine
> > > > > > developers.
>
> > > > > > com.myapp.servlet.task.PopulateUserPages doAction: Illegal argument
> > > > > > javax.jdo.JDOFatalUserException: Illegal argument
> > > > > >         at
>
> > org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(Nuc
> > leusJDOHelper.java:
> > > > > > 344)
> > > > > >         at
>
> > org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:
> > > > > > 281)
> > > > > >         at
> > com.myapp.dao.jdo.DatastoreService.release(DatastoreService.java:
> > > > > > 631)
> > > > > >         at
>
> > com.myapp.servlet.AbstractBaseServlet.releaseService(AbstractBaseServlet.j

[appengine-java] Re: Error while downloading Data

2010-06-21 Thread jd
Hi Manish,

You might want to try the RemoteDatastore to download or upload you
data to a remote application.

http://code.google.com/p/remote-datastore/

You install it somewhere that will only be run once like this:

// install api proxy in app init code
RemoteDatastore.install();

// divert the datastore to read in bulk from remote app
RemoteDatastore.divert("http://myversion.latest.myapp.appspot.com/
remote/datastore");

// read using JDO, Twig, Objectify, low-level
List hotels = datastore.find()
.type(Hotel.class)
.returnAllResultsNow();

// switch back to local datastore
RemoteDatastore.bypass();

// save data locally or process
datastore.storeAll(hotels);


Hope this helps,

John

On Jun 21, 6:41 pm, MANISH DHIMAN  wrote:
> Hi all
> I have deployed a Java application and a Python application on app
> engine. Both having different version number. I was not able to
> integrate my Java app with Python bulk loader that's why I have
> deployed a Python application with different version number in order
> to download data.But when I try to download data following exception
> occurred :
>
> D:\programs\Google\google_appengine>Python appcfg.py download_data --
> url=http://latest.datamigration.appspot.com/remote_api--
> filename=users
> appcfg.py:41: DeprecationWarning: the sha module is deprecated; use
> the hashlib module instead
>   os.path.join(DIR_PATH, 'lib', 'antlr3'),
> D:\programs\Google\google_appengine\google\appengine\tools
> \dev_appserver_login.py:33: DeprecationWarning: the md5 module is
> deprecated; use hashlib instead
>   import md5
> Downloading data records.
> [INFO    ] Logging to bulkloader-log-20100621.163244
> [INFO    ] Throttling transfers:
> [INFO    ] Bandwidth: 25 bytes/second
> [INFO    ] HTTP connections: 8/second
> [INFO    ] Entities inserted/fetched/modified: 20/second
> [INFO    ] Batch Size: 10
> [INFO    ] Opening database: bulkloader-progress-20100621.163244.sql3
> [INFO    ] Opening database: bulkloader-results-20100621.163244.sql3
> [INFO    ] Connecting to latest.datamigration.appspot.com/remote_api
> [ERROR   ] Exception during authentication
> Traceback (most recent call last):
>   File "D:\programs\Google\google_appengine\google\appengine\tools
> \bulkloader.py", line 3169, in Run
>     self.request_manager.Authenticate()
>   File "D:\programs\Google\google_appengine\google\appengine\tools
> \bulkloader.py", line 1178, in Authenticate
>     remote_api_stub.MaybeInvokeAuthentication()
>   File "D:\programs\Google\google_appengine\google\appengine\ext
> \remote_api\remote_api_stub.py", line 542, in
> MaybeInvokeAuthentication
>     datastore_stub._server.Send(datastore_stub._path, payload=None)
>   File "D:\programs\Google\google_appengine\google\appengine\tools
> \appengine_rpc.py", line 346, in Send
>     f = self.opener.open(req)
>   File "D:\programs\Python26\lib\urllib2.py", line 391, in open
>     response = self._open(req, data)
>   File "D:\programs\Python26\lib\urllib2.py", line 409, in _open
>     '_open', req)
>   File "D:\programs\Python26\lib\urllib2.py", line 369, in _call_chain
>     result = func(*args)
>   File "D:\programs\Python26\lib\urllib2.py", line 1161, in http_open
>     return self.do_open(httplib.HTTPConnection, req)
>   File "D:\programs\Python26\lib\urllib2.py", line 1136, in do_open
>     raise URLError(err)
> URLError: 
> [INFO    ] Authentication Failed

-- 
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: Loading request timings

2010-06-22 Thread jd
BTW, should it not be necessary to minimise dependencies?  Would love
some more details on how this should work!  e.g. do you load an entire
jar on demand from some shared repo based on a hash - or individual
classes?

On Jun 22, 10:39 am, John Patterson  wrote:
> Hi Toby,
>
> The web app does not actually use any of the code in the additional  
> jars.  I've created an issue here with the zipped webapp and links to  
> the deployed large and normal versions.
>
> http://code.google.com/p/googleappengine/issues/detail?id=3378
>
> On 22 Jun 2010, at 05:13, Toby Reyelts wrote:
>
>
>
> > Hey John,
>
> > Nice tests. For the apps where you added a lot of jars, are you  
> > running any code at all from any of those jar files, or do they just  
> > sit unused in your webapp? It's certainly not our intent that unused  
> > jar files cause any extra delay in loading. If you can provide us  
> > with the sample webapps that demonstrate this latency, then we might  
> > be able to look into it further.
>
> > On Sun, Jun 20, 2010 at 4:09 AM, John Patterson  
> >  wrote:
> > Hi All,
>
> > Just thought I would share some timings I have made to determine  
> > what effect adding dependencies has on loading request time.
>
> > I made four apps using the Eclipse plugin and modified 3 of them to  
> > add or remove jars from the war/WEB-INF/lib directory.
>
> > Normal - default jars (13.2 MB)
> > Small - removed all persistence related jars leaving two GAE API  
> > jars (10.2 MB)
> > Large - added lots of jars from various projects (51MB)
>
> > Very basic testing procedure - I would just wait a few minutes and  
> > reload the Hello world servlet.  Normally one minute was long enough  
> > to cause a loading request.  However I did notice that waiting  
> > longer (5 mins) seemed to cause a longer wall clock time - perhaps  
> > there are several layers of caching for app resources that can expire.
>
> > Averages discard the highest timings:
>
> >                Total ms                CPU ms
> > Small   4079            501
> >                514                     501
> >                598                     535
> >                541                     552
> >                617                     518
> >                664                     535
> >                _
> >                587                     528
>
> > Normal  739                     585
> >                656                     535
> >                636                     585
> >                595                     552
> >                598                     535
> >                621                     552
> >                1148            552
> >                _
> >                640                     556
>
> > Large   2274            1372
> >                1155            1171
> >                2690            1422
> >                4064            1255
> >                1906            1272
> >                1077            1188
> >                2817            1355
> >                __
> >                1986            1296
>
> > Some things to notice:
>
> > 1 - Often the CPU ms (which comes off your quota) often has the same  
> > value. e.g. 535ms and 552ms each appear four times.  That seems to  
> > indicate that some discreet function is used to calculate the cost  
> > of loading your app.
>
> > 2 - It seems that each 1MB of dependencies added takes about 35ms of  
> > clock time to load and adds about 19ms to your CPU quota.  However,  
> > this figures will probably vary depending on if the file is already  
> > loaded (by another app?) and possibly other factors.  It is also  
> > possible that the extra load time is related to the number of jars  
> > rather than just their size.
>
> > 3 - removing the standard persistence jars does seem to have some  
> > effect
>
> > 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-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-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 
googl

[appengine-java] Re: Best performance for deleting and inserting entities

2010-07-10 Thread jd


On Jul 11, 4:23 am, John Patterson  wrote:
> It is about the same speed.  I've just uploaded 500,000 entities in  
> The new Mapping API sounds like the ideal solution but it is python  
> only at the moment.  

Oops no it is also available for Java now!

http://code.google.com/p/appengine-mapreduce/

-- 
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: Highly Frustrated By Entity Groups / Transactions

2010-07-27 Thread jd


On Jul 27, 5:24 pm, Bill  wrote:
> Not in order, it can't.  The parent must know the children in order to
> accomplish that.

Try putting some kind of index in the child - a time stamp or order
field (100, 200...)


> > Sounds like you have architected your solution to do too much in a  
> > single transaction which is just not performant (or possible) with the  
> > datastore.  Time to re-think how you demarcate transactions.
>
> The idea that a single, simple bounds check is "too much" is ludicrous
> -- especially given the fact that the datastore isn't doing this
> bounds check automatically as would an RBDMS.

Your blender doesn't do bounds checks either.  Repeat: the datastore
is not an RDBMS.  The Google engineers have always taken care to point
out this fact.

> > The datastore is not an RDBMS.  There are certain domain models which  
> > simply will not work on the datastore.  If you cannot break down you  
> > data into small independent chunks your app will not work.
>
> At present I have a grand total of TWO entity classes, one of which
> refers to the other by an indirect key.  Pardon my language, but how
> friggin' broken down does it have to be before it becomes anything
> more than a toy??

You could make an infinitely complicated data structure with a single
model class - it is the data *structure* that you need to be able to
break down - not the model.  You need to get a bit creative to find
ways work within the capabilities of the datastore.

> Fine.  Meanwhile I'm demanding an answer from Google as to why this
> sorry state of affairs.  Max Ross, where are you?

Demanding an apple to become an orange does not make it so.  Not even
Max Ross can pull that one off (I assume).


> > In order to check that there is no existing entity with the same key  
> > before writing an entity the load must be a part of the transaction or  
> > another request could store an entity with the same key before you  
> > committed - clobber.
>
> Logically this absolutely does not hold water, if the retrieve
> operation falls within one entity group, and the insert/update happens
> in a completely different entity group.

In that case they could not possibly have the same key... as you know
you must be dealing with entities in a single entity group.

> this product will ultimately fail in the marketplace because
> the costs of hacking a problem to fit your idea of a solution, rather
> than adapting your tool to a problem, will be far too high.

Looks like you've made your assessment.  It is true that more time is
required to make apps work with these restrictions.  If this extra
cost outweighs the other benefits then simply don't use the platform.
For a large class of applications it already works very well and is
improving at an amazing pace.

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