Re: [appengine-java] How to query objects with criterias defined in child entities

2010-03-10 Thread Jeff Schnitzer
On Tue, Mar 9, 2010 at 8:47 PM, John Patterson jdpatter...@gmail.com wrote:
 For the sake of comparison, see below for the Twig equivalent

 class UserSkill {
       �...@parent User user;
        String skill
        int ability;
 }

 Note that no key is required and user is referenced directly so your model
 has no dependency on the low-level datastore

...and instead must make two fetches every time you load a UserSkill
object.  Is it at least smart enough to do all the parent fetching as
a single batch get?  Does a put() on an entity cascade to its parent?

Claiming that Twig is the only datastore interface to support...Plain
old Java object data models with no datastore dependencies is really
too much.  All that you can honestly say is that Twig lets you avoid
datastore dependencies...except when you can't.  The same can be said
for JDO or Objectify.

Can you avoid a Key reference if you don't want to perform two fetches
for every single load of a parented object?

Can you avoid a Key reference if you don't want to eager-load a
collection of entities?

Can you avoid a Key reference if you have a one-to-many relationship
where the many-side might have 5001 values?

If you really want to avoid Key objects, you'll probably get a lot
farther with DataNucleus' support for collection proxies.  But I doubt
either will let you build efficient real-world applications completely
without relying on a few Key references.

Incidentally, you can generally avoid Key references using Objectify
if you so choose.  Keys only become mandatory when you are dealing
with parented entities -- which should be used infrequently for
performance reasons.  There's no reason you can't just use simple ids
as foreign key references.

 IteratorUser users = datastore.find()
        .type(UserSkill.class)
        .addFilter(skill, EQUAL, java)
        .addFilter(ability, GREATER_THAN, 5)
        .returnParentsNow();

 This is how easy it is to use Relation Index Entities with the new release
 of Twig

While I'm solidifying the opinion that the RIE pattern is actually
pretty useless, being able to fetch parent keys (or parents) does seem
to come up enough that we may add a shorthand for it:

IterableUser users = ofy.query(UserSkill.class).filter(skill,
java).filter(ability , 5).fetchParents();

Note that anyone can trivially fabricate their own implementation of
this boilerplate right now using Objectify's QueryWrapper class.

 Behind the scenes two queries are run *in parallel* asynchronously and then
 merged together into a single Iterator.  Notice also that the two queries
 both inherit the common filter and sort on ability.

This does seem quite interesting, and I congratulate you for working
out the underlying details :-)

The question I have is for our Google overlords:  Why isn't the Java
SDK opensourced like the Python implementation?  Yes, the DN plugin is
opensource, but that's the least interesting part!

Jeff

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



[appengine-java] 5 warmups required before success

2010-03-10 Thread Jorge
This is silly, but yesterday night it worked!

My app runs a cron job everyday at 2am my time (8:00 GMT). Often the
job fails because of a timeout. You know, those timeouts one gets
because the virtual server won't start.

Then I tried this silly solution. I run 5 dummy jobs 5, 4, 3, 2 and 1
minutes before the real one.

Very funny, but yesterday night the 5 dummy jobs failed. Nevertheless,
the real cron job started and ran OK!!!

Come on, Google! This timeout problem has taken way too long to be
solved. We were planning on going live with out app next Quarter. Now
we are evaluating alternatives to move to another platform. We have
spent over 6 months working on GAE and it looks like a wasted effort.

/cronjob/DummyJob
GAE warm up before recording charges for overdue payments @ 08:00 GMT
every day 07:55 (UTC)
2010-03-10 07:55:02 on time Failed
/cronjob/DummyJob
GAE warm up before recording charges for overdue payments @ 08:00 GMT
every day 07:56 (UTC)
2010-03-10 07:56:02 2 secs late Failed
/cronjob/DummyJob
GAE warm up before recording charges for overdue payments @ 08:00 GMT
every day 07:57 (UTC)
2010-03-10 07:57:01 on time Failed
/cronjob/DummyJob
GAE warm up before recording charges for overdue payments @ 08:00 GMT
every day 07:58 (UTC)
2010-03-10 07:58:01 on time Failed
/cronjob/DummyJob
GAE warm up before recording charges for overdue payments @ 08:00 GMT
every day 07:59 (UTC)
2010-03-10 07:59:01 on time Failed
/cronjob/PaymentsOverdueCharge
Record charges for overdue payments @ 08:00 GMT every day 08:00 (UTC)
2010-03-10 08:00:01 on time Success

Jorge Gonzalez

-- 
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: Extending GAE's Jetty config

2010-03-10 Thread alesj
OK, filled this here:
* http://code.google.com/p/googleappengine/issues/detail?id=2943

On Mar 9, 8:21 pm, Don Schwarz schwa...@google.com wrote:
 No, at the moment we specifically disable jetty-web.xml for security
 purposes.  Feel free to file a feature request in our issue tracker asking
 us to re-enable it.

 On Tue, Mar 9, 2010 at 9:52 AM, alesj ales.jus...@gmail.com wrote:
  Does GAE use JettyWebXmlConfiguration to allow for WebAppContext
  custom configuration - via jetty-web.xml?
  I see that class in appengine-local-runtime.jar, but is it part of
  Jetty' default Configuration instances?
  My guess would be no, as putting invalid jetty-web.xml in WEB-INF
  doesn't output any exception.

  This would be useful to allow for different extensions; e.g. custom
  injection support -- jsr299/CDI.

  -Ales

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

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



[appengine-java] Re: serialization doubt...

2010-03-10 Thread Prashant Gupta
anyone...?

-- 
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: 5 warmups required before success

2010-03-10 Thread Nacho Coloma
Actually this is the one and single thing that makes my GAE experience
kind of bittersweet. I am still recommending the platform to friends
and colleagues, but mentioning the cold start problem up front.

Setting this feature/bug to high priority would be most welcome. I
think this is the most followed issue in GAE ever.

