[appengine-java] quering list property

2010-07-23 Thread Andrei
I have about 2000 entities with list property
Each list property has about 30 strings
I only return keys when querying list property
Is it normal that it takes several CPU seconds to do that?
Is it feasible to have 100,000 entities and query them on list
property?
Thanks

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



[appengine-java] Re: limit on the entities in the entitygroup

2010-07-23 Thread Jagan
Hi Aswanth

I am a beginner wrt 'Entity Groups', but here are my thoughts and
questions from what I got to know from Documentation and others. (I
may be wrong.)

1. Are you sure concurrent requests for a single tenant for ur app is
going to stay within 3-5 for long or for ever?

2. Documentation suggests to use Entity Groups only when they are
needed for Transactions. So have you did enough analysis on what
transactional boundaries you are going to apply on your entities? Are
those analysis in sync with your plan of placing most of the entities
of a single tenant in the same entity group?

3. Are you aware that if a request is operating on the entity group of
a tenant, another parallel request to operate on the same entity group
of the same tenant has to _stall_ until the first transaction is over?
Are you ready to make that trade-off, for any transaction support that
such entity grouping offers?

4. To answer your question straight. here is a blog that has the
answer: http://www.logilab.org/blogentry/5223

Quote from the blog: "There is no limit to the number of entity groups
or to the number of entities per group, but because of the locking
strategy, large entity groups will cause high contention and a lot of
failed transactions. Since writes are expensive, not thinking about
write throughput is a very bad idea when designing an AppEngine
application if one want it to scale."

Thanks
Jagan


On Jul 23, 9:05 am, aswath satrasala 
wrote:
> Hello,
> I am writing a multi-tenant accounting app for SMB's.
> Is there any limit on the number of entities in the entitygroup?   I am
> planning to put most of the entities in one entity group for each tenant.
> Since my app is for SMB's, the number of concurrent users is 3-5. Hence, I
> don't anticipate the loss of concurrency, even if I put most of the entities
> for each tenant in the same entitygroup.
>
> Any suggestions
> -Aswath

-- 
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 upload primary key as an id instead of name

2010-07-23 Thread John Patterson
I have used RemoteDatastore to upload and download data in bulk.  You  
can set whatever id you want.


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

On 23 Jul 2010, at 10:01, Subhash wrote:


Hi Uberto,


Otherwise if all your existing ids are numeric you can change
bulkloader to create the id instead of name.


How I can upload exiting data with id as numeric not with name as
string.

My .yaml file format is given below:

transformers:
- kind:User
 connector: csv
 connector_options:
   encoding: utf-8
   columns: from_header
 property_map:
   - property: __key__
 external_name: UserId
 export_transform: datastore.Key.id
   - property: UserName
 external_name: UserName

Any help/suggestion in this regard will be highly appreciated.

Regards,
Subhash


On Jul 22, 7:04 pm, Uberto Barbini  wrote:
On Thu, Jul 22, 2010 at 3:49 PM, MANISH DHIMAN  
 wrote:



Let me explain once again if I missed something earlier. I have an
existing task management application & wants to shift it now to  
google

app engine. While I tried porting my existing data into google app
engine using BulkLoader 1.3.5 with csv file, all my IDs saved as
string (not as long). Suppose I was having a user withid=1 (long),  
it

uploaded into google app engine withname=1(String). Now when I am
saving new records directly on google app engine using my  
application

running on google app engine, it saves an another record with
id=1(this time it's long). So it's not possible for me to  
identifiy b/

w these two records (one withid=1 & another withname=1).


If you want to use names you have to put some logic in your app and
create them also for new objects before saving.

Otherwise if all your existing ids are numeric you can change
bulkloader to create theidinstead ofname.

I think gae behavior is clear, simple and consistent.

cheers

Uberto


--
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] Is there a plan to upload GAE jars to maven anymore?

2010-07-23 Thread Nacho Coloma
I have tried to upgrade to GAE 1.3.5 and found that my usual maven
repository does not work anymore. So far the GAE jars can be found
here:

maven central: http://repo1.maven.org/maven2/ - up to 1.3.1
google-maven-repository: http://code.google.com/p/google-maven-repository/
- up to 1.2.1
mvnsearch: http://www.mvnsearch.org/maven2 - up to 1.3.3.1

