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

2010-03-14 Thread John Patterson

Hi Max,

Regarding your original question, a more efficient solution would be  
to embed the UesrSkill in the User instance which would allow you to  
find all results in a single query.  Th problem is that embedded  
instances can only be queried on a single value.  There would be no  
way to query skill and ability on the same UserSkill - just "java and c 
++ with any skill over 3 and any skill over 5"


To solve this you could create a combined property in UserSkill for  
querying "skillAbility" which would hold values such as "java:5", "c++: 
4".  This will only work with skill from 0-9 because it depends on  
lexical ordering (or e.g. 000 - 999)


Both Twig and Objectify but not JDO support embedded collections of  
instances.


In Twig it would be defined like this

class User
{
@Embed List skills;
}

class UserSkill
{
String skillAbility;
Skill skill;// direct reference to Skill instance
int ability;
}

Disclaimer: I have not tried any of this code - it is just off the top  
of my head


You would then do a single range query to find "java-5", "java-6,  
"java-7"...


// find java developers with ability over 5 in a single query
datastore.find().type(User.class)
	.addFilter("skillAbility", GREATER_THAN_EQUAL, "java:5")  // range  
start
	.addFilter("skillAbility", LESS_THAN, "java-" +  
Character.MAX_VALUE)  // range end

.returnResultsNow();

But that doesn't fully answer your question which includes an AND on  
multiple property values which is not supported by the datastore.  To  
do this you will need to perform two queries and merge the results.


Twig has support for merging only OR queries right now so you can do:

// find users with c++ ability > 2 OR java ability > 5

RootFindCommand  or = datastore.find().type(User.class);  // default  
(only) operator is OR


or.addChildCommand()
	.addFilter("skillAbility", GREATER_THAN_EQUAL, "java:5")  // range  
start
	.addFilter("skillAbility", LESS_THAN, "java-" +  
Character.MAX_VALUE);  // range end


or.addChildCommand()
	.addFilter("skillAbility", GREATER_THAN_EQUAL, "java:5")  // range  
start
	.addFilter("skillAbility", LESS_THAN, "java-" +  
Character.MAX_VALUE);  // end


// merges results from both queries into a single iterator
Iterator results = or.returnResultsNow();

Supporting AND merges is coming!  Add a feature request if you like.   
But for now you will have to do two separate queries as in the first  
example and join the results in your own code.  You should make sure  
both queries are sorted by key then you can "stream" the results  
without loading them all into memory at once.


// find java developers with ability over 5
datastore.find().type(User.class)
.addSort("skillAbility")  // first sort required to be inequality 
filter
.addSort(Entity.KEY_RESERVED_PROPERTY)  // ensure results in same order
	.addFilter("skillAbility", GREATER_THAN_EQUAL, "java:5")  // range  
start
	.addFilter("skillAbility", LESS_THAN, "java-" +  
Character.MAX_VALUE)  // range end

.returnResultsNow();

// find c++ developers with ability over 2
datastore.find().type(User.class)
.addSort("skillAbility")
.addSort(Entity.KEY_RESERVED_PROPERTY)
.addFilter("skillAbility", GREATER_THAN_EQUAL, "c++:2")  // range start
	.addFilter("skillAbility", LESS_THAN, "c++:-" +  
Character.MAX_VALUE)  // range end

.returnResultsNow();

// now iterate through both results and only include those in both  
iterators



Again, I have not run this code so I might have made a mistake.  Let  
me know how you get on!  I'll be adding support for these merged AND  
queries on multiple property values soon - unless someone else wants  
to contribute it first ;)


To find the similarity between two users is now simple now that they  
are just a property of the User?  just do a Sets.intersection() of the  
skills.


John

On 15 Mar 2010, at 12:07, Max wrote:


Thanks John,

Bret Slatkins' talk is impressive. Let's say we have m skills with n
levels. (i.e., m x n SkillLevel entities). Each SkillLevel entity
consists of at least one SkillLevelIndex.

We define similarity between user A and User B as number of  skills
with same level. i.e., number of SkillLevel entities of query:
"from SkillLevel where userKeyList contains A and userKeyList contains
B"

It works fine if userKeyList contains all user keys. However, after we
applied relation index pattern, we have more than one user keys lists,
then how to perform a query to calculate similarity between two users?

On Mar 10, 12:21 pm, John Patterson  wrote:

On 10 Mar 2010, at 10:53, Max wrote:


Rusty Wright suggested a list of user keys to be stored in skill
entity. But that means only 5000 users can have the same skill.


If you use the "Relation Index Entity" pattern as described in Bret
Slatkins talk you can store 5000 users per index entity and an
unlimited number of index entities.  This will actually give you much
better q

Re: [appengine-java] Objectify - Twig - approaches to persistence

2010-03-14 Thread Gal Dolber
Ok, I have never use twig, but I have been using objectify for a few weeks
and adding some features to it..
This is what I got:

   - Mysql implementation (99% working, the parent has no sense on mysql)
   - Guice integration (this is possible with the actual version, but I have
   added ObjectifyAppengineModule and ObjectifyMysqlModule to make it easier)
   - Native full text search
   - Managed relations (included Collections and Arrays)
   - Fast load for managed relations: any get() or query() will result on 1
   or 2 max get operations from the datastore
   - Query now have two new methods: Map, T> asMap() and List
   asList(), this are fetched all at once
   - I've removed some dependencies with the low level api like
   query.getTnx(); and to replace it there are: query.commit() and
   query.rollbackIfActive();

I will open source it, I have an application deployed on appengine and
tomcat with the same source code, all I have to do is change to Guice module
declaration and its ready to go each way.
I am working on the performance of the appengine implementation, the console
sometimes its throwing "This request used a high amount of CPU and may soon
exceed its quota" but the big work its done
The good news is that the mysql implementations its really fast

Regards


2010/3/14 Nacho Coloma 

> > For parallel queries, we haven't really started talking about the API,
> > but I have to admit there is a lot of appeal to simply adding a method
> > like this on the Objectify interface:
> >
> > Map, Iterable> multiquery(Iterable>);
> >
> > While not as powerful as being able to get(), put(), delete(), and
> > query() at the same time, it probably covers 85% of the use cases with
> > a very simple API.
>
> Isn't there a plan to add a Map/Reduce API to AppEngine? I don't think
> it's wise to start such an interface ignoring the GAE roadmap.
>
> Anyway, if you manage to put together a common codebase I will be glad
> to 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.
>
>

-- 
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] requestDispatcher vs resp.getWriter

2010-03-14 Thread Philip Tucker
I have a servlet that returns a JSON string. For some reason it works
fine when I dispatch to a JSP, but sometimes fails when I write
directly to the response.

this works:

  req.setAttribute("json", json.toJSONString());
  req.getRequestDispatcher("json.jsp").forward(req, resp);

this (sometimes) doesn't work:

  json.writeJSONString(resp.getWriter());

Unfortunately the error is sporadic and I'm not reproducing right now,
but it was an "Illegal argument" exception in NucleusJDOHelper.

The request is reading and writing to persistence. I'm calling
PersistenceManager.close() immediately after this.

Any ideas? I can provide more details if necessary.

-- 
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: Best way to perform search on DataStore - Design Question

2010-03-14 Thread yjun hu
you can try compass to make you project searchable. a simple demo here
http://hapeblog.appspot.com/blog.shtml?id=7002