On Mar 10, 12:48 pm, Jorge athenas...@gmail.com wrote:
 This is silly, but yesterday night it worked!

 My app runs a cron job everyday at 2am my time (8:00 GMT). Often the
 job fails because of a timeout. You know, those timeouts one gets
 because the virtual server won't start.

 Then I tried this silly solution. I run 5 dummy jobs 5, 4, 3, 2 and 1
 minutes before the real one.

 Very funny, but yesterday night the 5 dummy jobs failed. Nevertheless,
 the real cron job started and ran OK!!!

 Come on, Google! This timeout problem has taken way too long to be
 solved. We were planning on going live with out app next Quarter. Now
 we are evaluating alternatives to move to another platform. We have
 spent over 6 months working on GAE and it looks like a wasted effort.

 /cronjob/DummyJob
 GAE warm up before recording charges for overdue payments @ 08:00 GMT
 every day 07:55 (UTC)
 2010-03-10 07:55:02 on time Failed
 /cronjob/DummyJob
 GAE warm up before recording charges for overdue payments @ 08:00 GMT
 every day 07:56 (UTC)
 2010-03-10 07:56:02 2 secs late Failed
 /cronjob/DummyJob
 GAE warm up before recording charges for overdue payments @ 08:00 GMT
 every day 07:57 (UTC)
 2010-03-10 07:57:01 on time Failed
 /cronjob/DummyJob
 GAE warm up before recording charges for overdue payments @ 08:00 GMT
 every day 07:58 (UTC)
 2010-03-10 07:58:01 on time Failed
 /cronjob/DummyJob
 GAE warm up before recording charges for overdue payments @ 08:00 GMT
 every day 07:59 (UTC)
 2010-03-10 07:59:01 on time Failed
 /cronjob/PaymentsOverdueCharge
 Record charges for overdue payments @ 08:00 GMT         every day 08:00 (UTC)
 2010-03-10 08:00:01 on time Success

 Jorge Gonzalez

-- 
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] Why I encountered this error : The class java.lang.String is not persistable.

2010-03-10 Thread Jolam
I have defined a class :

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@SuppressWarnings(serial)

@PersistenceCapable(identityType = IdentityType.APPLICATION,
detachable=true)
public class UrlInformation implements Serializable{

@PrimaryKey
private String key;

@Persistent
private String url = new String();

@Persistent
private String code = new String();

@Persistent
private boolean isBlocked = false;

//get and set methods

}

when i try to make it persistent, i encounter this :

HTTP ERROR: 500

The class The class java.lang.String is not persistable. This means
that it either hasnt been enhanced, or that the enhanced version of
the file is not in the CLASSPATH (or is hidden by an unenhanced
version), or the Meta-Data/annotations for the class are not found.
is not persistable. This means that it either hasnt been enhanced, or
that the enhanced version of the file is not in the CLASSPATH (or is
hidden by an unenhanced version), or the Meta-Data for the class is
not found.

RequestURI=/initserver
Caused by:

org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException:
The class The class java.lang.String is not persistable. This means
that it either hasnt been enhanced, or that the enhanced version of
the file is not in the CLASSPATH (or is hidden by an unenhanced
version), or the Meta-Data/annotations for the class are not found.
is not persistable. This means that it either hasnt been enhanced, or
that the enhanced version of the file is not in the CLASSPATH (or is
hidden by an unenhanced version), or the Meta-Data for the class is
not found.
at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:
241)
at
org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:
674)
at
org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:
694)
at tk.jo32.s.util.UrlConverter.shorten(UrlConverter.java:26)
at tk.jo32.s.operation.InitServlet.doGet(InitServlet.java:22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
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
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.headerComplete(HttpConnection.java:830)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
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
$PoolThread.run(BoundedThreadPool.java:442)

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



Re: [appengine-java] How to query objects with criterias defined in child entities

2010-03-10 Thread John Patterson
Hi Jeff, some of your concerns would have been valid with the pre- 
release versions but not with the final release 1.0 of Twig.  See  
below for explanations


On 10 Mar 2010, at 16:14, Jeff Schnitzer wrote:

On Tue, Mar 9, 2010 at 8:47 PM, John Patterson  
jdpatter...@gmail.com wrote:

For the sake of comparison, see below for the Twig equivalent

class UserSkill {
   @Parent User user;
   String skill
   int ability;
}

Note that no key is required and user is referenced directly so  
your model

has no dependency on the low-level datastore


...and instead must make two fetches every time you load a UserSkill
object.


No that is incorrect.  You actually have very fine control over what  
is loaded and when using activation [1]


Firstly,  the relationship you ask about @Parent User user is  
absolutely not even required in this example.  Although Objectify  
requires the parent field, Twig does not.  The returnParentsNow()  
method works perfectly fine without it.  I was just showing how much  
cleaner the exact equivalent code was with Twig.


Because the field is not needed, obviously the developer would only  
add that field as a convenience if they actually needed to access the  
parent.


Secondly, even if the developer only wanted some of the parents  
directly they could still add the field and not activate it:


class UserSkill {
   @Activate(0) @Parent User user;
   String skill
   int ability;
}

Now the field contains an unactivated instance that does not require  
a fetch at all - the key is cached with a weak reference so when you  
want to activate the instance just call refresh(user).  Convenient and  
efficient.




Is it at least smart enough to do all the parent fetching as
a single batch get?


Yes it is at least that smart :)   Parents are fetched in a single  
batch using the exact same chunk-size as the child elements.   See  
PrefetchParentInstanceIterator for details.



Does a put() on an entity cascade to its parent?


Storing any instance cascades to every reachable instance irrespective  
of the relationship.  An instance can only be stored once so if the  
parent is already persistent it will not be stored again.


This is one of my gripes with the Objectify API - there is no  
distinction between store and update which makes it easy to  
accidentally clobber existing data.  The two actions are very  
different in intent and should be different methods.


Not only is the parent fetch efficient but it is much more readable.   
Sorry Jeff, but this is just a train wreck:



Objectify :







ListKeyUser userKeys = new ArrayListKeyUser();
for (KeyUserSkill key: ofy.query(UserSkill.class).filter(skill,
java).filter(ability , 5).fetchKeys())
   userKeys.add(key.getParent());

CollectionUser users = ofy.get(userKeys).values();



Do you really expect your maintenance developer to understand that in  
2 years time?  Im sure complex queries become even more convoluted.