Is there any official position here? Maven repositories are to java
development like CPAN to Perl or gems to Ruby. I know there is a maven
plugin, but that doesn't help since I don't use maven, just the maven
archives (same case as anyone using gradle, gant, buildr, ant ivy
etc).

This has been discussed before [1], but the issue seems dead in the
water and the number of disseminated jars make it hard to find a
reliable repository.

Best regards,

-- Nacho.
[1] 
http://groups.google.com/group/google-appengine-java/browse_thread/thread/6130b425d90e0e6a/880367b2b6ab12b5

-- 
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: Please help, I'm not able to obtain the oAuth redirect URL from twitter

2010-07-23 Thread Keith
I'm also seeing problems between app engine and twitter. There are a
also
a number of complaints from other people as well. I'm also using
twitter4j
and it has been working fine for some time and works fine when I use
it locally.
Anyone know what's going on?

On Jul 23, 6:25 am, nischalshetty  wrote:
> @Benjamin
>
> I am using twitter4j. Its not an issue on my end since the apps been
> running from 6 months now. And I just ran a check on many other
> twitter apps hosted on the app engine, none seem to be working.
>
> Can you share the url of your app?
>
> -Nischal
>
> On Jul 23, 10:03 am, Benjamin  wrote:
>
>
>
> > Sorry to hear of your trouble Nischal
>
> > I'm hitting twitter without any issue from my prod app engine - if it
> > helps, i've had a lot of success using twitter4j libraries - maybe you
> > can check them out.
>
> > The only strange thing about getting an auth token from twitter oauth
> > from app engine is how you have to direct the user to the
> > authorization url and hold the token in your session on the server
> > side while they authorize the app - then continue with the process of
> > getting an oauth token on the server.
>
> > On Jul 22, 10:33 pm, nischalshetty  wrote:
>
> > > Was searching twitter, others seem to be facing the same problem.
> > > Please treat this on priority, my entire sitehttp://www.justunfollow.com
> > > is unusable right now due to the error.
>
> > > A lot of users are stuck due to the error.
>
> > > -Nischal
>
> > > On Jul 23, 7:24 am, nischalshetty  wrote:
>
> > > > To obtain the redirect URL it's an https call to twitter. I'm just not
> > > > able to obtain it in production.
>
> > > > However, it works in my development environment on my PC. Please help
> > > > ASAP, my site gets a lot of users and this is causing problems for all
> > > > of them :(
>
> > > > Here's the stack trace :
>
> > > > twitter4j.TwitterException: Could not fetch 
> > > > URL:https://twitter.com/oauth/request_token
> > > >         at 
> > > > twitter4j.internal.http.HttpClient.request(HttpClient.java:340)
> > > >         at
> > > > twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:
> > > > 68)
> > > >         at
> > > > twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:
> > > > 99)
> > > >         at
> > > > twitter4j.http.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.j
> > > >  ava:
> > > > 121)
> > > >         at twitter4j.Twitter.getOAuthRequestToken(Twitter.java:1406)
> > > >         at
> > > > justunfollow.manager.impl.JustUnfollowManagerImpl.redirectURL(JustUnfollowM
> > > >  anagerImpl.java:
> > > > 60)
> > > >         at justunfollow.action.Login.authenticate(Login.java:56)
> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
> > > > Source)
> > > >         at java.lang.reflect.Method.invoke(Unknown Source)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_
> > > > $1.run(Method_.java:165)
> > > >         at java.security.AccessController.doPrivileged(Native Method)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_.privilegedInvoke(Method_.java:
> > > > 163)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_.invoke_(Method_.java:
> > > > 124)
> > > >         at
> > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > >  ethod_.invoke(Method_.java:
> > > > 43)
> > > >         at
> > > > com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionI
> > > >  nvocation.java:
> > > > 404)
> > > >         at
> > > > com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultAct
> > > >  ionInvocation.java:
> > > > 267)
> > > >         at
> > > > justunfollow.interceptor.ExceptionInterceptor.intercept(ExceptionIntercepto
> > > >  r.java:
> > > > 23)
> > > >         at com.opensymphony.xwork2.DefaultActionInvocation
> > > > $2.doProfiling(DefaultActionInvocation.java:224)
> > > >         at com.opensymphony.xwork2.DefaultActionInvocation
> > > > $2.doProfiling(DefaultActionInvocation.java:223)
> > > >         at
> > > > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStac
> > > >  k.java:
> > > > 455)
> > > >         at
> > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocat
> > > >  ion.java:
> > > > 221)
> > > >         at
> > > > com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(
> > > >  DefaultWorkflowInterceptor.java:
> > > > 221)
> > > >         at
> > > > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Metho
> > > >  dFilterInterceptor.java:
> > > > 86)
> > > >         at com.opensymphony.x