On Sun, Mar 14, 2010 at 8:36 PM, John Patterson wrote:

> Interesting to see the existence protected Query.setFullTextSearch(String)
> method when you open the Query class in Eclipse.  I suppose it won't be too
> far away.  I can't wait to see if they just give us a take-it-or-leave-it
> solution or also the tools required to roll your own.
>
>
> On 14 Mar 2010, at 15:05, Robert Lancer wrote:
>
>  Haha, like many of us you probably thought that GOOGLE app engine
>> would have decent text search capabilities.
>>
>> It looks like your doing all you can do by creating the inverse table,
>> you may just want to star
>> http://code.google.com/p/googleappengine/issues/detail?id=217
>>
>>
>> On Mar 13, 8:59 pm, niraj  wrote:
>>
>>> My case:
>>> I am building a website that has several searchable fields from
>>> various entities (example Artist names from artist entity , Album
>>> names from album entity). To have an efficient search capability I
>>> have defined another Entity - SearchType which carries the Searchable
>>> string and the Foreign key to the Entity. Instead of querying all the
>>> Entities one my one - I query SearchType.
>>>
>>> My preliminary tests indicate that the query  performance on
>>> SearchType is not great (the names are indexed) . I need google
>>> suggest like quick results in a drop down. What is the best way to
>>> design this.
>>>
>>> I have considered Memcache , but I dont think I can run queries on
>>> Memcache . i.e I am running a startsWith() query on JDO today.
>>>
>>> Any best practices .
>>>
>>
>> --
>> 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.
>
>


-- 
dream or truth

-- 
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-14 Thread Max
Thanks John,

Bret Slatkins' talk is impressive. Let's say we have m skills with n
levels. (i.e., m x n SkillLevel entities). Each SkillLevel entity
consists of at least one SkillLevelIndex.

We define similarity between user A and User B as number of  skills
with same level. i.e., number of SkillLevel entities of query:
"from SkillLevel where userKeyList contains A and userKeyList contains
B"

It works fine if userKeyList contains all user keys. However, after we
applied relation index pattern, we have more than one user keys lists,
then how to perform a query to calculate similarity between two users?

On Mar 10, 12:21 pm, John Patterson  wrote:
> On 10 Mar 2010, at 10:53, Max wrote:
>
> > Rusty Wright suggested a list of user keys to be stored in skill
> > entity. But that means only 5000 users can have the same skill.
>
> If you use the "Relation Index Entity" pattern as described in Bret  
> Slatkins talk you can store 5000 users per index entity and an  
> unlimited number of index entities.  This will actually give you much  
> better query performance too because you will not need to load the  
> list of 5000 Keys every time you read your main entity.
>
> The new release of Twig has direct support for RIE's and can actually  
> let you query for multiple skills *in parallel* then merge the results  
> and return the parents :
>
> http://code.google.com/p/twig-persist/wiki/Using#Relation_Index_Entities

-- 
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: Memory Leak in the EntityManagerFactory?

2010-03-14 Thread Max Ross (Google)
I've had good success with java's built in tools.  More info here:
http://blogs.sun.com/alanb/entry/heap_dumps_are_back_with

On Sat, Mar 13, 2010 at 10:10 AM, David Fuelling  wrote:

> Hey Max,
>
> Thanks for your reply!  I tried to install the eclipse memory profiler
> (TPTP --
> http://www.eclipse.org/tptp/home/downloads/installguide/InstallGuide42.html#install_update_manager
> )
> but for whatever reason there seems to be a conflict with the Google
> Eclipse plugin because now there's no sign of the Google plugins in my
> eclipse install.
>
> I see that the Google plugin and the GWT/GAE plugins are installed (in
> the installed software window), but I can't access these at all,
> either from the button menus or the configuration menus.  It's as if
> Eclipse now things my projects is a regular JavaEE project instead of
> being a Google Plugin project.  The Google plugin config menus don't
> show up in any context menus, or in the project config menus.
>
> I'm currently reverting my eclipse configuration to see if I can
> restore things.
>
> Meanwhile, can you recommend a good memory profiler that I could use
> with the GAE/Google plugin?
>
> Thanks!
>
> david
>
> On Mar 12, 9:37 pm, "Max Ross (Google)" 
> 
> >
> wrote:
> > Thanks for the report David, this certainly seems suspicious.  There is
> at
> > least one memory leak I'm aware of but it's related to transactions so
> > that's probably not what you're bumping into.  Have you tried taking a
> heap
> > dump to see what exactly is building up?
> >
> >
> >
> > On Fri, Mar 12, 2010 at 1:27 PM, David Fuelling 
> wrote:
> > > I have a JUnit test class that is attempting to test some JPA
> > > datastore "create" operations, and I'm getting results that *seem* to
> > > indicate a memory leak in the EntityManagerFactory (?)  Basically, if
> > > I use "test1a" (see below), the heap in use by the JUnit test process
> > > continually increases until the JUnit test fails with an OutOfMemory
> > > error.  Test1b suffers from no such problem.
> >
> > > I would not expect this type of behavior from test1a because even
> > > though I'm creating a new EntityManager upon every for-loop iteration,
> > > that "em" should go away after every for-loop iteration since the
> > > variable reference is replaced with a new EntityManager each time.
> >
> > > Now, one might argue that my test is just going too fast, and the GC
> > > isn't getting a chance to Garbage Collect.  However, Test1a takes a
> > > pretty long time to execute on my machine (> 120 seconds), so I
> > > *should* be getting some GC, right?  Unless the EntityManagerFactory
> > > is holding onto a reference to each created EntityManager?
> >
> > > Any input here would be much appreciated...
> >
> > > Thanks!
> >
> > > david
> >
> > > ps - my "UserImpl" is a standard JPA entity.
> >
> > > ///
> > > //Begin JUnit Test #1a
> > > ///
> >
> > > User user = null;
> > > EntityManager em = null;
> > > for (int i = 0; i < 5000; i++)
> > > {
> > >  //See how I get an em here:
> >
> > >http://code.google.com/appengine/docs/java/datastore/usingjpa.html#Ge.
> ..
> > >  em = EMF.get().createEntityManager();
> > >  user = new UserImpl("test" + i);
> > >  em.persist(user);
> > >  em.close();
> > > }
> >
> > > ///
> > > //End Test #1b
> > > ///
> >
> > > ///
> > > //Begin JUnit Test #1b
> > > ///
> >
> > > User user = null;
> > > EntityManager em = EMF.get().createEntityManager();
> > > for(int i = 0; i < 5000; i++)
> > > {
> > >  user = new UserImpl("test" + i);
> > >  em.persist(user);
> > > }
> > > em.close();
> >
> > > ///
> > > //End Test #1b
> > > ///
> >
> > > --
> > > 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.
>
>

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

Re: [appengine-java] Re: How to upload pics in appengine java

2010-03-14 Thread yjun hu
a simple demo here:
http://hapeblog.appspot.com/blog.shtml?id=2002

On Mon, Mar 15, 2010 at 11:17 AM, Diana Cruise wrote:

> Also this guy Vince has a package that not only helps with uploads but
> also then allowing your app to generate pages that use the photos
> including delta checks - really neat stuff!  See GAEVFS mentioned in
> this thread.  Please post your results so the rest of us can benefit
> from your experience.
>
>
> http://groups.google.com/group/google-appengine-java/browse_thread/thread/a4ee0a7c54453586/b1f2984b43c920a1?hl=en#b1f2984b43c920a1
>
> On Mar 14, 12:51 am, seleronm  wrote:
> > Hi,
> >
> > I think that the following links are useful.
> http://stackoverflow.com/questions/1513603/
> >
> > Please try.
> > thanks.
> >
> >
> >
> > >AFAIK almost any file can be apart of the docs that you upload (images,
> css,
> > >html, js, jsp, ico). I haven't had any trouble uploading images.
> >
> > >Are you talking about accepting images from an input form? In that case
> you
> > >can store them as a blob type in the datastore.
> >
> > >Hope this helps
> >
> > >On Sun, Mar 14, 2010 at 12:12 AM, nag  wrote:
> >
> > >> Hi
> > >> I am trying to build online reg form
> > >> can u help me how to upload image files to app engine.
> >
> > >> First: is there any way to upload images in app engine?
> >
> > >> thanks
> > >> Nag
> >
> > >> --
> > >> 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
>  > >> 2bunsubscr...@googlegroups.com>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-appengine-java?hl=en.
> >
> > >--
> > >-Pav
> >
> > >--
> > >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.
> >
> > >---html-part included links---
> > >mailto:nagarjuna...@gmail.com
> > >mailto:google-appengine-java@googlegroups.com
> > >mailto:google-appengine-java%2bunsubscr...@googlegroups.com
> > >http://groups.google.com/group/google-appengine-java?hl=en- 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.
>
>


-- 
dream or truth

-- 
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] can not remove with @Order annotation

2010-03-14 Thread Max Ross (Google)
Please post your model object definitions and the stack trace.

Thanks!
Max

On Sun, Mar 14, 2010 at 8:51 PM, Philip Tucker  wrote:

> If I annotate a dependent 1:many relationship with @Order(mappedBy =
> "foo"), I get a NPE when I try to remove something from the list. When
> I remove the annotation everything works fine. Is this a known
> limitation? If not I can post a stack trace and more details.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



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

2010-03-14 Thread Max
Thanks Jeff,

If I would like to find all users that have java level > 5 and c++
level > 2, then how to write a query in your suggested data model?

Best regards,
Max

On Mar 10, 12:18 pm, Jeff Schnitzer  wrote:
> Create a UserSkill entity with a parent key of User.  Do a keysOnly
> query for UserSkill objects that match your criteria, then get the
> parent keys out of the UserSkill key, then do a batch get on the
> parent keys.  The Objectify code:
>
> class UserSkill {
>     @Id Long id;
>     @Parent Key user;
>     String skill;  // could also be Key skill if you model Skill 
> entities
>     int ability;
>
> }
>
> List> userKeys = new ArrayList>();
> for (Key key: ofy.query(UserSkill.class).filter("skill",
> "java").filter("ability >", 5).fetchKeys())
>     userKeys.add(key.getParent());
>
> Collection users = ofy.get(userKeys).values();
>
> Jeff
>
> On Tue, Mar 9, 2010 at 7:53 PM, Max  wrote:
> > I start a new thread to recall this issue because the origin one can
> > not be replied any more.
>
> >http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> > Rusty Wright suggested a list of user keys to be stored in skill
> > entity. But that means only 5000 users can have the same skill.
>
> >http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> > Any other suggestions on this kind of problem?
>
> > Many thanks,
> > 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 
> > 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] can not remove with @Order annotation

2010-03-14 Thread Philip Tucker
If I annotate a dependent 1:many relationship with @Order(mappedBy =
"foo"), I get a NPE when I try to remove something from the list. When
I remove the annotation everything works fine. Is this a known
limitation? If not I can post a stack trace and more details.

-- 
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 upload pics in appengine java

2010-03-14 Thread Diana Cruise
Also this guy Vince has a package that not only helps with uploads but
also then allowing your app to generate pages that use the photos
including delta checks - really neat stuff!  See GAEVFS mentioned in
this thread.  Please post your results so the rest of us can benefit
from your experience.

http://groups.google.com/group/google-appengine-java/browse_thread/thread/a4ee0a7c54453586/b1f2984b43c920a1?hl=en#b1f2984b43c920a1

On Mar 14, 12:51 am, seleronm  wrote:
> Hi,
>
> I think that the following links are 
> useful.http://stackoverflow.com/questions/1513603/
>
> Please try.
> thanks.
>
>
>
> >AFAIK almost any file can be apart of the docs that you upload (images, css,
> >html, js, jsp, ico). I haven't had any trouble uploading images.
>
> >Are you talking about accepting images from an input form? In that case you
> >can store them as a blob type in the datastore.
>
> >Hope this helps
>
> >On Sun, Mar 14, 2010 at 12:12 AM, nag  wrote:
>
> >> Hi
> >> I am trying to build online reg form
> >> can u help me how to upload image files to app engine.
>
> >> First: is there any way to upload images in app engine?
>
> >> thanks
> >> Nag
>
> >> --
> >> 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 >> 2bunsubscr...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-appengine-java?hl=en.
>
> >--
> >-Pav
>
> >--
> >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.
>
> >---html-part included links---
> >mailto:nagarjuna...@gmail.com
> >mailto:google-appengine-java@googlegroups.com
> >mailto:google-appengine-java%2bunsubscr...@googlegroups.com
> >http://groups.google.com/group/google-appengine-java?hl=en- 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.



Re: [appengine-java] Re: initialization of datastore

2010-03-14 Thread John Patterson

Use the __Stat_total__  pseudo kind

http://code.google.com/appengine/docs/java/datastore/stats.html


On 15 Mar 2010, at 09:36, Robert Lancer wrote:


A query has to specify an entity kind as its minimum parameter, and
then doing a count and seeing if its equal to zero for a known entity
kind would be the best way.

On Mar 13, 1:44 pm, vchalmel  wrote:

hi !

I want to set up an initialization script, and i must, in a first
part, check if the appengine datastore is empty.
I tried to send a query, with :

query.setUnique(true);
if(query.execute()==null)

But it throws a null pointer exception.

How to check that my datastore is empty ?


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




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



[appengine-java] Re: initialization of datastore

2010-03-14 Thread Robert Lancer
A query has to specify an entity kind as its minimum parameter, and
then doing a count and seeing if its equal to zero for a known entity
kind would be the best way.

On Mar 13, 1:44 pm, vchalmel  wrote:
> hi !
>
> I want to set up an initialization script, and i must, in a first
> part, check if the appengine datastore is empty.
> I tried to send a query, with :
>
> query.setUnique(true);
> if(query.execute()==null)
>
> But it throws a null pointer exception.
>
> How to check that my datastore is empty ?

-- 
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] recommended way for application to authenticate general gmail accounts and users with google app accounts

2010-03-14 Thread Dmitry Anipko
Hi,

we're developing a service on GAE that we want to start selling to
both individual using gmail accounts and companies using google apps -
basically we need to authenticate both type of accounts in one
application.

I was looking into the docs and this forum, and it seems to me that
there are two ways to do it, if someone could comment on whether they
are the complete set, or there is some other way, that would be great:

1. Request multi-ID support for our app through
http://code.google.com/support/bin/request.py?contact_type=AppEngineMultiInstanceExceptionRequest
and add our app to all google domains who want to use us - but that
model doesn't seem scalable one, not I'm sure if our customers will be
fine with granting us even temporary administrative access in order to
add the app to their account.