I notice you return an Iterable rather than an Iterator.  The problem  
with this is that every time the Iterable is accessed the query is  
executed again.  A little dangerous and non-obvious in my opinion.


Now without keys this is much more readable - almost like a sentence:


Twig:




IteratorUser users = datastore.find()
   .type(UserSkill.class)
   .addFilter(skill, EQUAL, java)
   .addFilter(ability, GREATER_THAN, 5)
   .returnParentsNow();



You really get the best of both worlds - precise control over fetching  
and readability.


Finally on this point, even if the parent property is not defined it  
is always possible to get the Key that is related to that instance  
using associatedKey(Object) and then load the parents directly by  
Key - just like Objectify - although I would not recommend this.




Claiming that Twig is the only datastore interface to support...Plain
old Java object data models with no datastore dependencies is really
too much.


Really?  I thought it was very simple.  Twig uses Pojos with no  
dependencies, the others don't!  Can you give an example of a Twig  
data model that depends on the datastore?  You are not confusing data  
model with DAO code are you?



All that you can honestly say is that Twig lets you avoid
datastore dependencies...except when you can't.


You will have to clarify what you mean by except when you can't.   
There is no reason to have any dependency on the datastore in a Twig  
data model.



The same can be said
for JDO or Objectify.


Neither JDO or Objectify support direct unowned relationships which  
makes your models dependent on the datastore.  Also, Objectify  
requires every persistent instance to define a key - this means that  
no class can be persisted unless it is specifically designed to be a  
data model class.  The simple examples above show this nicely.


I could go into how Twigs TypeConverter framework makes it easy to  
convert any user type into datastore types without the need for any  

[appengine-java] what if I hit memory limit ?

2010-03-10 Thread Prashant Gupta
Hi,

I have designed my app to keep data (within servlet env.) for all previous
requests. For each request it will first search the data in servlet env.
store, if it doesn't find the data here it will fetch data from datastore
and append the same to servlet env. store. So, if the same servlet lives
for longer duration it might accumulate lots of data. What's the risk here?
What's the upper limit of memory use? What will happen if my app hit this
upper limit?

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] Anyone a working example how to build a Java app running on App Engine integrated with Apps Marketplace?

2010-03-10 Thread dflorey
Most interesting:

- How to deploy the app? Restrict to a target domain or not?
- How to integrate Step2 to retrieve user information
- How to use 2-legged OAuth in conjunction with Step2/App Marketplace

Any ideas?

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



Re: [appengine-java] what if I hit memory limit ?

2010-03-10 Thread Stephan Hartmann
You should use memcache instead of your servlet env. The memcache service
will evict values if you run out of memory.


2010/3/10 Prashant Gupta nextprash...@gmail.com

 Hi,

 I have designed my app to keep data (within servlet env.) for all previous
 requests. For each request it will first search the data in servlet env.
 store, if it doesn't find the data here it will fetch data from datastore
 and append the same to servlet env. store. So, if the same servlet lives
 for longer duration it might accumulate lots of data. What's the risk here?
 What's the upper limit of memory use? What will happen if my app hit this
 upper limit?

 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.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


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



Re: [appengine-java] what if I hit memory limit ?

2010-03-10 Thread Prashant Gupta
yes, you are right.

But, in my case, suppose each request requires 100 entities to be fetched
and for any two requests say 90-95 entities are common. So, if I use only
memcache for caching, 100 memcache fetch will be required per request. Or,
if I keep the data in servlet env. for each req., 10-0 memcache fetch will
be required per request.

-- 
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] @Google: Are you working on UserService running with OpenId?

2010-03-10 Thread dflorey
If yes, I can sit down and wait. If not, I have to keep on my fight
with getting Step2 running on App Engine...

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



Re: [appengine-java] what if I hit memory limit ?

2010-03-10 Thread Prashant Gupta
Thanks Don for clarification.

100MB seems sufficient for me. Please suggest me a library for LRU caching
implementation.

-- 
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] Discussie op will-it-play-in-app-engine

2010-03-10 Thread Cyberrat
Primefaces (combined with JSF2.0) is also working here

-- 
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] Help with modeling JDO persistent classes

2010-03-10 Thread kattus
Hi,

I have 2 persistent classes:

1. class A that has a primary key (Long) and a property called
name (String).
2. class B that is referencing class A (one to many relationship, each
B has one A, but A can belong to many B's)

I need to retrieve the B's sorted by the name property of A. In
other words if it was relational database I would make something like
this (simplified):

SELECT * FROM A, B WHERE A.id=B.Aid ORDER BY A.name

The question is how to make this with JDO. I don't want to make A and
B in the same entity group and it seams it is not necessary either, I
think using unowned relationships may be a good direction, the help is
too basic though:

http://code.google.com/appengine/docs/java/datastore/relationships.html#Unowned_Relationships

The questions are:

Is it possible to define such a relationship between A and B? If yes
how (which annotations)? Do I have to use the Key class in B to
reference A?
How to use the Google query language to write the correct query?

Thank you,
Gil

-- 
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] Reporting on GAE in Java

2010-03-10 Thread David
Hi all,

I'm in the process of porting a small java webapp to GAE and I've
encountered an issue around my use of JasperReports.

I've solved (I think) the original issue I had of how to get the data
into the report by passing a collection of JavaBeans rather than a
JDBC connection.

However I'm now facing the following error message:
WARNING: Error for /PODEntry
java.lang.NoClassDefFoundError: java.awt.GraphicsEnvironment is a
restricted class. Please see the Google  App Engine developer's guide
for more details.
at
com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:
51)
at
net.sf.jasperreports.engine.util.JRStyledTextParser.clinit(JRStyledTextParser.java:
87)
snip

Is there a workaround I can use to keep using JasperReports?
Alternatively is there another reporting package that I could use
instead (ideally I'd like to be able output the report in both HTML
and PDF format)?

Thanks for your help/comments/suggestions.

Cheers,
David

PS Couple of related threads which I tracked down but didn't answer my
questions (they seem to be focusing on issues with retrieving the data
rather than problems generating the report output):
http://groups.google.com/group/google-appengine-java/browse_thread/thread/92b811677670bf0e/bcc733f8488d1222?lnk=gstq=reporting#bcc733f8488d1222
http://groups.google.com/group/google-appengine-java/browse_thread/thread/58bf7d3a3b4458ea/1b533547d8ab6b30?lnk=gstq=reporting#1b533547d8ab6b30