[appengine-java] Re: Please help, I'm not able to obtain the oAuth redirect URL from twitter

2010-07-23 Thread nischalshetty
@Keith

One of the two:

1. Either Google's URLfetch is causing problems due to which no http
and https calls are happening OR
2. Twitter has blocked google app engine

Keep a watch on this thread, my hope is as soon as one of the google
devs sees this thread they'll jump into the issue and try to sort
things out. I have started a thread on the twitter dev group too,
please leave your comment there as well so that it catches the twitter
team's attention - 
http://groups.google.com/group/twitter-development-talk/browse_thread/thread/0aca4bedd27a6a2b

-Nischal

On Jul 23, 4:41 pm, Keith  wrote:
> I'm also seeing problems between app engine and twitter. There are a
> also
> a number of complaints from other people as well. I'm also using
> twitter4j
> and it has been working fine for some time and works fine when I use
> it locally.
> Anyone know what's going on?
>
> On Jul 23, 6:25 am, nischalshetty  wrote:
>
>
>
> > @Benjamin
>
> > I am using twitter4j. Its not an issue on my end since the apps been
> > running from 6 months now. And I just ran a check on many other
> > twitter apps hosted on the app engine, none seem to be working.
>
> > Can you share the url of your app?
>
> > -Nischal
>
> > On Jul 23, 10:03 am, Benjamin  wrote:
>
> > > Sorry to hear of your trouble Nischal
>
> > > I'm hitting twitter without any issue from my prod app engine - if it
> > > helps, i've had a lot of success using twitter4j libraries - maybe you
> > > can check them out.
>
> > > The only strange thing about getting an auth token from twitter oauth
> > > from app engine is how you have to direct the user to the
> > > authorization url and hold the token in your session on the server
> > > side while they authorize the app - then continue with the process of
> > > getting an oauth token on the server.
>
> > > On Jul 22, 10:33 pm, nischalshetty  wrote:
>
> > > > Was searching twitter, others seem to be facing the same problem.
> > > > Please treat this on priority, my entire sitehttp://www.justunfollow.com
> > > > is unusable right now due to the error.
>
> > > > A lot of users are stuck due to the error.
>
> > > > -Nischal
>
> > > > On Jul 23, 7:24 am, nischalshetty  wrote:
>
> > > > > To obtain the redirect URL it's an https call to twitter. I'm just not
> > > > > able to obtain it in production.
>
> > > > > However, it works in my development environment on my PC. Please help
> > > > > ASAP, my site gets a lot of users and this is causing problems for all
> > > > > of them :(
>
> > > > > Here's the stack trace :
>
> > > > > twitter4j.TwitterException: Could not fetch 
> > > > > URL:https://twitter.com/oauth/request_token
> > > > >         at 
> > > > > twitter4j.internal.http.HttpClient.request(HttpClient.java:340)
> > > > >         at
> > > > > twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:
> > > > > 68)
> > > > >         at
> > > > > twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:
> > > > > 99)
> > > > >         at
> > > > > twitter4j.http.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.j
> > > > >  ava:
> > > > > 121)
> > > > >         at twitter4j.Twitter.getOAuthRequestToken(Twitter.java:1406)
> > > > >         at
> > > > > justunfollow.manager.impl.JustUnfollowManagerImpl.redirectURL(JustUnfollowM
> > > > >  anagerImpl.java:
> > > > > 60)
> > > > >         at justunfollow.action.Login.authenticate(Login.java:56)
> > > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
> > > > > Source)
> > > > >         at java.lang.reflect.Method.invoke(Unknown Source)
> > > > >         at
> > > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > > >  ethod_
> > > > > $1.run(Method_.java:165)
> > > > >         at java.security.AccessController.doPrivileged(Native Method)
> > > > >         at
> > > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > > >  ethod_.privilegedInvoke(Method_.java:
> > > > > 163)
> > > > >         at
> > > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > > >  ethod_.invoke_(Method_.java:
> > > > > 124)
> > > > >         at
> > > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > > >  ethod_.invoke(Method_.java:
> > > > > 43)
> > > > >         at
> > > > > com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionI
> > > > >  nvocation.java:
> > > > > 404)
> > > > >         at
> > > > > com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultAct
> > > > >  ionInvocation.java:
> > > > > 267)
> > > > >         at
> > > > > justunfollow.interceptor.ExceptionInterceptor.intercept(ExceptionIntercepto
> > > > >  r.java:
> > > > > 23)
> > > > >         at com.opensymphony.xwork2.DefaultActionInvocation
> > > 