2. Go through marketplace and use onlineid? In this case we will get
better integration into the google app enviroment, but my
understanding is we will have to pay for that 20% of revenue (in case
we select the "add to" option) to Google.

Are there other ways? If these two ways are correct, if we don't need
the other benefits of marketplace integration, will Google be
approving the request for each customer that we may have or we can't
count on that? (and we could have hundreds of customers).

If any of the users of the forum had similar issue and got it solved,
I'd appreciate if they could share the learnings.

Thank you,
Dmitry

-- 
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 best run GWTTestCase tests that involve persistence?

2010-03-14 Thread Trung
Hi,

1. I think the proper way is separating the test from
QuestionServiceImpl.

2. For testing QuestionServiceImpl, you should run two separate parts:
server side and client side.
a) In your case, there are no special in the server side.
b) In the client side, you can use GWTTestcase. Your test logic is on
the client side.
However, testing with GWTTestcase are slow. SyncProxy can be used on
the client side to invoke your remote service.
See http://www.gdevelop.com/w/blog/2010/01/10/testing-gwt-rpc-services/
and 
http://www.gdevelop.com/w/blog/2010/03/13/invoke-gwt-rpc-services-deployed-on-google-app-engine/
for how to use SyncProxy.



On Mar 14, 8:34 pm, Christian Schuhegger
 wrote:
> Hello,
>
> I am doing experiments with a simple service QuestionService and I
> have a GWTTestCase that calls the QuestionService. All works fine, but
> my problem is that in the QuestionServiceImpl constructor I have to
> use the LocalServiceTestHelper helper infrastructure in order to make
> the whole test case work.
>
> My problem is now that I have to introduce dependencies in my
> QuestionServiceImpl on the appengine-testing jar in order to make my
> GWTTestCase work! My initial tries were to use the
> LocalServiceTestHelper directly in the gwtSetUp and gwtTearDown
> methods of the GWTTestCase but that does of course not work, because
> those classes are not compatible with the GWT (they obviously cannot
> and should not be compiled to java script).
>
> Is there any good way around this that I have to introduce a
> dependency on the appengine-testing infrastructure in my service
> implementation? Can I somehow detect that I am running in a
> GWTTestCase, then I could at least create a if-then-else block that
> only instantiates the helper in test mode.
>
> Many thanks for any recommendations!
>
> @RemoteServiceRelativePath("question")
> public interface QuestionService extends RemoteService {
>         public QuestionDefinition createQuestionDefinition(String question);
>         public void deleteQuestionDefinition(QuestionDefinition qd);
>         public QuestionDefinition findQuestionDefinitionById(String key);
>
> }
>
> public class QuestionServiceImpl extends RemoteServiceServlet
> implements QuestionService {
>
>         private final LocalServiceTestHelper helper = new
> LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());
>
>         public QuestionServiceImpl() {
>                 super();
>                 helper.setUp();
>         }
>
>         public QuestionDefinition createQuestionDefinition(String question) {
>                 PersistenceManager pm = PMF.get().getPersistenceManager();
>                 QuestionDefinition qd = new QuestionDefinition(question);
>                 try {
>                         pm.makePersistent(qd);
>                 } finally {
>                         pm.close();
>                 }
>                 return qd;
>         }
>   ...
>
> }
>
> public class GwtTestQuestionService extends GWTTestCase {
>
>         @Override
>         public String getModuleName() {
>                 return "questionservice";
>         }
>
>         public void testQuestionServiceCreate() {
>                 QuestionServiceAsync questionService =
> GWT.create(QuestionService.class);
>
>                 String question = "Are you happy?";
>
>                 questionService.createQuestionDefinition(question,
>                                 new AsyncCallback() {
>                                         public void onFailure(Throwable 
> caught) {
>                                                 Assert.fail();
>                                                 finishTest();
>                                         }
>
>                                         public void 
> onSuccess(QuestionDefinition result) {
>                                                 Assert.assertNotNull(result);
>                                                 finishTest();
>                                         }
>                                 });
>         delayTestFinish(5000);
>         }
>
> }

-- 
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] Slow JDO and JPA

2010-03-14 Thread v6ak
Hello,
I'd like to use a platform independent ORM. I've tried JPA and JDO,
but creating PMF/EMF is too slow (several seconds). Well, I can
(should) cache the PMF/EMF as a static variable, but the cache is
invalidated too often. (I know that GAE is a cloud technology and
there can be more servers with my app.) I realized that JDO is a bit
faster than JPA.

What is happening during creating of the EMF or PMF?

Is there any workaround or another solution?

Am I doing anything wrong?

Note that I'm at the moment experimenting with GAE and I don't have
(m)any visitor(s). It will be better with more visitors, won't it?

-- 
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] initialization of datastore

2010-03-14 Thread vchalmel
hi !

I want to set up an initialization script, and i must, in a first
part, check if the appengine datastore is empty.
I tried to send a query, with :

query.setUnique(true);
if(query.execute()==null)

But it throws a null pointer exception.

How to check that my datastore is empty ?

-- 
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 integration tests with JPA

2010-03-14 Thread hans
Hi all,

I would like to test my JPA repository/dao components locally and I'm
running into a dead end. I'm on SDK 1.3.1.

I have read the documentation at 
http://code.google.com/appengine/docs/java/tools/localunittesting.html.

This documentation deals with how to get access to the lower level
datastore API. I suppose I can compare that with a JDBC connection in
a conventional application. What I don't understand is how to write a
local unit test that talks to the JPA EntityManagerFactory. I found
some useful blog postings (http://objectuser.wordpress.com/2009/08/02/
google-app-engine-testing-with-spring/) but it seems the API version
used by the author of that posting is now outdated.

So my question is: how do I bridge the gap between the lower level
datastore factory and my JPA DAO implementation, e.g. how do I
configure JPA's EntityManagerFactory to use the local datastore
environment when running tests? I am aware my EntityManagerFactory
looks for persistence.xml on the classpath, which configures a
org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider, for
which I can not find the javadoc anywhere.

Also, I found a posting on this group,
http://groups.google.com/group/google-appengine-java/browse_thread/thread/90f60cc91cce5a9b/c3080e2709a6fb9e.

The solution there is to setup the environment *inside* the actual
test implementation. That will make testing kind of troublesome, and
it seems to use the ApiProxyLocalImpl that I can not get a hand of in
the current SDK version.

A side note: considering the fact that the vast majority of people
will be accessing the datastore through either JDO or JPA, shouldn't
the testing documentation provide examples for that (instead of the
lower level API which seems to me sort of a niche)

Regards,
Hans

-- 
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] Objectify - Twig - approaches to persistence

2010-03-14 Thread Nacho Coloma
> For parallel queries, we haven't really started talking about the API,
> but I have to admit there is a lot of appeal to simply adding a method
> like this on the Objectify interface:
>
> Map, Iterable> multiquery(Iterable>);
>
> While not as powerful as being able to get(), put(), delete(), and
> query() at the same time, it probably covers 85% of the use cases with
> a very simple API.

Isn't there a plan to add a Map/Reduce API to AppEngine? I don't think
it's wise to start such an interface ignoring the GAE roadmap.

Anyway, if you manage to put together a common codebase I will be glad
to 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.



Re: [appengine-java] Re: How to delete all entities of a kind with the datastore viewer

2010-03-14 Thread Jeff Schnitzer
One thing you get used to on appengine is that any bulk data work
requires the task queue.  You can use a little bit of framework and
make all of these transforms (including deleting data) a question of
just writing a simple task class and firing it off.  You'll want a
copy of the Deferred servlet:

http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlanta/appengine/taskqueue/Deferred.java

Fair warning:  I found that I needed to change the code to make it
perform base64 encoding all the time, not just on the dev instance.

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.



Re: [appengine-java] Objectify - Twig - approaches to persistence

2010-03-14 Thread Jeff Schnitzer
Yes, while the "debate" has been a lot of fun (probably mostly for
John and I), we probably agree on far more than we disagree.  There
are some mild philosophical differences and some aesthetic differences
but truth be told, the problem space is pretty small.  And I think
John has done a lot of excellent work.

We're probably going to chew on the uninitialized entity/activation
issue for a while.  Despite the risks, I rather like the concept
(without automatic activation), Scott seems have other thoughts.

For parallel queries, we haven't really started talking about the API,
but I have to admit there is a lot of appeal to simply adding a method
like this on the Objectify interface:

Map, Iterable> multiquery(Iterable>);

While not as powerful as being able to get(), put(), delete(), and
query() at the same time, it probably covers 85% of the use cases with
a very simple API.

And yes, we'd certainly be happy to work on common code.  I'm not
familiar with the new Twig codebase (I only looked at it long ago,
before starting Objectify) but it's on my (eventual) TODO list.  So
little time, so much software to write!

Jeff

On Sun, Mar 14, 2010 at 4:27 AM, John Patterson  wrote:
>
> On 13 Mar 2010, at 11:00, Jeff Schnitzer wrote:
>>
>> since you can (and IMNSHO probably should) always disable automatic
>> activation and refresh the graph manually.
>
> Although I dislike premature optimisations such as this note that you can
> configure Activation to not activate any Objects by default.
>
>> After you explained the concept of uninitialized entities (the brief
>> blurb in your docs really isn't enough), I actually rather like your
>> solution!  I might even implement something similar in Objectify.  But
>> I really think you need to document the hell out of the issues
>> surrounding them.  It is very very easy to corrupt data.
>
> Despite all the talk about differences in "philosophy" and the "down
> playing" of the features in Twig I can see from the Objectify mailing list
> that discussion has already started on how it would be possible to add
> support for direct references and async parallel commands.
>
> Be very careful not to end up with an API that bulges with features that are
> tacked on as an after thought.  The Objectify Query API as it is now would
> need to explode with permutations.  Perhaps it is best to stick to the goal
> of being a more usable object capable interface to the low-level API?
>  Objectify does this very well.
>
> When Twig started as not much more than a thin wrapper around the low-level
> interface and grew in complexity as more high level Object oriented features
> were added it became obvious that mixing direct references and low-level
> Keys and Queries in the same API is just not manageable.  So I stripped out
> almost all the low-level references and the result is a very clean, focused
> API.
>
> Adding a collection of helper functions to Objectify for things like merging
> OR queries would very soon become unorganised and make exploring the API
> difficult.
>
> You should probably make a decision about the design goals of Objectify and
> stay true to it.  There is always the option of building a higher-level
> interface on top of Objectify - now that would be interesting!  In Twig you
> have the option to drop down to use the low-level datastore service if you
> really need to - but the necessity for this has decreased a lot with the
> final release 1.0
>
> Although this our-answer-to-the-great-question-is-the-only-logical-one
> banter is terrific fun it might make sense to work on some functionality in
> common.  Scott and I briefly mentioned making a common profiling ApiProxy to
> help understand the performance of your app.  I've made a quick start on
> this but it really is a feature that makes sense not just for Twig.
>
> If the feature sets of Twig and Objectify end up converging over time -
> albeit with differences in default settings - it begs the question if there
> might be some way to cooperate on higher level functionality also.
>
>> OR queries haven't been a pain point.  Maybe they will
>> be in the future, in which case we'll consider adding the feature.  We
>> are content to wait for the 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.
>
>

-- 
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/goog

Re: [appengine-java] Re: How to delete all entities of a kind with the datastore viewer

2010-03-14 Thread nicolas melendez
hacks and more hacks :(

On Sat, Mar 13, 2010 at 9:42 AM, Toby  wrote:

> Hi,
>
> If it is a one time thing, the easiest is to use imacro plugin for
> firefox (or similar). Just teach it to use the GAE admin to delete the
> entities  (20 per page) and then replay it in a lot of loops. This
> takes one minute to set up and works perfectly.
>
> Cheers,
> Tobias
>
> On Mar 13, 9:44 am, 杨浩  wrote:
> > *In my store,have more than 100,000 entities here,but i find delete(limit
> > 400) it's cost > 26s*
> > my datas is wrong so i must delete all entities of the kind(no index in
> the
> > kind)!
> >
> > *1. first i use:*
> > Query q = pm.newQuery(query);
> >q.setRange(0, 400);
> > int count = 0;
> >try {
> >resultList = (List) q.execute();
> >for (T t : resultList) {
> >pm.deletePersistent(t);
> >count++;
> >}
> >return count;
> >} finally {
> >q.closeAll();
> >}
> > I found that:every time it's delete only few entity(<100)!(I watch 200
> > entities of the kind with GAE Datastore Viewer)
> >
> > *2 second i use:*
> >
> > UtilGAE.howTimer(true),return how time cost with a threadlocal var store
> a
> > start millionseconds,arg is a flag(true if cost time>26second throw a
> > IllegalStateException("it's cost more than limit 26s");
> >
> > DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
> > Query query = new
> > Query(Section.class.getSimpleName()).setKeysOnly();
> > int count = 0;
> > try {
> > Iterable iter =
> > ds.prepare(query).asIterable(FetchOptions.Builder.withLimit(400));
> > logger.info("query cost time:{}s",
> > UtilGAE.howTimer(true)/1000d);
> > for (Entity entity : iter) {
> > Key key = entity.getKey();
> > ds.delete(entity.getKey());
> > count++;
> > UtilGAE.howTimer(true);
> > }
> > if (count != 0) throw new IllegalStateException("next
> continue
> > to delete...");
> > } finally {
> > logger.info("delete:{},cost time:{}s", count,
> > UtilGAE.howTimer()/1000d);
> > }
> > so it's work fine(it's real delete entity from my store) and a most of
> cost
> > time in the 26s!
> >
> > I say there have most of limited in the GAE Stored!you must to be
> carefull
> > when you have a larger datastore!
> >
> > 2010/3/12 Toby 
> >
> > > Hello,
> >
> > > deleting 500 should not take a lot of time. Did you try the
> > > deletePersistentAll method?
> > >Query q = pm.newQuery(persistentClass);
> > >q.deletePersistentAll();
> >
> > > otherwise what I do is using the task queue. I delete 1000 entities
> > > and then put a task in the queue to delete another 1000. In that case
> > > you can not use the deletePersistentAll. You need to query by object
> > > type and limit:
> >
> > >Query q = pm.newQuery(query);
> > >q.setRange(0, size);
> >
> > >try {
> > >resultList = (List) q.execute();
> > >resultSize = resultList.size();
> > >for (T t : resultList) {
> > >pm.deletePersistent(t);
> > >}
> > >return resultSize;
> > >} finally {
> > >q.closeAll();
> > >}
> >
> > > since I return the size I see how much records where affected. If it
> > > is less than 1000 I know that I can stop doing the queuing.
> > > This is a bit difficult to set up but works fine. I believe there is
> > > not better way to do that but I am happy about any other suggestions.
> >
> > > Cheers,
> > > Toby
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Objectify - Twig - approaches to persistence

2010-03-14 Thread John Patterson

Hey Scott, some good ideas there.

On 14 Mar 2010, at 23:00, Scott Hernandez wrote:


Some of the questions that come up are: how deep to you go down the
object graph, what do you do about uninitialized objects (which might
only have a key/id[+parent]), when do you get the
children/referenced-objects, what transaction do you use (the same as
the initial get, or can you specify one at each level), how do you
deal with puts (do you cascade, or require the user to explicitly put
what they've changed), do you support automatic "dirty detection"
(related to the last question), are there any special behaviors with
delete, does the implementation seem obvious (and clear) to the user?


All valid concerns.  I have implemented the most simple strategy that  
works because - well it was fast and gets the job done.  Stores are  
all explicit for every instance which was also the most simple  
implementaion.  Basically the graph of references is walked and  
instances that are already known about (because they were loaded and  
cached) are passed over.


The next step will be manual dirty detection using a callback to the  
ObjectDatastore - basically just a set of dirty instances that are  
updated at the end of the unit of work.  This way no extra state needs  
to be stored per instance.


Then comes the class enhancement - AspectJ or a bytecode library -  
then comes serialization issues ;)



We have a lot of room to create some common shared utility libraries
(for performance tuning/collection, async operations, mapping
properties, etc.). In fact, it would be a great step forward if we
could make sure the mapping for our objects follow the same naming
scheme.


Sounds good.  Will help me integrate that in-place upgrade stuff too.   
I might need that on my next project that is more dynamic.



For things like Embedded it is important that we represent the
entity mapping the same so that people can changes from
twig/objectify/other-framework without having to re-process all their
entities. John, what do you think about that?


All good.  Another area is the persistent representation - i.e.  
property naming so data could be shared.  Perhaps a simple adapter  
might suffice.  That would be very interesting - it would mean a Twig  
user could run Objectify in-place upgrades.  Or an Objectify user  
could run Twigs revertible isolated upgrades.


If the feature sets of Twig and Objectify end up converging over  
time -
albeit with differences in default settings - it begs the question  
if there

might be some way to cooperate on higher level functionality also.


It does strike me that much of our framework functionality is common,
and therefor is probably a wasted effort (if we could work together
with a shared code base). However, looking at the coding styles and
philosophies I don't think we would (immediately) benefit from
creating a common base framework without a lot of work.


I did think about the possibility of building Twig on top of Objectify  
instead of the low-level interface.  But it would probably add a  
little more overhead and not be visible in the API anyway.  There may  
be better ways to share functionality.




I do envy the
twig ansync operations; although I worry a bit about using the
Protocol Buffers interfaces.


Im sure they will be opened up soon enough and officially supported.   
I remember a comment from a Ikai about having no standard way to do  
async queries in JDO.  Maybe now it will receive a bit more attention.



Sometimes it is good to have two teams working on the same thing.
There is no question competition breeds better results (when it
works).


Yeah and it is good to have clear differences in approach so users can  
make a decision based on their own preferences.


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: NullPointerException while running a new app

2010-03-14 Thread Diana Cruise
Help anyone...the key here is the stack trace but it points to a line
in the generated .java file that came from the .jsp.  I am also
getting a null pointer but when I check the line number using the
generated .java on my local system, it does NOT make sense.  Hence,
the line number in production is NOT matching the line numbers
locally!!!  How do we affectively trouble-shoot a JSP stack dump on
GAE?

On Mar 13, 3:07 pm, anjolight  wrote:
> Hi I am getting the same NullPointerException.
>
> The challenge is that my app runs fine in my local eclipse but it
> gives me this error when it's deployed to app engine. And the error
> gives me very little information as to what went wrong.
>
> What's the best way to debug the nullpointerexception with JSP?
>
> On Feb 24, 5:05 pm, "Ikai L (Google)"  wrote:
>
>
>
> > What's your application ID?
>
> > On Fri, Feb 19, 2010 at 12:05 AM, Alberty Pascal
> > wrote:
>
> > > Hi all,
>
> > > while updating my application, I got the following stack for all
> > > request made on it.
> > > I try to deploy a really simple new application (created with Eclipse
> > > and its plugin) and got the same stack.
>
> > > Any idea ?
>
> > > Thanks
>
> > > Pascal
>
> > > java.lang.NullPointerException
> > >        at
> > > com.google.appengine.runtime.Request.process-7d335e6a040b96cc(Request.java)
> > >        at org.apache.jsp.index_jsp._jspService(index_jsp.java:44)
> > >        at
> > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> > >        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 
> > > org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
> > >        at 
> > > org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
> > >        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.ParseBlobUploadFilter.doFilter(ParseBlo­bUploadFilter.java:
> > > 97)
> > >        at org.mortbay.jetty.servlet.ServletHandler
> > > $CachedChain.doFilter(ServletHandler.java:1084)
> > >        at
>
> > > com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionF­ilter.java:
> > > 35)
> > >        at org.mortbay.jetty.servlet.ServletHandler
> > > $CachedChain.doFilter(ServletHandler.java:1084)
> > >        at
>
> > > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans­actionCleanupFilter.java:
> > > 43)
> > >        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.runtime.jetty.AppVersionHandlerMap.handle(AppVersionH­andlerMap.java:
> > > 238)
> > >        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
>
> > > com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequ­estParser.java:
> > > 76)
> > >        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
> > >        at
>
> > > com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceReques­t(JettyServletEngineAdapter.java:
> > > 135)
> > >        at
> > > com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
> > > 235)
> > >        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > 