-- 
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] Where can i specify my log file name in Google Web App ?

2010-03-10 Thread Mallikarjun Kokatanur
Hi All,

Can you tell me where can specify my log file in my new Google Web
App.
Is it Log4j.properties file or logging.properties file? and also tell
me how can i make to work?

Thanks in advance.

- MallikarjunBK

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



[appengine-java] Re: news on remote_api for java ?

2010-03-10 Thread Steve Osborne
I too would like to be able to use Java to upload data to the
datastore, either from a file or from a jdbc connection. Any
development on providing us with some sample code for the
RemoteApiServlet while creating the docs?

On Feb 24, 7:37 pm, Ikai L (Google) ika...@google.com wrote:
 You should be able to connect this:

 ?xml version=1.0 encoding=utf-8?
 web-app
   !-- Add this to your web.xml to enable remote API on Java. --
   servlet
     servlet-nameremoteapi/servlet-name
     
 servlet-classcom.google.apphosting.utils.remoteapi.RemoteApiServlet/serv­let-class
   /servlet
   servlet-mapping
     servlet-nameremoteapi/servlet-name
     url-pattern/remote_api/url-pattern
   /servlet-mapping
   security-constraint
     web-resource-collection
       web-resource-nameremoteapi/web-resource-name
       url-pattern/remote_api/url-pattern
     /web-resource-collection
     auth-constraint
       role-nameadmin/role-name
     /auth-constraint
   /security-constraint
 /web-app

 I'll dig for some sample code for the Java bulkloader. We're working
 on official docs.





 On Tue, Feb 9, 2010 at 1:22 AM, emerix rafa...@gmail.com wrote:
  Hi,
  Does anybody have some news on the remote_api for java ? It would be
  great to be able to use our JDO/JPA objects to interact with the
  datastore without having to upload a version to appengine !

  Thanx :)
  emerix

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

 --
 Ikai Lan
 Developer Programs Engineer, Google App 
 Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine- Hide 
 quoted text -

 - Show quoted text -

-- 
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: 5 warmups required before success

2010-03-10 Thread Jorge
Hi Nacho,

I agree with you. GAE is great in many aspects. The cold-start/timeout
issue is probably my only concern, too. But the sad thing is that is
an absolute killer. Slow response times are a bad thing, but aborting
cron jobs because of virtual server start issues is unacceptable, at
least in my app. That makes my app completely unreliable, worthless,
so to speak.

Jorge Gonzalez


On Mar 10, 6:58 am, Nacho Coloma icol...@gmail.com wrote:
 Actually this is the one and single thing that makes my GAE experience
 kind of bittersweet. I am still recommending the platform to friends
 and colleagues, but mentioning the cold start problem up front.

 Setting this feature/bug to high priority would be most welcome. I
 think this is the most followed issue in GAE ever.

 On Mar 10, 12:48 pm, Jorge athenas...@gmail.com wrote:

  This is silly, but yesterday night it worked!

  My app runs a cron job everyday at 2am my time (8:00 GMT). Often the
  job fails because of a timeout. You know, those timeouts one gets
  because the virtual server won't start.

  Then I tried this silly solution. I run 5 dummy jobs 5, 4, 3, 2 and 1
  minutes before the real one.

  Very funny, but yesterday night the 5 dummy jobs failed. Nevertheless,
  the real cron job started and ran OK!!!

  Come on, Google! This timeout problem has taken way too long to be
  solved. We were planning on going live with out app next Quarter. Now
  we are evaluating alternatives to move to another platform. We have
  spent over 6 months working on GAE and it looks like a wasted effort.

  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:55 (UTC)
  2010-03-10 07:55:02 on time Failed
  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:56 (UTC)
  2010-03-10 07:56:02 2 secs late Failed
  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:57 (UTC)
  2010-03-10 07:57:01 on time Failed
  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:58 (UTC)
  2010-03-10 07:58:01 on time Failed
  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:59 (UTC)
  2010-03-10 07:59:01 on time Failed
  /cronjob/PaymentsOverdueCharge
  Record charges for overdue payments @ 08:00 GMT         every day 08:00 
  (UTC)
  2010-03-10 08:00:01 on time Success

  Jorge Gonzalez

-- 
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] Not able to write string arrays in data store

2010-03-10 Thread Ganesh
Hi,

I am trying to store two dimensional string array in google data
store. I was getting an exception saying this data type not supported.
I tried changing the string array object to java.util.arraylist (gave
serizable = 'true' option). This time I was able to write the data
successfully. But when I tried to retrieve it, I am facing null
pointer exception. Can any body help me with this?

-Thanks
Ganesh

-- 
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: 5 warmups required before success

2010-03-10 Thread Jorge
Hi Nacho,

I agree with you. GAE is great in many aspects. The cold-start/timeout
issue is probably my only concern, too. But the sad thing is that is
an absolute killer. Slow response times are a bad thing, but
exceptions in the cron jobs because of virtual server start issues is
unacceptable, at least in my app. That makes my app completely
unreliable, worthless, so to speak.

Jorge Gonzalez


On Mar 10, 6:58 am, Nacho Coloma icol...@gmail.com wrote:
 Actually this is the one and single thing that makes my GAE experience
 kind of bittersweet. I am still recommending the platform to friends
 and colleagues, but mentioning the cold start problem up front.

 Setting this feature/bug to high priority would be most welcome. I
 think this is the most followed issue in GAE ever.

 On Mar 10, 12:48 pm, Jorge athenas...@gmail.com wrote:

  This is silly, but yesterday night it worked!

  My app runs a cron job everyday at 2am my time (8:00 GMT). Often the
  job fails because of a timeout. You know, those timeouts one gets
  because the virtual server won't start.

  Then I tried this silly solution. I run 5 dummy jobs 5, 4, 3, 2 and 1
  minutes before the real one.

  Very funny, but yesterday night the 5 dummy jobs failed. Nevertheless,
  the real cron job started and ran OK!!!

  Come on, Google! This timeout problem has taken way too long to be
  solved. We were planning on going live with out app next Quarter. Now
  we are evaluating alternatives to move to another platform. We have
  spent over 6 months working on GAE and it looks like a wasted effort.

  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:55 (UTC)
  2010-03-10 07:55:02 on time Failed
  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:56 (UTC)
  2010-03-10 07:56:02 2 secs late Failed
  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:57 (UTC)
  2010-03-10 07:57:01 on time Failed
  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:58 (UTC)
  2010-03-10 07:58:01 on time Failed
  /cronjob/DummyJob
  GAE warm up before recording charges for overdue payments @ 08:00 GMT
  every day 07:59 (UTC)
  2010-03-10 07:59:01 on time Failed
  /cronjob/PaymentsOverdueCharge
  Record charges for overdue payments @ 08:00 GMT         every day 08:00 
  (UTC)
  2010-03-10 08:00:01 on time Success

  Jorge Gonzalez