[appengine-java] Re: Please help, I'm not able to obtain the oAuth redirect URL from twitter

2010-07-23 Thread planetjones
I'm getting this too:

Caused by: java.io.IOException: Could not fetch URL:
https://api.twitter.com/1/statuses/mentions.json?since_id=18860116961&count=100

It's a good job my app is still only being tested.

On Jul 23, 12:47 pm, nischalshetty  wrote:
> @Keith
>
> One of the two:
>
> 1. Either Google's URLfetch is causing problems due to which no http
> and https calls are happening OR
> 2. Twitter has blocked google app engine
>
> Keep a watch on this thread, my hope is as soon as one of the google
> devs sees this thread they'll jump into the issue and try to sort
> things out. I have started a thread on the twitter dev group too,
> please leave your comment there as well so that it catches the twitter
> team's attention 
> -http://groups.google.com/group/twitter-development-talk/browse_thread...
>
> -Nischal
>
> On Jul 23, 4:41 pm, Keith  wrote:
>
>
>
> > I'm also seeing problems between app engine and twitter. There are a
> > also
> > a number of complaints from other people as well. I'm also using
> > twitter4j
> > and it has been working fine for some time and works fine when I use
> > it locally.
> > Anyone know what's going on?
>
> > On Jul 23, 6:25 am, nischalshetty  wrote:
>
> > > @Benjamin
>
> > > I am using twitter4j. Its not an issue on my end since the apps been
> > > running from 6 months now. And I just ran a check on many other
> > > twitter apps hosted on the app engine, none seem to be working.
>
> > > Can you share the url of your app?
>
> > > -Nischal
>
> > > On Jul 23, 10:03 am, Benjamin  wrote:
>
> > > > Sorry to hear of your trouble Nischal
>
> > > > I'm hitting twitter without any issue from my prod app engine - if it
> > > > helps, i've had a lot of success using twitter4j libraries - maybe you
> > > > can check them out.
>
> > > > The only strange thing about getting an auth token from twitter oauth
> > > > from app engine is how you have to direct the user to the
> > > > authorization url and hold the token in your session on the server
> > > > side while they authorize the app - then continue with the process of
> > > > getting an oauth token on the server.
>
> > > > On Jul 22, 10:33 pm, nischalshetty  wrote:
>
> > > > > Was searching twitter, others seem to be facing the same problem.
> > > > > Please treat this on priority, my entire 
> > > > > sitehttp://www.justunfollow.com
> > > > > is unusable right now due to the error.
>
> > > > > A lot of users are stuck due to the error.
>
> > > > > -Nischal
>
> > > > > On Jul 23, 7:24 am, nischalshetty  wrote:
>
> > > > > > To obtain the redirect URL it's an https call to twitter. I'm just 
> > > > > > not
> > > > > > able to obtain it in production.
>
> > > > > > However, it works in my development environment on my PC. Please 
> > > > > > help
> > > > > > ASAP, my site gets a lot of users and this is causing problems for 
> > > > > > all
> > > > > > of them :(
>
> > > > > > Here's the stack trace :
>
> > > > > > twitter4j.TwitterException: Could not fetch 
> > > > > > URL:https://twitter.com/oauth/request_token
> > > > > >         at 
> > > > > > twitter4j.internal.http.HttpClient.request(HttpClient.java:340)
> > > > > >         at
> > > > > > twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:
> > > > > > 68)
> > > > > >         at
> > > > > > twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:
> > > > > > 99)
> > > > > >         at
> > > > > > twitter4j.http.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.j
> > > > > >  ava:
> > > > > > 121)
> > > > > >         at twitter4j.Twitter.getOAuthRequestToken(Twitter.java:1406)
> > > > > >         at
> > > > > > justunfollow.manager.impl.JustUnfollowManagerImpl.redirectURL(JustUnfollowM
> > > > > >  anagerImpl.java:
> > > > > > 60)
> > > > > >         at justunfollow.action.Login.authenticate(Login.java:56)
> > > > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> > > > > > Method)
> > > > > >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown 
> > > > > > Source)
> > > > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
> > > > > > Source)
> > > > > >         at java.lang.reflect.Method.invoke(Unknown Source)
> > > > > >         at
> > > > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > > > >  ethod_
> > > > > > $1.run(Method_.java:165)
> > > > > >         at java.security.AccessController.doPrivileged(Native 
> > > > > > Method)
> > > > > >         at
> > > > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > > > >  ethod_.privilegedInvoke(Method_.java:
> > > > > > 163)
> > > > > >         at
> > > > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > > > >  ethod_.invoke_(Method_.java:
> > > > > > 124)
> > > > > >         at
> > > > > > com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.M
> > > > > >  ethod_.invoke(Method_.java:
> > > > > > 43)
> > > >