[appengine-java] accessing datastore on development server

2010-03-14 Thread Steve Osborne
My Development Console at http://localhost:/_ah/admin/datastore
shows that I have data uploaded but how do I access it using Java?

I wasn't able to retrieve any record using the following lines of code
and there were no errors

pm = PMF.get().getPersistenceManager();
query = pm.newQuery(Listing.class);
query.setFilter("zipCode == zipCodeParam");
query.declareParameters("String zipCodeParam");
results = (List) query.execute("27502");
if (results.iterator().hasNext()) {
for (Listing e : results) {
// ...
}
} else {
// ... no results ...
}

-- 
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] Objectify - Twig - approaches to persistence

2010-03-14 Thread Scott Hernandez
I appreciate your concern for Objectify staying clean, and consistent.
It *is* good to have frameworks that offer different feature sets and
ways in which they implement them.

On Sun, Mar 14, 2010 at 4:27 AM, John Patterson  wrote:
> On 13 Mar 2010, at 11:00, Jeff Schnitzer wrote:
>>
>> since you can (and IMNSHO probably should) always disable automatic
>> activation and refresh the graph manually.
>
> Although I dislike premature optimisations such as this note that you can
> configure Activation to not activate any Objects by default.
>
>> After you explained the concept of uninitialized entities (the brief
>> blurb in your docs really isn't enough), I actually rather like your
>> solution!  I might even implement something similar in Objectify.  But
>> I really think you need to document the hell out of the issues
>> surrounding them.  It is very very easy to corrupt data.
>
> Despite all the talk about differences in "philosophy" and the "down
> playing" of the features in Twig I can see from the Objectify mailing list
> that discussion has already started on how it would be possible to add
> support for direct references and async parallel commands.
>
> Be very careful not to end up with an API that bulges with features that are
> tacked on as an after thought.  The Objectify Query API as it is now would
> need to explode with permutations.  Perhaps it is best to stick to the goal
> of being a more usable object capable interface to the low-level API?
>  Objectify does this very well.

I have been arguing for direct references since the beginning of
Objectify. The problem has always been one of how to implement it. The
difficulties have always been conceptual and performance related, not
actually making it work ;)