-- 
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] Any plans for an apps marketplace for consumers, not business?

2010-03-10 Thread tempy
My question says it all.

I would love to leverage the centralized structure of the marketplace
and the enhanced user trust that it brings with my app, but what I am
working on is targeted at general consumers, not the enterprise
sector... Why not make something like the marketplace for the general
consumer?

-- 
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] Do I need unowned relationships to accomplish this...?

2010-03-10 Thread tempy
I have the following datastructure:

Users are the root entities, and each user can have one or more
decks, and each deck can have one or more cards.

When a user wants to add a deck, I would like to be able to add the
deck to the user's collection of decks without first fetching all of
the user's decks (potentially a large amount of data), then adding the
new deck to that collection, and then persisting the user.  Rather, I
would like to simply instantiate the deck and append it to the user's
collection of decks, without ever retrieving the entire collection.

Similarly, if a user wants to add a new card to an existing deck, I
would like to add the card to the deck without first retrieving the
entire deck (that is, the deck with all of its cards).

I would like to preserve the option of fetching a user with a
populated collection of all their decks and to retrieve a deck with a
populated collection of all its cards, which is possible with owned
relationships.  But to accomplish what I have mentioned above, would I
be forced to use unowned relationships? (Collections of keys instead
of collections of objects.)

Thanks,
Mike

-- 
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: 5 warmups required before success

2010-03-10 Thread Locke
I tell people to give appengine a try if they're using Python, but
that Java support isn't mature enough yet (for exactly this reason). I
also get the impression that Java start up times are getting slower,
or at least more varied; though I haven't been keeping stats over
time.

I'm sure google will get this sorted out eventually. Allowing us to
pay for at least one reserved java instance (with more spun up as
demand dictates) would seem to be a feasible solution.

-- 
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] datastore latency

2010-03-10 Thread Locke
The datastore latency graph is still broken (URI too long for Google
Charts):

http://code.google.com/status/appengine/detail/datastore/2010/03/10#ae-trust-detail-datastore-query-latency

In the periods when it works, it reports query latencies sometimes
over one second. The graph is usually accompanied by We have
determined that this spike did not affect the performance or uptime of
applications.

Really? One-second query latencies do not affect the performance ...
of applications?

Is it the case that query latencies which routinely exceed one second
are considered normal?

What is the difference between query latency and get/put/delete
latency? Does a database look-up involve both? Meaning: if there is a
400ms delete latency and a 900ms query latency, will my users have to
wait 1.3 seconds for a database call which causes a delete?

-- 
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: Do I need unowned relationships to accomplish this...?

2010-03-10 Thread WillSpecht
The way I understand it, if an object can be owned by more than one
object it must be unowned.  I would assume that cards can be in
multiple decks so they must be unowned.  I would assume each deck
would belong to one user so decks could be owned.  I don't know a good
way to store cards that can be queried in one query unless you have
each card store what decks they are in.  This could be even more
difficult if cards appear more than once in a deck.  If that is true I
would suggest a join table.

On Mar 10, 2:20 pm, tempy fay...@gmail.com wrote:
 I have the following datastructure:

 Users are the root entities, and each user can have one or more
 decks, and each deck can have one or more cards.

 When a user wants to add a deck, I would like to be able to add the
 deck to the user's collection of decks without first fetching all of
 the user's decks (potentially a large amount of data), then adding the
 new deck to that collection, and then persisting the user.  Rather, I
 would like to simply instantiate the deck and append it to the user's
 collection of decks, without ever retrieving the entire collection.

 Similarly, if a user wants to add a new card to an existing deck, I
 would like to add the card to the deck without first retrieving the
 entire deck (that is, the deck with all of its cards).

 I would like to preserve the option of fetching a user with a
 populated collection of all their decks and to retrieve a deck with a
 populated collection of all its cards, which is possible with owned
 relationships.  But to accomplish what I have mentioned above, would I
 be forced to use unowned relationships? (Collections of keys instead
 of collections of objects.)

 Thanks,
 Mike

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



Re: [appengine-java] Stripes + FreeMarker throwing exception on GAE

2010-03-10 Thread Toby Reyelts
Can you send me your application id, please?

On Tue, Mar 9, 2010 at 10:48 AM, rmurta rmu...@gmail.com wrote:

 My application uses Stripes and Freemarker. I am already using the
 freemarker jar version build to gae.
 Application is working fine in the test GAE Server in my local but
 when I deploy it I start to get the error bellow. Can anyone help me?


 03-09 07:13AM 43.981 /Login.action 500 6043ms 7525cpu_ms 0kb Mozilla/
 5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like
 Gecko) Chrome/4.0.249.89 Safari/532.5,gzip(gfe)
 201.58.206.222 - - [09/Mar/2010:07:13:50 -0800] GET /Login.action
 HTTP/1.1 500 0 - Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
 AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/
 532.5,gzip(gfe) cycling-training.appspot.com
 W 03-09 07:13AM 49.961
 Nested in net.sourceforge.stripes.exception.StripesServletException:
 Unhandled exception in exception handler.:
 java.lang.VerifyError: (class: freemarker/ext/jsp/
 FreeMarkerJspApplicationContext, method: init signature: ()V)
 Incompatible argument to function
at
 com.google.appengine.runtime.Request.process-95a1f5578f21927c(Request.java)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:109)