[appengine-java] Users management for non-google accounts

2010-07-23 Thread cghersi
Good afternoon,

I'm very new to GAE, and I cannot understand how may I merge the
account management for users having and not having a Google account.

I would like to have a single sign-in page (google style) where users
with google accounts can type their Google credentials and enter in my
app, while users without google accounts can type their "MyApp-
customized" credentials and enter the same.

Is it feaseable?

Or do I have to create my own Users table and replicate the users
accounts for the users provided with Google accounts?

Thank you very much!

Bye



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



Re: [appengine-java] Re: GAE Deployment - Unable to compile JSP

2010-07-23 Thread Rajeev Dayal
Hey Mukesh,

Are there any other parts to the error message? There should be more
information right about the "Failed to Compile JSP Files" line. Do you see
anything more in the Console View or Error Log?


Rajeev

On Thu, Jul 22, 2010 at 9:03 AM, Shoubhik  wrote:

> Hi Mukesh,
>
> have you copied the
>  tools.jar from .../JDK1.6/lib to .../JRE1.6/lib   ?
> And  javac.exe from .../JDK1.6/bin  to   JRE1.6/lib   ?
>
>
> if not ,
> try these,.
>
> Also,check whether you have kept any unnecessary .jsp files in your /
> war directory...(or the one appropriate in ur app's case).
>
> Regards,
> Shoubhik.
>
> --
> 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] Ancestor queries on explicitly created entity groups in JDO?

2010-07-23 Thread emurmur
In my application I'm using JDO.  In some cases, I have un-owned
relationships where I explicitly created my own entity group because I
need to be able to do transactions with a group of records.  For
instance;

@PersistenceCapable(identityType = IdentityType.APPLICATION,
detachable = "true")
public class Customer
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long customerId = null;

...

}

@PersistenceCapable(identityType = IdentityType.APPLICATION,
detachable = "true")
public class User
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key userId = null;

@Persistent(defaultFetchGroup="true")
private Long customerId = null; // foreign-key for Customer

...
}

When I persist a User, I set the parent part of the userId key, then
let JDO fill in the id portion when I call save().  This all works
well.  However, sometimes I want to query a set of User's by the
Customer's id.  As you can see above, I've duplicated the customerId
in the User record for this purpose.  This works fine, but it takes an
extra field and creates an extra index.  What I'd really like to do is
to query the  User key's parent part so I can save an index, which
could add up over time.  I already have records in a production
database that have the above structure, so anything I do needs to be
backward compatible.  Everything I see in the docs assumes that you
are using JDO to maintain owned relationships, but I'm not doing
that.  I've tried using the 'parent-pk' field Datanucleus extension in
a query where I create a full Customer Key from the customerId field,
but I get an exception.  I believe this is because this 'virtual'
field is created by JDO only for owned relationships (but that is just
a guess).  Is there an explicit way within JDO to do an ancestor query
using the parent key if you are using unowned relationships?