Some of the questions that come up are: how deep to you go down the
object graph, what do you do about uninitialized objects (which might
only have a key/id[+parent]), when do you get the
children/referenced-objects, what transaction do you use (the same as
the initial get, or can you specify one at each level), how do you
deal with puts (do you cascade, or require the user to explicitly put
what they've changed), do you support automatic "dirty detection"
(related to the last question), are there any special behaviors with
delete, does the implementation seem obvious (and clear) to the user?

> When Twig started as not much more than a thin wrapper around the low-level
> interface and grew in complexity as more high level Object oriented features
> were added it became obvious that mixing direct references and low-level
> Keys and Queries in the same API is just not manageable.  So I stripped out
> almost all the low-level references and the result is a very clean, focused
> API.
>
> Adding a collection of helper functions to Objectify for things like merging
> OR queries would very soon become unorganised and make exploring the API
> difficult.

"Or" support should be trivial, as you have said. You just add an "Or"
method to our query object (maybe changing the current "filter" method
to "and"). All the work goes on below the covers.

> You should probably make a decision about the design goals of Objectify and
> stay true to it.  There is always the option of building a higher-level
> interface on top of Objectify - now that would be interesting!  In Twig you
> have the option to drop down to use the low-level datastore service if you
> really need to - but the necessity for this has decreased a lot with the
> final release 1.0
>
> Although this our-answer-to-the-great-question-is-the-only-logical-one
> banter is terrific fun it might make sense to work on some functionality in
> common.  Scott and I briefly mentioned making a common profiling ApiProxy to
> help understand the performance of your app.  I've made a quick start on
> this but it really is a feature that makes sense not just for Twig.

We have a lot of room to create some common shared utility libraries
(for performance tuning/collection, async operations, mapping
properties, etc.). In fact, it would be a great step forward if we
could make sure the mapping for our objects follow the same naming
scheme. For things like Embedded it is important that we represent the
entity mapping the same so that people can changes from
twig/objectify/other-framework without having to re-process all their
entities. John, what do you think about that?

> If the feature sets of Twig and Objectify end up converging over time -
> albeit with differences in default settings - it begs the question if there
> might be some way to cooperate on higher level functionality also.

It does strike me that much of our framework functionality is common,
and therefor is probably a wasted effort (if we could work together
with a shared code base). However, looking at the coding styles and
philosophies I don't think we would (immediately) benefit from
creating a common base framework without a lot of work. I do envy the
twig ansync operations; although I worr

Re: [appengine-java] Objectify - Twig - approaches to persistence

2010-03-14 Thread Duong BaTien
Hi Jeff and John:

Wow! This is the spirit of open source where we can focus on what we are
interesting in to Share our unique comparative advantages while learning
and leveraging on others for the benefits of the Whole.

Thanks guys.

Duong BaTien
DBGROUPS and BudhNet


On Sun, 2010-03-14 at 19:27 +0700, John Patterson wrote:
> On 13 Mar 2010, at 11:00, Jeff Schnitzer wrote:
> > since you can (and IMNSHO probably should) always disable automatic
> > activation and refresh the graph manually.
> 
> Although I dislike premature optimisations such as this note that you  
> can configure Activation to not activate any Objects by default.
> 
> > After you explained the concept of uninitialized entities (the brief
> > blurb in your docs really isn't enough), I actually rather like your
> > solution!  I might even implement something similar in Objectify.  But
> > I really think you need to document the hell out of the issues
> > surrounding them.  It is very very easy to corrupt data.
> 
> Despite all the talk about differences in "philosophy" and the "down  
> playing" of the features in Twig I can see from the Objectify mailing  
> list that discussion has already started on how it would be possible  
> to add support for direct references and async parallel commands.
> 
> Be very careful not to end up with an API that bulges with features  
> that are tacked on as an after thought.  The Objectify Query API as it  
> is now would need to explode with permutations.  Perhaps it is best to  
> stick to the goal of being a more usable object capable interface to  
> the low-level API?  Objectify does this very well.
> 
> When Twig started as not much more than a thin wrapper around the low- 
> level interface and grew in complexity as more high level Object  
> oriented features were added it became obvious that mixing direct  
> references and low-level Keys and Queries in the same API is just not  
> manageable.  So I stripped out almost all the low-level references and  
> the result is a very clean, focused API.
> 
> Adding a collection of helper functions to Objectify for things like  
> merging OR queries would very soon become unorganised and make  
> exploring the API difficult.
> 
> You should probably make a decision about the design goals of  
> Objectify and stay true to it.  There is always the option of building  
> a higher-level interface on top of Objectify - now that would be  
> interesting!  In Twig you have the option to drop down to use the low- 
> level datastore service if you really need to - but the necessity for  
> this has decreased a lot with the final release 1.0
> 
> Although this our-answer-to-the-great-question-is-the-only-logical-one  
> banter is terrific fun it might make sense to work on some  
> functionality in common.  Scott and I briefly mentioned making a  
> common profiling ApiProxy to help understand the performance of your  
> app.  I've made a quick start on this but it really is a feature that  
> makes sense not just for Twig.
> 
> If the feature sets of Twig and Objectify end up converging over time  
> - albeit with differences in default settings - it begs the question  
> if there might be some way to cooperate on higher level functionality  
> also.
> 
> > OR queries haven't been a pain point.  Maybe they will
> > be in the future, in which case we'll consider adding the feature.  We
> > are content to wait for the 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] Re: Precompilation fails

2010-03-14 Thread guillaume
Thank you Don, it works now!

On Mar 11, 8:56 pm, Don Schwarz  wrote:
> I've identified a bug in the precompilation process (well, another symptom
> of a problem we were already working on fixing).
>
> As a workaround, if you can stop providing play-gae.jar in both WEB-INF/lib
> and WEB-INF/modules/gae/lib this issue should go away.  Those two files just
> need to not have identical contents (they can still be named the same and
> contain effectively the same class files, if you'd like).
>
>
>
> On Thu, Mar 11, 2010 at 7:47 AM, guillaume  wrote:
> > Hi,
>
> > I manage the Google App Engine module for the Play! java web framework
> > (http://www.playframework.org). While generated applications run
> > correctly on the local and production runtimes, the precompilation
> > process always fail.
>
> > It seems that any war generated by play cannot be precompiled (So for
> > example this app:http://play-lists.appspot.com).
>
> > It's true that we are doing a lot of very dirty hacks in play
> > framework...
> > But any chance to have a hint on why the precompilation process fail?
> > This way I could try to find a fix.
>
> > Thank you.
>
> > Guillaume.
>
> > --
> > 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] How to best run GWTTestCase tests that involve persistence?

2010-03-14 Thread Christian Schuhegger
Hello,

I am doing experiments with a simple service QuestionService and I
have a GWTTestCase that calls the QuestionService. All works fine, but
my problem is that in the QuestionServiceImpl constructor I have to
use the LocalServiceTestHelper helper infrastructure in order to make
the whole test case work.

My problem is now that I have to introduce dependencies in my
QuestionServiceImpl on the appengine-testing jar in order to make my
GWTTestCase work! My initial tries were to use the
LocalServiceTestHelper directly in the gwtSetUp and gwtTearDown
methods of the GWTTestCase but that does of course not work, because
those classes are not compatible with the GWT (they obviously cannot
and should not be compiled to java script).

Is there any good way around this that I have to introduce a
dependency on the appengine-testing infrastructure in my service
implementation? Can I somehow detect that I am running in a
GWTTestCase, then I could at least create a if-then-else block that
only instantiates the helper in test mode.

Many thanks for any recommendations!

@RemoteServiceRelativePath("question")
public interface QuestionService extends RemoteService {
public QuestionDefinition createQuestionDefinition(String question);
public void deleteQuestionDefinition(QuestionDefinition qd);
public QuestionDefinition findQuestionDefinitionById(String key);
}

public class QuestionServiceImpl extends RemoteServiceServlet
implements QuestionService {

private final LocalServiceTestHelper helper = new
LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());

public QuestionServiceImpl() {
super();
helper.setUp();
}

public QuestionDefinition createQuestionDefinition(String question) {
PersistenceManager pm = PMF.get().getPersistenceManager();
QuestionDefinition qd = new QuestionDefinition(question);
try {
pm.makePersistent(qd);
} finally {
pm.close();
}
return qd;
}
  ...
}

public class GwtTestQuestionService extends GWTTestCase {

@Override
public String getModuleName() {
return "questionservice";
}

public void testQuestionServiceCreate() {
QuestionServiceAsync questionService =
GWT.create(QuestionService.class);

String question = "Are you happy?";

questionService.createQuestionDefinition(question,
new AsyncCallback() {
public void onFailure(Throwable caught) 
{
Assert.fail();
finishTest();
}

public void 
onSuccess(QuestionDefinition result) {
Assert.assertNotNull(result);
finishTest();
}
});
delayTestFinish(5000);
}
}

-- 
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: Best way to perform search on DataStore - Design Question

2010-03-14 Thread John Patterson
Interesting to see the existence protected  
Query.setFullTextSearch(String) method when you open the Query class  
in Eclipse.  I suppose it won't be too far away.  I can't wait to see  
if they just give us a take-it-or-leave-it solution or also the tools  
required to roll your own.


On 14 Mar 2010, at 15:05, Robert Lancer wrote:


Haha, like many of us you probably thought that GOOGLE app engine
would have decent text search capabilities.

It looks like your doing all you can do by creating the inverse table,
you may just want to star 
http://code.google.com/p/googleappengine/issues/detail?id=217


On Mar 13, 8:59 pm, niraj  wrote:

My case:
I am building a website that has several searchable fields from
various entities (example Artist names from artist entity , Album
names from album entity). To have an efficient search capability I
have defined another Entity - SearchType which carries the Searchable
string and the Foreign key to the Entity. Instead of querying all the
Entities one my one - I query SearchType.

My preliminary tests indicate that the query  performance on
SearchType is not great (the names are indexed) . I need google
suggest like quick results in a drop down. What is the best way to
design this.

I have considered Memcache , but I dont think I can run queries on
Memcache . i.e I am running a startsWith() query on JDO today.

Any best practices .


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




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



Re: [appengine-java] Objectify - Twig - approaches to persistence

2010-03-14 Thread John Patterson


On 13 Mar 2010, at 11:00, Jeff Schnitzer wrote:

since you can (and IMNSHO probably should) always disable automatic
activation and refresh the graph manually.


Although I dislike premature optimisations such as this note that you  
can configure Activation to not activate any Objects by default.



After you explained the concept of uninitialized entities (the brief
blurb in your docs really isn't enough), I actually rather like your
solution!  I might even implement something similar in Objectify.  But
I really think you need to document the hell out of the issues
surrounding them.  It is very very easy to corrupt data.


Despite all the talk about differences in "philosophy" and the "down  
playing" of the features in Twig I can see from the Objectify mailing  
list that discussion has already started on how it would be possible  
to add support for direct references and async parallel commands.


Be very careful not to end up with an API that bulges with features  
that are tacked on as an after thought.  The Objectify Query API as it  
is now would need to explode with permutations.  Perhaps it is best to  
stick to the goal of being a more usable object capable interface to  
the low-level API?  Objectify does this very well.


When Twig started as not much more than a thin wrapper around the low- 
level interface and grew in complexity as more high level Object  
oriented features were added it became obvious that mixing direct  
references and low-level Keys and Queries in the same API is just not  
manageable.  So I stripped out almost all the low-level references and  
the result is a very clean, focused API.


Adding a collection of helper functions to Objectify for things like  
merging OR queries would very soon become unorganised and make  
exploring the API difficult.


You should probably make a decision about the design goals of  
Objectify and stay true to it.  There is always the option of building  
a higher-level interface on top of Objectify - now that would be  
interesting!  In Twig you have the option to drop down to use the low- 
level datastore service if you really need to - but the necessity for  
this has decreased a lot with the final release 1.0


Although this our-answer-to-the-great-question-is-the-only-logical-one  
banter is terrific fun it might make sense to work on some  
functionality in common.  Scott and I briefly mentioned making a  
common profiling ApiProxy to help understand the performance of your  
app.  I've made a quick start on this but it really is a feature that  
makes sense not just for Twig.


If the feature sets of Twig and Objectify end up converging over time  
- albeit with differences in default settings - it begs the question  
if there might be some way to cooperate on higher level functionality  
also.



OR queries haven't been a pain point.  Maybe they will
be in the future, in which case we'll consider adding the feature.  We
are content to wait for the 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] Hebrew Chat on App Engine

2010-03-14 Thread Henning
Hello my dears,

I published today my first application run on Google App Engine.
Backend is Java, de-/serialization GraniteDS, frontend Flex/Flash. It
is totally free. To use it you just have to create a new account on-
site.

It is a state-of-the-art chat designed to be used by Hebrew students
and study groups to communicate easily with each other live in English/
Hebrew. Writing in Hebrew is very easy thanks to the fully integrated
virtual keyboard that can be customized in many ways. Full niqqud is
supported. Everyone can create chat rooms. A room can optionally be
password protected to restrict the access. It is a great tool for
study groups to meet on a regular basis to practice Hebrew online
together.

The link to the website is:

http://www.StudyHebrewOnline.com

Best regards,
Henning

www.StudyHebrewOnline.com

-- 
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: Best way to perform search on DataStore - Design Question

2010-03-14 Thread Robert Lancer
Haha, like many of us you probably thought that GOOGLE app engine
would have decent text search capabilities.

It looks like your doing all you can do by creating the inverse table,
you may just want to star 
http://code.google.com/p/googleappengine/issues/detail?id=217





On Mar 13, 8:59 pm, niraj  wrote:
> My case:
> I am building a website that has several searchable fields from
> various entities (example Artist names from artist entity , Album
> names from album entity). To have an efficient search capability I
> have defined another Entity - SearchType which carries the Searchable
> string and the Foreign key to the Entity. Instead of querying all the
> Entities one my one - I query SearchType.
>
> My preliminary tests indicate that the query  performance on
> SearchType is not great (the names are indexed) . I need google
> suggest like quick results in a drop down. What is the best way to
> design this.
>
> I have considered Memcache , but I dont think I can run queries on
> Memcache . i.e I am running a startsWith() query on JDO today.
>
> Any best practices .

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