at freemarker.ext.jsp.FreeMarkerJspFactory21.class$
 (FreeMarkerJspFactory21.java:13)
at

 freemarker.ext.jsp.FreeMarkerJspFactory21.clinit(FreeMarkerJspFactory21.java:
 12)
at

 freemarker.ext.jsp.FreeMarkerPageContext21.clinit(FreeMarkerPageContext21.java:
 30)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:109)
at

 freemarker.ext.jsp.PageContextFactory.getPageContextImpl(PageContextFactory.java:
 21)
at
 freemarker.ext.jsp.PageContextFactory.clinit(PageContextFactory.java:
 15)
at
 freemarker.ext.jsp.TagTransformModel.getWriter(TagTransformModel.java:
 99)
at freemarker.core.Environment.visit(Environment.java:286)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:256)
at
 freemarker.ext.servlet.FreemarkerServlet.process(FreemarkerServlet.java:
 452)
at
 freemarker.ext.servlet.FreemarkerServlet.doGet(FreemarkerServlet.java:
 391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
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
 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 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
 

Re: [appengine-java] How to query objects with criterias defined in child entities

2010-03-10 Thread Jeff Schnitzer
On Wed, Mar 10, 2010 at 6:14 AM, John Patterson jdpatter...@gmail.com wrote:

 No that is incorrect.  You actually have very fine control over what is
 loaded and when using activation [1]

Ah, this Activation annotation does help out.  But it still leaves
edge cases (read on).

I also don't think it really improves the the code as much as you
think it does.  In a real application (not a contrived one-line
example), I believe the Objectify code will be easier to write, easier
to read, and easier to understand what is going on under the covers.

And all this obsession with @Parent seems to me a bit odd, since in a
real application @Parent should be fairly rare.  Composite entity
groups inhibit performance and don't really buy you much.  Most
applications are better off with every entity as a root.

 Now the field contains an unactivated instance that does not require a
 fetch at all - the key is cached with a weak reference so when you want to
 activate the instance just call refresh(user).  Convenient and efficient.

I have to admit that you've lost me here.  Objectify has, basically,
four methods:  get(), put(), delete(), and query().  They work exactly
the way you would expect.

Twig adds quite a few API methods and the docs don't make it clear
what they do.  What are refresh(), update(), storeOrUpdate(),
associate(), and disassociate()?  Twig seems to lack javadocs.

So, let's take this Twig example:

class Car {
@Key String key;
@Activate(0) Person owner;
}

How do you implement this method?

public static Person getOwner(String carKey) {
...
}

 Does a put() on an entity cascade to its parent?

 Storing any instance cascades to every reachable instance irrespective of
 the relationship.  An instance can only be stored once so if the parent is
 already persistent it will not be stored again.

Would you explain this in detail?  I thought Twig doesn't do dirty
checking.  Given our User/UserSkill example, let's say you want to:

load a UserSkill
set the ability of UserSkill to 11
set the User's nickname to Java Master
save the entities

Does a save of the UserSkill cascade to the User?  Whatever the
answer, what do people who want the other behavior do?  There is a
reason JDO  JPA have all those cascade options.

 This is one of my gripes with the Objectify API - there is no distinction
 between store and update which makes it easy to accidentally clobber
 existing data.  The two actions are very different in intent and should be
 different methods.

You'll have to explain this one.  It seems extraordinarily difficult
to clobber existing data in Objectify.  There is only a put() method.
If you have an object with an id, it will save over the old object
with that id.  Null ids will produce a new generated id.  I can't
imagine what could be less confusing.

This is particularly handy with integer natural keys - if you make
your id value a long primitive type, it will never be generated.  If
you put entity with id 5, you save id 5.  Just like any other hash
map.

 Not only is the parent fetch efficient but it is much more readable.  Sorry
 Jeff, but this is just a train wreck:

 Objectify :

 ListKeyUser userKeys = new ArrayListKeyUser();
 for (KeyUserSkill key: ofy.query(UserSkill.class).filter(skill,
 java).filter(ability , 5).fetchKeys())
    userKeys.add(key.getParent());

 CollectionUser users = ofy.get(userKeys).values();

 Do you really expect your maintenance developer to understand that in 2
 years time?  Im sure complex queries become even more convoluted.

This is absurd.  It's four lines of boilerplate that is easily wrapped
in a DAO to deal with a use case that doesn't seem to actually be all
that common.  The only reason we haven't added this trivial
convenience method to Query is because nobody has asked for it, and we
have a general policy of not bloating our API with methods that nobody
uses.

Nevertheless, since this triviality seems to come up on mailing list
discussions, we're probably going to add the fetchParents() method:

IterableUser users = ofy.query(UserSkill.class).filter(skill,
java).filter(ability , 5).fetchParents();

Even without this method, in the real world your code looks like this:

IterableUser users =
dao.getParents(ofy.query(UserSkill.class).filter(skill,
java).filter(ability , 5));

Hardly a trainwreck.

 I notice you return an Iterable rather than an Iterator.  The problem with
 this is that every time the Iterable is accessed the query is executed
 again.  A little dangerous and non-obvious in my opinion.

This is another bit of FUD.  Nobody to my knowledge has yet made this
mistake.  And being Iterable makes queries *quite* elegant:

for (Car car: ofy.query(Car.class).filter(weight , 5000)) {
doSomethingWith(car);
}

 You will have to clarify what you mean by except when you can't.  There is
 no reason to have any dependency on the datastore in a Twig data model.

Okay, how about this:  How do you delete instances without loading them first?

Give 

[appengine-java] Re: Why I encountered this error : The class java.lang.String is not persistable.

2010-03-10 Thread Ian Marshall
Instead of

  @PrimaryKey
  private String key;

have you tried

  @PrimaryKey
  @Persistent
  private String key;

?

Since I use keys as encoded strings (instead of unencoded string
keys), I personally use

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  @Extension(vendorName=datanucleus, key=gae.encoded-pk,
value=true)
  private String sEncodedKey;

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



Re: [appengine-java] what if I hit memory limit ?

2010-03-10 Thread Don Schwarz
To pick one at random:

http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/LRUMap.html

On Wed, Mar 10, 2010 at 11:08 AM, Prashant Gupta nextprash...@gmail.comwrote:

 Thanks Don for clarification.

 100MB seems sufficient for me. Please suggest me a library for LRU caching
 implementation.

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


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



[appengine-java] Re: Where can i specify my log file name in Google Web App ?

2010-03-10 Thread Ian Marshall
I use both files, located in:

  war\WEB-INF\classes\log4j.properties
  war\WEB-INF\classes\logging.properties


In my appengine-web.xml file, I have the following extract for you:

  ?xml version=1.0 encoding=UTF-8?
  appengine-web-app xmlns=http://appengine.google.com/ns/1.0;
system-properties
  property
   name=java.util.logging.config.file
   value=WEB-INF/classes/logging.properties
  /
  property
   name=log4j.configuration
   value=file:WEB-INF/classes/log4j.properties
  /
/system-properties
  /appengine-web-app


I remember that I had a problem where the two file names included
capital letters, so reluctantly I made them both pure lower case!

-- 
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 exactly do the App Engine Logs work?

2010-03-10 Thread Spines
Where does Google store the logs when you do a Logging statement?
Logging statements seem to be pretty fast, so it doesn't seem like
they are stored in the datastore.

How reliable are the logs? If I do a logging statement and it
succeeds, is it pretty much guaranteed that it will show up in the
logs?

How much past history of logs is stored?

The reason I'm interested in this is because I'm making a question and
answer website, and I want to keep track of views by each unique
logged in user to each question, and display the view count on the
question page. So if 10 different users visit the question page 100
times, it still only counts as 10 unique views.

I have an offsite computer that does background processing for my app.
I'm planning to have this offsite computer download the logs about
every 30 minutes, and calculate what the view count should be for each
question based off of the logs. By doing this, I don't have to create
a datastore entity for each different question each user views.

What do you guys think? Does anyone see any problems with this?

-- 
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: Do I need unowned relationships to accomplish this...?

2010-03-10 Thread tempy
Actually cards can only be owned by one deck... so that's not a
problem.  Deck--1...0toN--card.

The thing that I am looking for is a way to add new cards without
loading a deck's entire card collection, and to add decks without
loading a User's entire deck collection.

On Mar 10, 9:15 pm, WillSpecht willspe...@gmail.com wrote:
 The way I understand it, if an object can be owned by more than one
 object it must be unowned.  I would assume that cards can be in
 multiple decks so they must be unowned.  I would assume each deck
 would belong to one user so decks could be owned.  I don't know a good
 way to store cards that can be queried in one query unless you have
 each card store what decks they are in.  This could be even more
 difficult if cards appear more than once in a deck.  If that is true I
 would suggest a join table.

 On Mar 10, 2:20 pm, tempy fay...@gmail.com wrote:



  I have the following datastructure:

  Users are the root entities, and each user can have one or more
  decks, and each deck can have one or more cards.

  When a user wants to add a deck, I would like to be able to add the
  deck to the user's collection of decks without first fetching all of
  the user's decks (potentially a large amount of data), then adding the
  new deck to that collection, and then persisting the user.  Rather, I
  would like to simply instantiate the deck and append it to the user's
  collection of decks, without ever retrieving the entire collection.

  Similarly, if a user wants to add a new card to an existing deck, I
  would like to add the card to the deck without first retrieving the
  entire deck (that is, the deck with all of its cards).

  I would like to preserve the option of fetching a user with a
  populated collection of all their decks and to retrieve a deck with a
  populated collection of all its cards, which is possible with owned
  relationships.  But to accomplish what I have mentioned above, would I
  be forced to use unowned relationships? (Collections of keys instead
  of collections of objects.)

  Thanks,
  Mike

-- 
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] Got a problem index when quering data with key.