-- 
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: parent filed in child object which is obtained via query becomes null

2010-07-23 Thread Art
Sorry, I found that it caused by the mistake my sleepy head made:
I had defaultFetchGroup attribute on Persistent annotation statement
for the child field in the parent object, but not for the parent field
in the child object in those class files.

Please ignore the post.
Warm regards,
Art

On Jul 22, 11:09 pm, Art  wrote:
> Dear group,
>
> Would you mind asking the reason why, in owned one-to-many
> relationship, parent filed in child object which is obtained via query
> becomes null?
> That is actually asked at the below posts, but I did not see the
> answer.http://groups.google.com/group/google-appengine-java/browse_frm/threa...http://groups.google.com/group/google-appengine-java/browse_frm/threa...
>
> By using the Book class and Chapter class 
> fromhttp://groups.google.com/group/google-appengine-java/browse_frm/threa...
>
> public void testRelation() throws Exception {
>         Book b = new Book();
>         b.title = "JDO 4eva";
>
>         Chapter c1 = new Chapter();
>         c1.title = "Intro";
>         c1.numPages = 10;
>
>         b.chapters.add( c1);
>
>         Chapter c2 = new Chapter();
>         c2.title = "Configuration";
>         c2.numPages = 9;
>         b.chapters.add( c2);
>
>         pm = pmf.getPersistenceManager();
>         pm.setDetachAllOnCommit( true);
>         pm.currentTransaction().begin();
>         try {
>                 pm.makePersistent( b);
>                 pm.currentTransaction().commit();
>
>                 assertEquals( b, c1.book);
>                 assertEquals( b, c2.book);
>
>         } finally {
>                 if (pm.currentTransaction().isActive()) {
>                         pm.currentTransaction().rollback();
>                 }
>                 pm.close();
>         }
>
>         // Confirm on child field in parent object
>         pm = pmf.getPersistenceManager();
>         Query query = pm.newQuery( Book.class);
>         List bookList = (List)query.execute();
>         // Sanity check on book
>         assertEquals( 1, bookList.size());
>         Book bookEntityGroup = bookList.get( 0);
>         assertEquals( b.title, bookEntityGroup.title);
>         // Sanity check on chapters field
>         assertEquals( 2, bookEntityGroup.chapters.size());
>         for( Chapter chapter : bookEntityGroup.chapters) {
>                 assertTrue(
>                                 chapter.title.equals( c1.title) ? true :
> chapter.title.equals( c2.title) ? true : false
>                                 );
>         } // for
>         pm.close();
>
>         // Confirm on parent field in child object
>         pm = pmf.getPersistenceManager();
>         query = pm.newQuery( Chapter.class);
>         List chapterList = (List)query.execute();
>         assertEquals( 2, chapterList.size());
>         for( Chapter chapter : chapterList) {
>                 assertTrue(
>                                 chapter.title.equals( c1.title) ? true :
> chapter.title.equals( c2.title) ? true : false
>                                 );
>                 assertNotNull( chapter.book);   // This fails
>         } // for
>         query.close( chapterList);
>         pm.close();
>
> }
>
> Warm regards,
> Art

-- 
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: quering list property

2010-07-23 Thread Andrei
I watched presentation from Google IO and followed the idea.
http://code.google.com/events/io/2009/sessions/BuildingScalableComplexApps.html
I want to understand If I am doing something wrong or it is not
possible with BigTable
to query entity keys on list property selecting from more than hundred
entities under a second
Does the query time grow if queering more entities?
Can I query 100K entities on list property ( set of strings ),
selecting just keys, under a second
Could somebody from Google reply
Thanks


On Jul 23, 3:49 am, Andrei  wrote:
> I have about 2000 entities with list property
> Each list property has about 30 strings
> I only return keys when querying list property
> Is it normal that it takes several CPU seconds to do that?
> Is it feasible to have 100,000 entities and query them on list
> property?
> 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.