2010-03-10 Thread thierry Le conniat
Hello,
I Got a problem when quering data with the key fileName . The error
is below  :

com.google.appengine.api.datastore.DatastoreNeedIndexException: no
matching index found..
datastore-index kind=Picture ancestor=false source=manual
property name=__key__ direction=desc/
/datastore-index

The index is not found, but i have declared it in the file datastore-
indexes.xml like this :

  ?xml version=1.0 encoding=UTF-8?
  datastore-indexes  autoGenerate=true
datastore-index kind=Picture ancestor=false
property name=fileName direction=desc /
/datastore-index
  /datastore-indexes

The query is :

 PersistenceManager pm = PMF.get().getPersistenceManager();
 javax.jdo.Query query = pm.newQuery(Picture.class);
 query.setOrdering(fileName desc);
 ListPicture Pictures = (ListPicture)
pm.newQuery(query).execute();

The java class Picture is :

  @PersistenceCapable(identityType = IdentityType.APPLICATION)
  public class Picture {
private static final Logger log =
Logger.getLogger(Picture.class.getName());

   @PrimaryKey
private String fileName;
   ...

   }

thanks for your help

-- 
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 exactly do the App Engine Logs work?

2010-03-10 Thread thierry Le conniat
Hello,
I think google log are stored in file.
My experience about log reliability is that when the app is very
strong working, not all the log are stored.
It's confusing, but i can't not explain it.

Bye

On 10 mar, 22:04, Spines kwste...@gmail.com wrote:
 Where does Google store the logs when you do a Logging statement?
 Logging statements seem to be pretty fast, so it doesn't seem like
 they are stored in the datastore.

 How reliable are the logs? If I do a logging statement and it
 succeeds, is it pretty much guaranteed that it will show up in the
 logs?

 How much past history of logs is stored?

 The reason I'm interested in this is because I'm making a question and
 answer website, and I want to keep track of views by each unique
 logged in user to each question, and display the view count on the
 question page. So if 10 different users visit the question page 100
 times, it still only counts as 10 unique views.

 I have an offsite computer that does background processing for my app.
 I'm planning to have this offsite computer download the logs about
 every 30 minutes, and calculate what the view count should be for each
 question based off of the logs. By doing this, I don't have to create
 a datastore entity for each different question each user views.

 What do you guys think? Does anyone see any problems with this?

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



Re: [appengine-java] Re: How exactly do the App Engine Logs work?

2010-03-10 Thread Don Schwarz
Are you talking about request logs or diagnostic logs?  Although we conflate
them a bit in both the Admin Console viewer and the appcfg command, but they
are stored and tracked separately.

On Wed, Mar 10, 2010 at 4:01 PM, Spines kwste...@gmail.com wrote:

 Hmm, that is my biggest concern, log reliability.  Can someone from
 Google confirm whether or not I can rely on the logs having all of the
 log data? Or might certain entries just disappear?

 On Mar 10, 1:24 pm, thierry Le conniat thlec...@euriware.fr wrote:
  Hello,
  I think google log are stored in file.
  My experience about log reliability is that when the app is very
  strong working, not all the log are stored.
  It's confusing, but i can't not explain it.
 
  Bye
 
  On 10 mar, 22:04, Spines kwste...@gmail.com wrote:
 
 
 
   Where does Google store the logs when you do a Logging statement?
   Logging statements seem to be pretty fast, so it doesn't seem like
   they are stored in the datastore.
 
   How reliable are the logs? If I do a logging statement and it
   succeeds, is it pretty much guaranteed that it will show up in the
   logs?
 
   How much past history of logs is stored?
 
   The reason I'm interested in this is because I'm making a question and
   answer website, and I want to keep track of views by each unique
   logged in user to each question, and display the view count on the
   question page. So if 10 different users visit the question page 100
   times, it still only counts as 10 unique views.
 
   I have an offsite computer that does background processing for my app.
   I'm planning to have this offsite computer download the logs about
   every 30 minutes, and calculate what the view count should be for each
   question based off of the logs. By doing this, I don't have to create
   a datastore entity for each different question each user views.
 
   What do you guys think? Does anyone see any problems with this?

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



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



[appengine-java] Re: Sporadic problems with very high response times

2010-03-10 Thread James
Like many, I'm anxious to learn more.  I just deployed my first app
today and while the load is light (just me), it's a giant usability
issue to have to wait 6s for spinup if (god forbid) I stop to read a
page for more than 60s or so.  I'm not using any frameworks, so this
is just VM and JDO spinup.

-- 
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: Do I need unowned relationships to accomplish this...?

2010-03-10 Thread tempy
Exactly, CardList is potentially very large and I want to avoid having
to load it just to add the cardreference.

On Mar 10, 10:43 pm, WillSpecht willspe...@gmail.com wrote:
 So if you have a reference to a new card and do

 cardList.add(cardRefference)

 all you are loading into memory is the card list and the new card.

 Is this what you are trying to avoid?

 On Mar 10, 4:06 pm, tempy fay...@gmail.com wrote:



  Actually cards can only be owned by one deck... so that's not a
  problem.  Deck--1...0toN--card.

  The thing that I am looking for is a way to add new cards without
  loading a deck's entire card collection, and to add decks without
  loading a User's entire deck collection.

  On Mar 10, 9:15 pm, WillSpecht willspe...@gmail.com wrote:

   The way I understand it, if an object can be owned by more than one
   object it must be unowned.  I would assume that cards can be in
   multiple decks so they must be unowned.  I would assume each deck
   would belong to one user so decks could be owned.  I don't know a good
   way to store cards that can be queried in one query unless you have
   each card store what decks they are in.  This could be even more
   difficult if cards appear more than once in a deck.  If that is true I
   would suggest a join table.

   On Mar 10, 2:20 pm, tempy fay...@gmail.com wrote:

I have the following datastructure:

Users are the root entities, and each user can have one or more
decks, and each deck can have one or more cards.

When a user wants to add a deck, I would like to be able to add the
deck to the user's collection of decks without first fetching all of
the user's decks (potentially a large amount of data), then adding the
new deck to that collection, and then persisting the user.  Rather, I
would like to simply instantiate the deck and append it to the user's
collection of decks, without ever retrieving the entire collection.

Similarly, if a user wants to add a new card to an existing deck, I
would like to add the card to the deck without first retrieving the
entire deck (that is, the deck with all of its cards).

I would like to preserve the option of fetching a user with a
populated collection of all their decks and to retrieve a deck with a
populated collection of all its cards, which is possible with owned
relationships.  But to accomplish what I have mentioned above, would I
be forced to use unowned relationships? (Collections of keys instead
of collections of objects.)

Thanks,
Mike

-- 
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 get my basic Struts2 application to work

2010-03-10 Thread Deepam Tiwan
I am able to get it to work. Followed the same tutorial on
Pages section of this forum. Here is what I had to modify
1. Set devMode to False.
2. add an applicationlistener with set OgnlRunTime.setSecurityManager
to null.

Deepam

On Mar 7, 2:52 pm, Deepam Tiwan deepamti...@gmail.com wrote:
 Hi All,

 I am having trouble getting my basic struts2 application to working
 with GAE/J. I read the discussion about OGNL permission but I feel I
 am not hitting that point yet. Here is the URL.

 http://demoappbasic.appspot.com/HelloWorld.action

 And this is the error I see,

 Error: result 'null' not found

 Here is my struts.xml

 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
     -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
     http://struts.apache.org/dtds/struts-2.0.dtd;

 struts
     constant name=struts.enable.DynamicMethodInvocation
 value=false /
     constant name=struts.devMode value=true /

     package name=demoApp extends=struts-default
         !-- Add actions here --
         action name=HelloWorld 
             result/jsp/HelloWorld.jsp/result
         /action

         action name=Time class=com.dt.demoAPP.time.Time
             result/jsp/Time.jsp/result
         /action
     /package

     !-- Add packages here --

 /struts

 Thanks,

 Deepam Tiwan

-- 
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 I encountered this error : The class java.lang.String is not persistable.

2010-03-10 Thread Jolam
I have found why i'm wrong...finally...

On Mar 11, 1:06 pm, Jolam j.jo...@gmail.com wrote:
 to Ian Marshall:

 I have changed the class to two form as u mentioned, but it did't
 work...

-- 
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 I encountered this error : The class java.lang.String is not persistable.

2010-03-10 Thread datanucleus
 Instead of

   @PrimaryKey
   private String key;

 have you tried

   @PrimaryKey
   @Persistent
   private String key;

A String field/method doesn't even need @Persistent. All basic types
are by default persistent, as per the JDO spec (unlike in the GAE/J
docs).

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