[appengine-java] Re: Problem with exception on server startup when GAE sdk is in svn

2012-02-22 Thread Max Ross (Google)
It's a bug triggered by the fact that the .svn directories are read-only. 
If you make those directories writable the problem *should* go away. Please 
try that out and let me know.

Thanks,
Max

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/KFK8hW26r28J.
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.



Re: [appengine-java] Re: Number of writes per second limitation

2011-11-07 Thread Max Ross (Google)
5 put() RPCs plus one more for the commit, although you could use a batch 
put to turn this into 1 put() RPC plus one more for the commit. These are 
implementation details though. We may at some point just hold on to the 
entire mutation until commit time (easy if you're not asking us to generate 
ids for any of your entities, harder if you are since we would then need to 
maintain a client-side cache of ids to avoid RPCs just for id-generation).

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



[appengine-java] DataNucleus App Engine Plugin v2.0.0-RC1 available for testing

2011-11-01 Thread Max Ross (Google)
JPA 2, JDO 3, unowned relationships, and tons of bug fixes.

https://plus.google.com/102837845875216819095/posts/9U9VFWqhPx7

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/zwhh5eEfXx8J.
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.



Re: [appengine-java] Re: JDO and XG transactions - Performance

2011-10-17 Thread Max Ross (Google)
We debated this quite a bit internally.  To paraphrase the argument that 
carried the day:
XG transactions are awesome but they are not true global transactions. 
 You're limited to 5 entity groups, you're more likely to see partially 
applied transactions in global query results, you can get a concurrency 
exception from a *read*, and there is a performance impact (when you've got 
more than 1 entity group enlisted).  In short, there's some 
surprising/subtle stuff that we really want developers to understand before 
they start using this feature.  

If we didn't require opt-in it would be too easy for our new developers 
(particularly those coming from the RDBMS world where global transactions 
are the norm) to miss these important considerations.  We want it to be 
super easy to use the Datastore, but creating a false sense of simplicity 
can do more harm than good in the long run.

Max

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



[appengine-java] Re: XG Transactions with JDO/JPA

2011-10-13 Thread Max Ross (Google)
Enabling HR locally is described here:
http://code.google.com/appengine/docs/java/tools/devserver.html#Using_the_Datastore

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



[appengine-java] XG Transactions with JDO/JPA

2011-10-12 Thread Max Ross (Google)
Hi everyone,

Due to a mix-up, the JDO/JPA jars that are included in the 1.5.5 SDK do *not 
*support XG Transactions.  If you want to use XG Transactions with JDO or 
JPA in 1.5.5 you can download an updated jar 
from 
http://code.google.com/p/datanucleus-appengine/downloads/detail?name=datanucleus-appengine-1.0.10.final.jar
 
and follow the installation instructions on that page.

Please let me know if you have any problems with it.

Sorry for the trouble,
Max

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/WXNFlj2PlvwJ.
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.



Re: [appengine-java] Re: why the development of java tools fall far behind that of python's?

2011-05-26 Thread Max Ross (Google)
I would also point out that it is possible for Java apps to migrate from
Master/Slave to High Replication:
http://code.google.com/appengine/docs/adminconsole/datastoreadmin.html#Copying_Entities_to_Another_Application

Having to create an empty Python version of your app is no doubt clunky and
not something we're happy about having to recommend, but it doesn't take
much effort and it does work.

Max

On Thu, May 26, 2011 at 9:37 AM, Mitch Rudominer wrote:

> Tapir, thanks for your feedback. I agree that there have been several
> cases where features have come out in Python long before Java. (There
> have been a few in the other direction too, but not as many.) This is
> something we are trying to improve upon in the future.
>
> I'm happy to tell you that one of the items in your list, 1. remove
> obsolete indexes, is supported in Java and has been since release
> 1.4.2 earlier this year. This feature is called vacuum indexes.
>
> - Mitch
>
> On May 25, 9:00 am, Tapir  wrote:
> > such as:
> > 1. remove obsolete indexes
> > 2. copy Mater-Slave data to High Replication
> >
> > I think if these tools are already done in python, it would be easy to
> > port them in java within one week, especially for your googlers.
> >
> > But why have you done these yet? You know, these tools are so
> > essential. Many java developers feel hopeless now.
>
> --
> 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-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.



Re: [appengine-java] Multiple Async get vs one Sync batch get?

2010-12-17 Thread Max Ross (Google)
Interesting results!  I've run similar tests with writes (put and delete)
and my results indicate that in most situations, multiple async writes will
perform better than one batch sync call.  I can't think of any reason this
wouldn't be the case for reads as well.  Are your entities all in different
entity groups?

Thanks,
Max

On Fri, Dec 17, 2010 at 4:11 PM, Ikai Lan (Google)

> wrote:

> Very cool. Thanks for posting!
>
> What kind of processing are you doing after you retrieve the entities? I'm
> surprised it made a difference.
>
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blogger: http://googleappengine.blogspot.com
> Reddit: http://www.reddit.com/r/appengine
> Twitter: http://twitter.com/app_engine
>
>
>
> On Fri, Dec 17, 2010 at 2:48 PM, Gal Dolber  wrote:
>
>> Even better :)
>>
>> [image: Screen shot 2010-12-17 at 7.48.44 PM.png]
>>
>>
>> On Fri, Dec 17, 2010 at 7:31 PM, Gal Dolber  wrote:
>>
>>> Here are my results if anyone interested.
>>>
>>> The idea was splitting a batch into multiple async gets so I could start
>>> processing each results while the others were being fetched.
>>> With the batch get I need to wait until I get all the results to do the
>>> next operations.
>>>
>>> At the end (on my situation) batching won.
>>> *
>>> *
>>> *Multiple async gets*
>>> [image: MultipleAsyncs.png]
>>>
>>> *Batching*
>>>
>>> [image: Batch.png]
>>>
>>>
>>> On Thu, Dec 16, 2010 at 4:48 PM, Gal Dolber wrote:
>>>
 Yes, I am talking about datastore api.

 I made some isolated tests and the batch always wins (no by so much).

 But in my app, when I break the batch into multiple async gets, I can
 start processing each async get result (and doing another api calls)
 before... and it seems to be perform better.

 I'll keep doing tests and post if find anything interesting.
 Thanks!


 On Thu, Dec 16, 2010 at 2:42 PM, Ikai Lan (Google) <
 ikai.l+gro...@google.com > wrote:

> You're talking about the datastore API? Underneath the hood,
> synchronous gets just make asynchronous calls and block on Future.get()
> anyway. Making a single synchronous batch get would translate to a single
> asynchronous RPC with multiple keys vs. multiple asynchronous get RPCs. I
> suspect the single batch call will perform better from a CPU cost/quota
> perspective, but I'd defer to AppStats benchmarks as the authoritative
> answer.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blogger: http://googleappengine.blogspot.com
> Reddit: http://www.reddit.com/r/appengine
> Twitter: http://twitter.com/app_engine
>
>
>
> On Wed, Dec 15, 2010 at 3:38 AM, Gal Dolber wrote:
>
>>  Should I expect the similar performance? or the batch will always be
>> better?
>>
>> --
>> 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.
>



 --
 Guit: Elegant, beautiful, modular and *production ready* gwt
 applications.

 http://code.google.com/p/guit/





>>>
>>>
>>> --
>>> Guit: Elegant, beautiful, modular and *production ready* gwt
>>> applications.
>>>
>>> http://code.google.com/p/guit/
>>>
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Guit: Elegant, beautiful, modular and *production ready* gwt applications.
>>
>> http://code.google.com/p/guit/
>>
>>
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>  --
> 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 mor

Re: [appengine-java] Re: datanucleus-appengine

2010-12-03 Thread Max Ross (Google)
There's a big difference between something that is deprecated and something
that isn't getting any new features.  JDO/JPA is most certainly not
deprecated.  We are making sure it is keeping pace with our new SDK
releases, and we hope to be able to start enhancing it as soon as we can.
 There is still a lot of good and important work to be done on this library,
but the App Engine team always prioritizes the reliability and availability
of our product over feature-related work, and as of late, those of us
working on the Datastore have been almost entirely focused on the former
(did you see the mention of the "High Replication Datastore" in our latest
blog 
post
?)

Finally, I'll point out that our DataNucleus plugin is completely open
source.  If you or anyone else in the community would like to submit a patch
with thorough test cases we will be happy to work with you to get it
submitted.

Thanks,
Max

On Fri, Dec 3, 2010 at 1:32 PM, George Moschovitis <
george.moschovi...@gmail.com> wrote:

> > You're eager optimizing your support problem, when really the problem you
> > should be solving is "what do I need to build? How do I get there?"
>
> I know what I want to build. My problem is that I (obviously) need a
> Datastore API. In the Google App Engine documentation
> the endorsed API was (until now) JDO (and maybe JPA).
>
> From your earlier post I learned  that JDO/JPA support is ..kind of
> deprecated.
>
> I don't plan to create a new API myself. I would prefer to use a
> Google-endorsed API, but today there is no such thing.
> I find this annoying. I may be wrong, but this is my perspective, we
> can't all agree on everything. Still, you should keep developer
> concerns
> in mind when laying out the road map for future releases.
>
> regards,
> -g.
>
>
> PS: and yes, I 'll probably use Objectify after all...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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] no async queries on AsyncDatastoreService for 1.4.0?

2010-11-29 Thread Max Ross (Google)
Hi Luke,

First the awesome news:
As of 1.4.0, many queries are implicitly asynchronous.  When you call
PreparedQuery.asIterable() or PreparedQuery.asIterator(), we initiate the
query in the background and then immediately return.  This lets you do work
while the first batch of results is being fetched.  And, when the first
batch has been consumed we immediately request the next batch.  If you're
performing a significant amount of work with each Entity as you iterate you
will probably see a latency win as a result of this.

Now the less awesome news:
We didn't get around to making the List returned by PreparedQuery.asList()
work this same magic, but you can expect this in a future release.

Some deeper thoughts:
The underlying RPCs between your app and the datastore fetch results in
batches.  We fetch an initial batch of results, and once that batch has been
consumed we fetch the next batch.  But, there's nothing in the API that maps
to these batches - it's either a List containing the entire result set or an
Iterable/Iterator that returns Entities one at a time.  An API that provides
async access to the individual results returned by an Iterable/Iterator
(Iterator>) doesn't really make sense since you don't know
which call to hasNext() is going to require a new batch to be fetched, and
without that knowledge, the knowledge of what is going to trigger something
"expensive", you can't really make appropriate use of an asynchronous API.

Going forward, we're definitely interested in exposing these batches
directly, and an explicitly async API for these batches makes a lot of sense
since fetching these batches would map directly to something "expensive" on
the server side.

Hope this helps,
Max

On Fri, Nov 26, 2010 at 4:41 PM, Luke  wrote:

> i was taking a look at the 1.4.0 javadoc for AsyncDatastoreService.  i
> see the get, put and delete operations return a Future, but the
> prepare methods return a naked PreparedQuery object, and it doesn't
> look like PreparedQuery has any async get methods.
>
> does the AsyncDatastoreService not support asynchronous queries, or is
> there something i'm missing?
>
> glad to see at lets the get and put methods are async, hoping to get
> async queries too (as well as async interfaces to more services).
>
> --
> 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] Any changes to access levels in com.google.appengine.api.datastore recently?

2010-10-15 Thread Max Ross (Google)
We refactored the internals of the DatastoreService implementation pretty
heavily in the release we just pushed out but there shouldn't have been any
backwards incompatible changes to the public API.  I'm not familiar with
appengine-clj.  Does it use reflection to access non-public
classes/methods/fields?  If so that's not safe, since we only guarantee
backwards compatibility for the public API.  If not then I'll need more
info.

Thanks,
Max

On Thu, Oct 14, 2010 at 12:14 PM, Darren Clarke  wrote:

> Has anything changed with class access levels (public vs. private) in the 
> production datastore code in the last day or so?
>
> I've had a Clojure app running for several weeks and starting last night, 
> whenever I try to access the datastore, I get the error below. It could be a 
> bug in the library I'm using (appengine-clj) or even in Clojure's dispatch 
> code, but I just want to understand if anything has changed server-side that 
> might have triggered it. The application still works on the dev appserver 
> v1.3.7.
>
>
> java.lang.IllegalArgumentException: Can't call public method of non-public 
> class: public com.google.appengine.api.datastore.Transaction 
> com.google.appengine.api.datastore.BaseDatastoreService.getCurrentTransaction(com.google.appengine.api.datastore.Transaction)
>   at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:85)
>   at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
>   at 
> appengine.datastore.service$current_transaction.invoke(service.clj:72)
>   at appengine.datastore.service$put_entity.invoke(service.clj:131)
>   at appengine.datastore.service$fn__176.invoke(service.clj:149)
>   at 
> appengine.datastore.service$fn__136$G__116__141.invoke(service.clj:10)
>   at 
> com.redaranj.ledes.service.servlet$fn__1902$fn__1903.invoke(servlet.clj:17)
>   at compojure.core$routes$fn__1706$fn__1707.invoke(core.clj:72)
>   at clojure.core$some.invokeStatic(core.clj:2297)
>   at compojure.core$routes$fn__1706.invoke(core.clj:71)
>   at ring.middleware.params$wrap_params$fn__1468.invoke(params.clj:77)
>   at ring.middleware.cookies$wrap_cookies$fn__1559.invoke(cookies.clj:123)
>   at 
> ring.util.servlet$make_service_method$fn__1881.invoke(servlet.clj:117)
>   at com.redaranj.ledes.service.servlet$_service.invoke(servlet.clj:19)
>   at com.redaranj.ledes.service.servlet.service(Unknown Source)
>   at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
>   at 
> com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>   at 
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>   at 
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>   at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>   at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
>   at 
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>   at 
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>   at 
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>   at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
>   at 
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
>   at 
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>   at org.mortbay.jetty.Server.handle(Server.java:326)
>   at 
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>   at 
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
>   at 
> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
>   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>   at 
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
>   at 
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261)
>   at 
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8483)
>   at 
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8481)
>   at 
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
>   at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:418)
>   at com.google.net

Re: [appengine-java] SDK 1.3.8 released!

2010-10-15 Thread Max Ross (Google)
Guillaume,

Which FetchOptions class are you looking at?  The last update I see to
either of them was back in April and they were backwards compatible changes.

Thanks,
Max

On Fri, Oct 15, 2010 at 5:51 AM, Guillaume Laforge wrote:

> Excellent, thank you!
> The instances view is really nice and interesting!
>
> I just wanted to also mention that while upgrading one of my apps, one
> controller wasn't compiling against the new SDK, as there had been a
> little rename refactoring of a method:
>
> FetchOptions.Builder#withDefault
>
> is now:
>
> FetchOptions.Builder#withDefaults
>
> Notice the final 's'!
>
> Perhaps you could publish a list of API differences between releases?
> I know some OSS projects publish such documents for helping people
> upgrade to newer versions, or for showing users what the new APIs are.
>
> Anyhow, well done for this release!
>
> Guillaume
>
>
> On Fri, Oct 15, 2010 at 05:44, Takashi Matsuo  wrote:
> > Hello App Engine Developers!
> >
> > We're very happy to announce that SDK 1.3.8 is released today. There
> > are many new cool features, so please download the new SDK and enjoy
> > it!
> >
> > You can download the new SDK from:
> > http://code.google.com/appengine/downloads.html
> >
> > Our blog post includes some screenshots of new features in admin console:
> >
> http://googleappengine.blogspot.com/2010/10/new-app-engine-sdk-138-includes-new.html
> >
> > Here are release notes:
> >
> > Java
> > ---
> > Version 1.3.8
> > =
> > - You can run task queue tasks immediately from the admin console.
> > - Added an OutputSettings class to the Images API to specify the JPEG
> encoding
> >  quality when running in production.
> > - Support for login of multiple Google accounts within an app, and longer
> login
> >  sessions. For more information see:
> >http://www.google.com/support/accounts/bin/answer.py?answer=181599
> > - In queue.xml, the maximum allowed bucket size is now 100.
> > - Removed limits on zigzag merge-join queries. Therefore the error "The
> built-in
> >  indices are not efficient enough for this query and your data. Please
> add a
> >  composite index for this query." will no longer be thrown in most cases,
> >  enabling more types of queries without indexes.
> > - The whitelist has been updated to include java.net.InetAddress and some
> >  interfaces and abstract classes in javax.xml.soap, including
> >  javax.xml.soap.SOAPMessage.
> > - Fixed an issue reserving App Ids by owners of emails containing
> periods,
> >  multiple cases, and googlemail.com address.
> >http://code.google.com/p/googleappengine/issues/detail?id=1196
> > - Fixed an issue where TaskOptions had no public getters, making testing
> >  impossible.
> >http://code.google.com/p/googleappengine/issues/detail?id=3243
> > - Fixed an issue on the development server where PNGs were being returned
> as
> >  JPEGs.
> >http://code.google.com/p/googleappengine/issues/detail?id=3661
> >
> >
> > Python
> > -
> > Version 1.3.8
> > ==
> > - Builtin app.yaml handlers are available for common application
> functions,
> >  such as appstats.
> >
> http://code.google.com/appengine/docs/python/config/appconfig.html#Builtin_Handlers
> > - The Admin Console now provides an experimental tool to delete all
> entities in
> >  the datastore or all entities of a given type. This is available only if
> >  enabled using the datastore_admin builtin. Deleting entities will count
> >  against application quota.
> >
> http://code.google.com/appengine/docs/python/datastore/creatinggettinganddeletingdata.html#Deleting_Entities_in_Bulk
> > - You can run task queue tasks immediately from the Admin Console.
> > - You can now specify the quality of JPEG images via the Image API's
> >  execute_transforms function. Available in production only.
> > - Support for login of multiple Google accounts within an app, and longer
> login
> >  sessions. For more information see:
> >http://www.google.com/support/accounts/bin/answer.py?answer=181599
> > - In queue.yaml, the maximum allowed bucket size is now 100.
> > - Precompilation is now enabled by default. To disable, use the
> >  --no_precompilation flag when updating your app.
> > - BlobInfo now has an open() method that returns a BlobReader.
> > - BlobReader now accepts a BlobInfo.
> > - Removed limits on zigzag merge-join queries. Therefore the error "The
> built-in
> >  indices are not efficient enough for this query and your data. Please
> add a
> >  composite index for this query." will no longer be thrown in most cases,
> >  enabling more types of queries without indexes.
> > - Fixed an issue with task queue tasks not running on the dev_appserver
> when
> >  using Python 2.6.
> > - Fixed an issue on the dev_appserver where auto task running wasn't
> working for
> >  BulkAdd.
> > - Fixed an issue reserving App Ids by owners of similarly-named mails
> accounts
> >  containing periods, multiple cases, and goo

Re: [appengine-java] Re: CloudCover: Cannot schedule instance of TestClass because of not an available class

2010-07-14 Thread Max Ross (Google)
Thanks for trying CloudCover!  Unfortunately CloudCover's support for
datastore tests rely on an App Engine feature called "Namespaces" that is
not yet available to all apps.  This feature should be widely available
soon, at which point your error message will go away.

Sorry for the trouble,
Max

On Sat, Jul 10, 2010 at 12:26 PM, luijar  wrote:

> I have not been able to successfully run any tests that involve
> datastore access: I am seeing the following:
>
> Application (nepal-dev), attempting to use namespace (1002_877806974),
> is not permitted to use datastore namespaces.
> java.lang.IllegalArgumentException: Application (nepal-dev),
> attempting to use namespace (1002_877806974), is not permitted to use
> datastore namespaces.
> at
>
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
> 34)
> at
>
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
> 67)
> at com.google.appengine.api.datastore.DatastoreServiceImpl
> $2.run(DatastoreServiceImpl.java:188)
> at
>
> com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:
> 30)
> at
>
> com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
> 176)
> at
>
> com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
> 156)
> at
>
> com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:
> 148)
> at
>
> com.citrix.ws.nepal.gaetest.GAEUserTest.testCreateAndReadUser(GAEUserTest.java:
> 37)
>
> Any thoughts???
>
>
>
> On Jul 1, 1:13 pm, luijar  wrote:
> > Not sure what the problem is, all my queries are failing with this
> > message:
> >
> > Illegal argument
> > javax.jdo.JDOFatalUserException: Illegal argument at
> >
> org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(Nuc
> leusJDOHelper.java:
> > 344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:252) at
> >
> > Environment: SDK 1.3.4
> > JUnit = 4
> >
> > Is there a code sample we can use as reference?, with all of the
> > required JAR files?. I haven't been able to run a single test that
> > requires accessing datastore.
> >
> > On Jun 30, 5:58 pm, luijar  wrote:
> >
> >
> >
> > > I am seeing this however,
> >
> > > Executing a simple query:
> >
> > > Illegal argument
> > > javax.jdo.JDOFatalUserException: Illegal argument at
> > >
> org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(Nuc
> leusJDOHelper.java:
> > > 344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:252) at
> >
> > > This query works when the actual application is running, and it works
> > > in the Local testing Helper, but not with the
> > > CloudCoverLocalServiceTestHelper. Is there a specific version of App
> > > Engine I should be using? I am using 1.3.2.
> >
> > > On Jun 12, 11:57 pm, "Max Ross (Google)" 
> > > 
> >
> > > wrote:
> >
> > > > This most likely means that your tests aren't available as part of
> your
> > > > application.  Are you certain you uploaded them?
> >
> > > > On Fri, Jun 11, 2010 at 11:31 PM, Art  wrote:
> > > > > Dear group,
> >
> > > > > I would like to know how to make CloudCover (
> http://code.google.com/p/
> > > > > cloudcover/) work.
> >
> > > > > At cloudcover.html, even I clicked on the "Start New Run" button,
> the
> > > > > (default) test won't be executed.
> > > > > The cloudcover.html showed like:
> > > > > Run 1001: NOT_STARTED, Completed 0/0 (0%)
> > > > > Passed: 0 Too Slow: 0 Failed: 0 In Progress: 0 Not Started: 0
> > > > >
> com.google.appengine.testing.cloudcover.harness.junit3.JUnit3TestHarness
> > > > > (0)
> >
> > > > > I found the following logs in the GAE/J logs:
> > > > > W 06-11 10:45PM 49.387
> > > > > com.google.appengine.testing.cloudcover.harness.junitx.JUnitTestRun
> > > > > getTestIds: 1001: Cannot schedule instance of class
> > > > > com.appspot.waversbeach.server.MemcacheTest for execution because
> its
> > > > > String represenation,
> > > > > testInsert1(com.appspot.waversbeach.server.MemcacheTest), is not an
> > > > > available class.
> >
> > > > > W 06-11 10:45

Re: [appengine-java] CloudCover: Cannot schedule instance of TestClass because of not an available class

2010-06-12 Thread Max Ross (Google)
This most likely means that your tests aren't available as part of your
application.  Are you certain you uploaded them?

On Fri, Jun 11, 2010 at 11:31 PM, Art  wrote:

> Dear group,
>
> I would like to know how to make CloudCover (http://code.google.com/p/
> cloudcover/) work.
>
> At cloudcover.html, even I clicked on the "Start New Run" button, the
> (default) test won't be executed.
> The cloudcover.html showed like:
> Run 1001: NOT_STARTED, Completed 0/0 (0%)
> Passed: 0 Too Slow: 0 Failed: 0 In Progress: 0 Not Started: 0
> com.google.appengine.testing.cloudcover.harness.junit3.JUnit3TestHarness
> (0)
>
>
>
> I found the following logs in the GAE/J logs:
> W 06-11 10:45PM 49.387
> com.google.appengine.testing.cloudcover.harness.junitx.JUnitTestRun
> getTestIds: 1001: Cannot schedule instance of class
> com.appspot.waversbeach.server.MemcacheTest for execution because its
> String represenation,
> testInsert1(com.appspot.waversbeach.server.MemcacheTest), is not an
> available class.
>
> W 06-11 10:45PM 49.395
> com.google.appengine.testing.cloudcover.harness.junitx.JUnitTestRun
> getTestIds: 1001: Cannot schedule instance of class
> com.appspot.waversbeach.server.MemcacheTest for execution because its
> String represenation,
> testInsert2(com.appspot.waversbeach.server.MemcacheTest), is not an
> available class.
>
>
>
> MemcacheTest class is a really simple test class just for the trial
> purpose with CloudCover:
> public class MemcacheTest extends TestCase {
>public MemcacheTest( String name) {
>super( name);
>}
>
>protected static Cache cache = null;
>
>@Override
>protected void setUp() throws Exception {
>if ( cache == null) {
>CacheFactory cacheFactory =
> CacheManager.getInstance().getCacheFactory();
>cache = cacheFactory.createCache(
> Collections.emptyMap());
>}
>}
>
>@Override
>protected void tearDown() throws Exception {
>cache.clear();
>}
>
>private void doTest() {
>assertFalse( cache.containsKey( "yar"));
>cache.put( "yar", "foo");
>assertTrue( cache.containsKey( "yar"));
>}
>
>public void testInsert1() {
>doTest();
>}
>
>public void testInsert2() {
>doTest();
>}
>
> }
>
>
> My JUnit3Config class is like:
> public class CloudCoverRunnerConfig extends JUnit3Config {
>
>@Override
>public TestRun newTestRun( String arg0) {
>TestSuite suite = new TestSuite();
>suite.addTest( new MemcacheTest( "testInsert1"));
>suite.addTest( new MemcacheTest( "testInsert2"));
>return new JUnit3TestRun( suite);
>}
> }
>
>
>
> I'm thinking of giving the CloudCover a shot for Wave robot testing if
> it's possible, since I have read in one of Wave docs that there is no
> existing mechanism currently to test Wave robot on local machine.
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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: Unable to update app: Error posting to URL: Error 500

2010-05-05 Thread Max Ross (Google)
Thanks Jerome, we're investigating...

On Wed, May 5, 2010 at 2:09 PM, Jerome  wrote:

> Things are back up... We were completely down for 15 minutes following
> the end of the planned downtime.
>
> Jerome
>
> On May 5, 4:01 pm, Jerome  wrote:
> > Max, the GAE team sent the notice that the maintenance has been
> > completed, but our app is totally DOA now. Every single servlet or JSP
> > just 500 with a:
> > Request was aborted after waiting too long to attempt to service your
> > request. This may happen sporadically when the App Engine serving
> > cluster is under unexpectedly high or uneven load. If you see this
> > message frequently, please contact the App Engine team.
> >
> > Jerome
> >
> > On May 5, 3:48 pm, "Max Ross (Google)" 
> > 
> >
> > wrote:
> >
> >
> >
> > > GAE is currently read-only for scheduled maintenance.  I recommend
> > > subscribing to the google-appengine-downtime-notify group if you'd like
> to
> > > receive notifications of these events:
> >
> > >http://groups.google.com/group/google-appengine-downtime-notify/brows.
> ..
> >
> > > <
> http://groups.google.com/group/google-appengine-downtime-notify/brows...>
> > > Thanks,
> > > Max
> >
> > > On Wed, May 5, 2010 at 1:45 PM, Rahul  wrote:
> > > > Suddenly i have started getting the following exception exception
> when
> > > > trying to deploy the application to appengine from eclipse. I was
> able
> > > > to do this till 10 min before.
> >
> > > > What is the possible cause for this or there is something wrong on
> the
> > > > server end ?
> >
> > > > com.google.appengine.tools.admin.AdminException: Unable to update
> app:
> > > > Error posting to URL:
> > > >
> https://appengine.google.com/api/appversion/create?app_id=thoughtclic...
> > > > 500 Internal Server Error
> > > > Server Error (500)
> > > > A server error has occurred.
> > > >at
> > > >
> com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:
> > > > 62)
> > > >at
> >
> > > >
> com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:
> > > > 271)
> > > >at
> >
> > > >
> com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:
> > > > 145)
> > > >at
> >
> > > >
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:
> > > > 38)
> > > >at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> > > > Caused by: java.io.IOException: Error posting to URL:
> >
> > > >
> https://appengine.google.com/api/appversion/create?app_id=thoughtclic...
> > > > 500 Internal Server Error
> >
> > > > Server Error (500)
> > > > A server error has occurred.
> >
> > > > at
> >
> > > >
> com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java:
> > > > 149)
> > > >at
> >
> > > >
> com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java:
> > > > 82)
> > > >at
> >
> > > >
> com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:
> > > > 559)
> > > >at
> >
> > > >
> com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:
> > > > 376)
> > > >at
> >
> > > >
> com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:
> > > > 111)
> > > >at
> > > >
> com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:
> > > > 56)
> >
> > > >... 4 more
> >
> > > > Thanks,
> > > > Rahul
> >
> > > > --
> > > > 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

Re: [appengine-java] Re: The API call datastore_v3.Put() is temporarily unavailable.

2010-05-05 Thread Max Ross (Google)
Hi Jerome,

What error were you getting instead of ApiProxy.CapabilityDisabledException?
 Do you have a stack trace I can look at?

Thanks,
Max

On Wed, May 5, 2010 at 1:57 PM, Jerome  wrote:

> Well... based on the announcement, we were supposed to receive a
> com.google.apphosting.api.ApiProxy.CapabilityDisabledException
> exception. For at least the first 10 minutes of the down time, it was
> not the case.
>
> We are sorting things out, but it looks like we lost a lot of data, as
> our system supposed to take over during the maintenance was based on
> getting the documented exception...
>
> Jerome
>
> On May 5, 3:47 pm, "Max Ross (Google)" 
> 
> >
> wrote:
> > GAE is currently read-only for scheduled maintenance.  I recommend
> > subscribing to the google-appengine-downtime-notify group if you'd like
> to
> > receive notifications of these events:
> >
> > http://groups.google.com/group/google-appengine-downtime-notify/brows...
> >
> > <http://groups.google.com/group/google-appengine-downtime-notify/brows..
> .>
> > Thanks,
> > Max
> >
> > On Wed, May 5, 2010 at 1:41 PM, hector  wrote:
> > > Getting this error on Java App Engine.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google App Engine for Java" group.
> > > To post to this group, send email to
> > > google-appengine-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-appengine-java+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> > To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> > For more options, visit this group athttp://
> groups.google.com/group/google-appengine-java?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Unable to update app: Error posting to URL: Error 500

2010-05-05 Thread Max Ross (Google)
GAE is currently read-only for scheduled maintenance.  I recommend
subscribing to the google-appengine-downtime-notify group if you'd like to
receive notifications of these events:

http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/5302cb6b950ce215


Thanks,
Max

On Wed, May 5, 2010 at 1:45 PM, Rahul  wrote:

> Suddenly i have started getting the following exception exception when
> trying to deploy the application to appengine from eclipse. I was able
> to do this till 10 min before.
>
> What is the possible cause for this or there is something wrong on the
> server end ?
>
>
> com.google.appengine.tools.admin.AdminException: Unable to update app:
> Error posting to URL:
> https://appengine.google.com/api/appversion/create?app_id=thoughtclickshelp&version=dev-restfb&;
> 500 Internal Server Error
> Server Error (500)
> A server error has occurred.
>at
> com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:
> 62)
>at
>
> com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:
> 271)
>at
>
> com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:
> 145)
>at
>
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:
> 38)
>at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> Caused by: java.io.IOException: Error posting to URL:
>
> https://appengine.google.com/api/appversion/create?app_id=thoughtclickshelp&version=dev-restfb&;
> 500 Internal Server Error
>
> Server Error (500)
> A server error has occurred.
>
> at
>
> com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java:
> 149)
>at
>
> com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java:
> 82)
>at
>
> com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:
> 559)
>at
>
> com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:
> 376)
>at
>
> com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:
> 111)
>at
> com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:
> 56)
>
>... 4 more
>
> Thanks,
> Rahul
>
> --
> 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] The API call datastore_v3.Put() is temporarily unavailable.

2010-05-05 Thread Max Ross (Google)
GAE is currently read-only for scheduled maintenance.  I recommend
subscribing to the google-appengine-downtime-notify group if you'd like to
receive notifications of these events:

http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/5302cb6b950ce215


Thanks,
Max

On Wed, May 5, 2010 at 1:41 PM, hector  wrote:

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

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



Re: [appengine-java] SDK 1.3.3 / JUnit 4 : DatastorePb$QueryExplanation

2010-04-28 Thread Max Ross (Google)
I'm guessing you still have the 1.3.2 version of DatastorePb somewhere on
your classpath.

On Wed, Apr 28, 2010 at 4:12 AM, Korzenowski
wrote:

> Hello,
>
> Since updating to SDK 1.3.3, my JUniit 1.4 tests are failing with the
> following exception, using 1.3.2 is fine. Is this happening
> elsewhere?
>
> java.lang.NoClassDefFoundError: com/google/apphosting/api/DatastorePb
> $QueryExplanation
>at java.lang.Class.getDeclaredMethods0(Native Method)
>at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>at java.lang.Class.privateGetPublicMethods(Unknown Source)
>at java.lang.Class.getMethods(Unknown Source)
>at
>
> com.google.appengine.tools.development.ApiProxyLocalImpl.getDispatchMethod(ApiProxyLocalImpl.java:
> 256)
>at com.google.appengine.tools.development.ApiProxyLocalImpl.access
> $300(ApiProxyLocalImpl.java:44)
>at com.google.appengine.tools.development.ApiProxyLocalImpl
> $AsyncApiCall.call(ApiProxyLocalImpl.java:291)
>at com.google.appengine.tools.development.ApiProxyLocalImpl
> $AsyncApiCall.call(ApiProxyLocalImpl.java:264)
>at java.util.concurrent.Executors$PrivilegedCallable$1.run(Unknown
> Source)
>at java.security.AccessController.doPrivileged(Native Method)
>at java.util.concurrent.Executors$PrivilegedCallable.call(Unknown
> Source)
>at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
>at java.util.concurrent.FutureTask.run(Unknown Source)
>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
>at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.google.apphosting.api.DatastorePb$QueryExplanation
>at java.net.URLClassLoader$1.run(Unknown Source)
>at java.security.AccessController.doPrivileged(Native Method)
>at java.net.URLClassLoader.findClass(Unknown Source)
>at java.lang.ClassLoader.loadClass(Unknown Source)
>at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>at java.lang.ClassLoader.loadClass(Unknown Source)
>at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>... 16 more
>
> 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.
>
>

-- 
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] Error uploading project to App Engine

2010-04-28 Thread Max Ross (Google)
GAE is currently read-only for scheduled maintenance.  I recommend
subscribing to the google-appengine-downtime-notify group if you'd like to
receive notifications of these events:

http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/4857b46e4e6ff0f9


Thanks,
Max

On Wed, Apr 28, 2010 at 1:42 PM, Rahul Ravikumar wrote:

> When i try to update my project using the Eclipse plugin - I see the
> following error message in my eclipse log. I am unable to update my
> application on GAE.
>
> eclipse.buildId=I20090611-1540
> java.version=1.6.0_20
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Framework arguments:  -product org.eclipse.epp.package.jee.product
> Command-line arguments:  -os win32 -ws win32 -arch x86 -product
> org.eclipse.epp.package.jee.product
>
> Error
> Wed Apr 28 13:35:27 PDT 2010
> Unable to update app: Error posting to URL:
>
> https://appengine.google.com/api/appversion/create?app_id=myappid&version=3&500
> Internal Server Error
>
> Server Error (500)
> A server error has occurred.
>
> See the deployment console for more details
>
> com.google.appengine.tools.admin.AdminException: Unable to update app:
> Error posting to URL:
> https://appengine.google.com/api/appversion/create?app_id=myappid&version=3&;
> 500 Internal Server Error
>
> Server Error (500)
> A server error has occurred.
>
> at
> com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:
> 62)
> at
>
> com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:
> 271)
> at
>
> com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:
> 145)
> at
>
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:
> 38)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> Caused by: java.io.IOException: Error posting to URL:
>
> https://appengine.google.com/api/appversion/create?app_id=myappid&version=3&;
> 500 Internal Server Error
>
> Server Error (500)
> A server error has occurred.
>
> at
>
> com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java:
> 149)
> at
>
> com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java:
> 82)
> at
>
> com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:
> 559)
> at
>
> com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:
> 376)
> at
>
> com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:
> 111)
> at
> com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:
> 56)
> ... 4 more
>
>
> 
>
> The deployment log is given below:
>
> Unable to update:
> java.io.IOException: Error posting to URL:
>
> https://appengine.google.com/api/appversion/create?app_id=myappid&version=3&;
> 500 Internal Server Error
>
> Server Error (500)
> A server error has occurred.
>
>at
>
> com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java:
> 149)
>at
>
> com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java:
> 82)
>at
>
> com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:
> 559)
>at
>
> com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java:
> 376)
>at
>
> com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:
> 111)
>at
> com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:
> 56)
>at
>
> com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:
> 271)
>at
>
> com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:
> 145)
>at
>
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:
> 38)
>at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
> Any ideas as to why this could be happening ?
>
> Thanks,
> Rahul
>
> --
> 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

Re: [appengine-java] Re: ApiProxyLocalImpl class not public

2010-04-26 Thread Max Ross (Google)
Your JDO config is not related to LocalServiceTestHelper or
LocalDatastoreServiceTestConfig.  If you create your PersistenceManager in
the typical way after you create a LocalServiceTestHelper with a
LocalDatastoreServiceTestConfig and then call helper.setUp() you should be
all set.

Max

2010/4/26 Marcos Vinícius Soares 

> I just wanted an instance of PersistenceManager to use in unit tests and I
> was able to setup it up. I'm not sure how to get it through
> LocalDatastoreServiceTestConfig. Anyway, it is working now as per the code I
> sent earlier.
>
> Thanks
>
>>
> On Mon, Apr 26, 2010 at 1:33 PM, Max Ross (Google) <
> maxr+appeng...@google.com > wrote:
>
>> What aspect of the local datastore are you trying to configure that isn't
>> covered by LocalDatastoreServiceTestConfig()? I don't think you should have
>> to configure the ApiProxyLocal or the LocalServerEnvironment directly.
>>
>>
>> On Sun, Apr 25, 2010 at 3:40 PM, mvsoares  wrote:
>>
>>> Indeed, ApiProxyLocalImpl is not public anymore in newer versions of
>>> google app engine.
>>>
>>> Find below one solution to the problem:
>>>
>>> import java.io.File;
>>> import java.util.Properties;
>>>
>>> import javax.jdo.JDOHelper;
>>> import javax.jdo.PersistenceManager;
>>> import javax.jdo.PersistenceManagerFactory;
>>>
>>> import junit.framework.TestCase;
>>>
>>> import com.google.appengine.api.datastore.dev.LocalDatastoreService;
>>> import com.google.appengine.tools.development.ApiProxyLocal;
>>> import com.google.appengine.tools.development.ApiProxyLocalFactory;
>>> import com.google.appengine.tools.development.LocalServerEnvironment;
>>> import
>>> com.google.appengine.tools.development.testing.LocalServiceTestHelper;
>>> import
>>> com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig;
>>> import com.google.apphosting.api.ApiProxy;
>>>
>>> public class BaseTest extends TestCase {
>>>
>>>private final LocalServiceTestHelper helper =
>>>new LocalServiceTestHelper(new LocalTaskQueueTestConfig());
>>>
>>>protected PersistenceManagerFactory pmf;
>>>protected PersistenceManager pm;
>>>
>>>@Override
>>>public void tearDown() {
>>>helper.tearDown();
>>>}
>>>
>>>@Override
>>>public void setUp() throws Exception {
>>>super.setUp();
>>>helper.setUp();
>>>Properties newProperties = new Properties();
>>>
>>>  newProperties.put("javax.jdo.PersistenceManagerFactoryClass",
>>>"org.datanucleus.store.appengine.jdo."
>>>+
>>> "DatastoreJDOPersistenceManagerFactory");
>>>newProperties.put("javax.jdo.option.ConnectionURL",
>>> "appengine");
>>>newProperties.put("javax.jdo.option.NontransactionalRead",
>>> "true");
>>>
>>>  newProperties.put("javax.jdo.option.NontransactionalWrite", "true");
>>>newProperties.put("javax.jdo.option.RetainValues",
>>> "true");
>>>
>>>  newProperties.put("datanucleus.appengine.autoCreateDatastoreTxns",
>>>"true");
>>>
>>>  newProperties.put("datanucleus.appengine.autoCreateDatastoreTxns",
>>>"true");
>>>pmf =
>>> JDOHelper.getPersistenceManagerFactory(newProperties);
>>>pm = pmf.getPersistenceManager();
>>>ApiProxyLocalFactory factory = new ApiProxyLocalFactory();
>>>ApiProxyLocal proxy = factory.create(new
>>> LocalServerEnvironment() {
>>>public void waitForServerToStart()
>>>throws
>>> InterruptedException {
>>>}
>>>public int getPort() {
>>>return 0;
>>>}
>>>public File getAppDir() {
>>>  

Re: [appengine-java] Re: ApiProxyLocalImpl class not public

2010-04-26 Thread Max Ross (Google)
What aspect of the local datastore are you trying to configure that isn't
covered by LocalDatastoreServiceTestConfig()? I don't think you should have
to configure the ApiProxyLocal or the LocalServerEnvironment directly.

On Sun, Apr 25, 2010 at 3:40 PM, mvsoares  wrote:

> Indeed, ApiProxyLocalImpl is not public anymore in newer versions of
> google app engine.
>
> Find below one solution to the problem:
>
> import java.io.File;
> import java.util.Properties;
>
> import javax.jdo.JDOHelper;
> import javax.jdo.PersistenceManager;
> import javax.jdo.PersistenceManagerFactory;
>
> import junit.framework.TestCase;
>
> import com.google.appengine.api.datastore.dev.LocalDatastoreService;
> import com.google.appengine.tools.development.ApiProxyLocal;
> import com.google.appengine.tools.development.ApiProxyLocalFactory;
> import com.google.appengine.tools.development.LocalServerEnvironment;
> import
> com.google.appengine.tools.development.testing.LocalServiceTestHelper;
> import
> com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig;
> import com.google.apphosting.api.ApiProxy;
>
> public class BaseTest extends TestCase {
>
>private final LocalServiceTestHelper helper =
>new LocalServiceTestHelper(new LocalTaskQueueTestConfig());
>
>protected PersistenceManagerFactory pmf;
>protected PersistenceManager pm;
>
>@Override
>public void tearDown() {
>helper.tearDown();
>}
>
>@Override
>public void setUp() throws Exception {
>super.setUp();
>helper.setUp();
>Properties newProperties = new Properties();
>
>  newProperties.put("javax.jdo.PersistenceManagerFactoryClass",
>"org.datanucleus.store.appengine.jdo."
>+
> "DatastoreJDOPersistenceManagerFactory");
>newProperties.put("javax.jdo.option.ConnectionURL",
> "appengine");
>newProperties.put("javax.jdo.option.NontransactionalRead",
> "true");
>newProperties.put("javax.jdo.option.NontransactionalWrite",
> "true");
>newProperties.put("javax.jdo.option.RetainValues", "true");
>
>  newProperties.put("datanucleus.appengine.autoCreateDatastoreTxns",
>"true");
>
>  newProperties.put("datanucleus.appengine.autoCreateDatastoreTxns",
>"true");
>pmf = JDOHelper.getPersistenceManagerFactory(newProperties);
>pm = pmf.getPersistenceManager();
>ApiProxyLocalFactory factory = new ApiProxyLocalFactory();
>ApiProxyLocal proxy = factory.create(new
> LocalServerEnvironment() {
>public void waitForServerToStart()
>throws
> InterruptedException {
>}
>public int getPort() {
>return 0;
>}
>public File getAppDir() {
>return new File(".");
>}
>public String getAddress() {
>return null;
>}
>});
>proxy.setProperty(
> //
>  LocalDatastoreService.BACKING_STORE_PROPERTY,
>LocalDatastoreService.NO_STORAGE_PROPERTY,
>Boolean.TRUE.toString());
>ApiProxy.setDelegate(proxy);
> }
>
> }
>
> --
> 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] QueueFactory and NoClassDefFoundError

2010-04-23 Thread Max Ross (Google)
Hi Felipe,

Can you print out the value of System.getProperty("java.class.path") while
the app is running and see if that jar is listed?

On Fri, Apr 23, 2010 at 1:56 PM, Felipe Quintella Correia <
felipequintell...@gmail.com> wrote:

> Hello again.
>
> Well, unless I'm overseeing something, I'm pretty sure that the
> appengine-api-labs.jar is on my runtime classpath...
> I'm joining 2 printscreens to confirm (if it is allowed), but I think
> that's it... I have App Engine SDK 1.3.2 on my classpath, and the App Engine
> SDK has appengine-api-labs-1.3.2.jar in it.
>
> Sorry for the newbie question, but I am stuck on it.
>
> Thank you again,
> Felipe Quintella
>
> PS: if joined files are not allowed, check the screens on this 2 links:
>
> http://dl.dropbox.com/u/5958704/Screen%20shot%202010-04-23%20at%2017.50.11.png
>
> http://dl.dropbox.com/u/5958704/Screen%20shot%202010-04-23%20at%2017.50.28.png
>
> 2010/4/22 Felipe Quintella Correia 
>
> I'll be sure it's on the runtime classpath as soon as I am home.
>>
>> Thank you
>> Felipe Quintella
>>
>>
>> 2010/4/22 Max Ross (Google) 
>> 
>> >
>>
>> Make sure appengine-api-labs.jar is on your runtime classpath.
>>>
>>> Max
>>>
>>> On Wed, Apr 21, 2010 at 9:00 PM, Felipe Quintella <
>>> felipequintell...@gmail.com> wrote:
>>>
>>>> Hello there.
>>>>
>>>> I'm new to Google AppEngine, but I'm already searched and can't find
>>>> the answer to my problem.
>>>>
>>>> I am trying to add a task to the default taskqueue, but i keep getting
>>>> a NoClassDefFoundError with the QueueFactory class...
>>>>
>>>> I can't find what the problem is. I have App Engine SDK 1.3.2 added as
>>>> a library, and have imported the QueueFactory successfully...
>>>>
>>>> Maybe you can enlighten me.
>>>>
>>>> Looking forward to your answer,
>>>> Thank you.
>>>>
>>>> Felipe Quintella.
>>>>
>>>>
>>>> Error:
>>>> HTTP ERROR 500
>>>>
>>>> Problem accessing /canalparser. Reason:
>>>>
>>>>com/google/appengine/api/labs/taskqueue/QueueFactory
>>>>
>>>> Caused by:
>>>>
>>>> java.lang.NoClassDefFoundError: com/google/appengine/api/labs/
>>>> taskqueue/QueueFactory
>>>>at
>>>> braziltvguide.ParseCanaisServlet.doGet(ParseCanaisServlet.java:
>>>> 108)
>>>>
>>>>
>>>>
>>>> Part of the code with the problem:
>>>> import com.google.appengine.api.labs.taskqueue.Queue;
>>>> import com.google.appengine.api.labs.taskqueue.QueueFactory;
>>>>
>>>>
>>>> import static
>>>> com.google.appengine.api.labs.taskqueue.TaskOptions.Builder.*;
>>>>
>>>> if (req.getParameter("task") == null) {
>>>>Queue queue =
>>>> QueueFactory.getDefaultQueue();
>>>>
>>>>
>>>>  queue.add(url("/canalparser?tipo=getProgramas&task=1"));
>>>>}
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Google App Engine for Java" group.
>>>> To post to this group, send email to
>>>> google-appengine-j...@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> google-appengine-java+unsubscr...@googlegroups.com
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine for Java" group.
>>> To post to this group, send email to
>>> google-appengine-j...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-appengine-java+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



Re: [appengine-java] Re: TaskOptions.countdownMillis not used

2010-04-23 Thread Max Ross (Google)
 The difference between 2 seconds and immediate isn't much.  How are you
measuring?  Do you have logs that show the time at which the task was
enqueued and the time at which it executes?

Thanks,
Max

On Fri, Apr 23, 2010 at 12:31 PM, Fabrizio  wrote:

> Production.
>
>
> On Apr 23, 3:02 pm, James  wrote:
> > Are you seeing this on the dev server or in production?  I vaguely
> > recall reading somewhere that the dev server always executes
> > immediately(??).
> >
> > James
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: TaskOptions.countdownMillis not used

2010-04-23 Thread Max Ross (Google)
The dev server used to not execute tasks automatically at all but now the
functionality emulates prod pretty closely.

On Fri, Apr 23, 2010 at 6:02 AM, James  wrote:

> Are you seeing this on the dev server or in production?  I vaguely
> recall reading somewhere that the dev server always executes
> immediately(??).
>
> James
>
> On Apr 22, 4:21 pm, Fabrizio  wrote:
> > Hello,
> >
> > I need to add a task in the TaskQueue. But I need a small delay before
> > exectution (2 seconds). I use countdownMillis(long) to delay the
> > execution.  But execution starts immediatelly. I don't understand if
> > my code is wrong or if there is a problem with countdownMillis.
> >
> > My code is:
> >
> > Queue queue = QueueFactory.getQueue(queueName);
> > TaskOptions taskOpts = TaskOptions.Builder.url(url);
> > taskOpts.countdownMillis(delay);
> > taskOpts.method(Method.GET);
> > queue.add(taskOpts);
> >
> >Thank you for help
> >
> > fabrizio
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> > To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> > For more options, visit this group athttp://
> groups.google.com/group/google-appengine-java?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] TaskOptions.countdownMillis not used

2010-04-22 Thread Max Ross (Google)
What is the value of the delay variable?

On Thu, Apr 22, 2010 at 1:21 PM, Fabrizio  wrote:

> Hello,
>
> I need to add a task in the TaskQueue. But I need a small delay before
> exectution (2 seconds). I use countdownMillis(long) to delay the
> execution.  But execution starts immediatelly. I don't understand if
> my code is wrong or if there is a problem with countdownMillis.
>
> My code is:
>
> Queue queue = QueueFactory.getQueue(queueName);
> TaskOptions taskOpts = TaskOptions.Builder.url(url);
> taskOpts.countdownMillis(delay);
> taskOpts.method(Method.GET);
> queue.add(taskOpts);
>
>
>   Thank you for help
>
>
> fabrizio
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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] QueueFactory and NoClassDefFoundError

2010-04-22 Thread Max Ross (Google)
Make sure appengine-api-labs.jar is on your runtime classpath.

Max
On Wed, Apr 21, 2010 at 9:00 PM, Felipe Quintella <
felipequintell...@gmail.com> wrote:

> Hello there.
>
> I'm new to Google AppEngine, but I'm already searched and can't find
> the answer to my problem.
>
> I am trying to add a task to the default taskqueue, but i keep getting
> a NoClassDefFoundError with the QueueFactory class...
>
> I can't find what the problem is. I have App Engine SDK 1.3.2 added as
> a library, and have imported the QueueFactory successfully...
>
> Maybe you can enlighten me.
>
> Looking forward to your answer,
> Thank you.
>
> Felipe Quintella.
>
>
> Error:
> HTTP ERROR 500
>
> Problem accessing /canalparser. Reason:
>
>com/google/appengine/api/labs/taskqueue/QueueFactory
>
> Caused by:
>
> java.lang.NoClassDefFoundError: com/google/appengine/api/labs/
> taskqueue/QueueFactory
>at braziltvguide.ParseCanaisServlet.doGet(ParseCanaisServlet.java:
> 108)
>
>
>
> Part of the code with the problem:
> import com.google.appengine.api.labs.taskqueue.Queue;
> import com.google.appengine.api.labs.taskqueue.QueueFactory;
>
>
> import static
> com.google.appengine.api.labs.taskqueue.TaskOptions.Builder.*;
>
> if (req.getParameter("task") == null) {
>Queue queue =
> QueueFactory.getDefaultQueue();
>
>
>  queue.add(url("/canalparser?tipo=getProgramas&task=1"));
>}
>
> --
> 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] Google: Please, stop using the Builder pattern in the Low-Level API!

2010-04-01 Thread Max Ross (Google)
The 2 options you listed are indeed better, but they don't work if your goal
is to prevent access to an uninitialized FetchOptions object.  That was our
original intent, so that's how we ended up steering you through the Builder
at the start.  At one point before we launched we had a more standard
Builder that you had to call build() on at the end.  I liked it because it
meant that all the FetchOptions members could be final, but there was some
debate within the team and we ultimately decided that in this case
conciseness trumps immutability, so we dropped the explicit build() call and
moved the setters to FetchOptions itself.  We also considered putting the
"with" constructors directly on FetchOptions and getting rid of the Builder
entirely, but we decided that a static method named
FetchOptions.withLimit(int limit) and an instance method named
FetchOptions.limit(limit) wouldn't give enough of a hint about the intended
usage.  So here we are.

API design is hard.

Max

On Thu, Apr 1, 2010 at 12:14 PM, Jeff Schnitzer  wrote:

> Oh, I wasn't suggesting a constructor that takes all the arguments,
> I'm just wondering why this:
>
> FetchOptions opts = FetchOptions.Builder.withLimit(10).offset(200);
>
> ...is better than this...
>
> FetchOptions opts = new FetchOptions().limit(10).offset(200);
>
> ...or even...
>
> FetchOptions opts = FetchOptions.create().limit(10).offset(200);
>
> Adding the Builder with duplicate-but-differently-named methods seems
> awkward.
>
> Jeff
>
> On Thu, Apr 1, 2010 at 11:43 AM, Max Ross (Google)
> > wrote:
> > Ok, we'll expose that method.
> >
> > With a public constructor it's very easy to mix up your args, especially
> > when you have args of the same type.  For example, someone is pretty much
> > guaranteed to mix up the offset, limit, and prefetch args.  A Builder
> > prevents this.  Josh Bloch has a nice chapter on this in the 2nd edition
> of
> > Effective Java.
> >
> > Max
> >
> > On Thu, Apr 1, 2010 at 11:10 AM, Jeff Schnitzer 
> wrote:
> >>
> >> Yes, that would solve the problem.  Although I have to wonder, how is
> >> this any better than having a public constructor?
> >>
> >> Jeff
> >>
> >> On Thu, Apr 1, 2010 at 10:08 AM, Max Ross (Google)
> >> > wrote:
> >> > Hi Jeff,
> >> >
> >> > Note that DatastoreServiceConfig exposes a withDefaults() method.
> >> > FetchOptions has one too but it's package protected.  We didn't expose
> >> > it
> >> > because FetchOptions isn't required for many low level datastore calls
> >> > and
> >> > we didn't see why users would want to create one if they didn't plan
> to
> >> > adjust the offset, the limit, the prefetch size, etc.  We didn't
> >> > consider
> >> > your use case though, and it makes perfect sense.  Unless there's some
> >> > other
> >> > aspect of the Builder pattern that is getting in your way that you
> have
> >> > explained, I think we could easily address your concern if we exposed
> >> > FetchOptions.withDefaults().  Is that right?
> >> >
> >> > Thanks,
> >> > Max
> >> >
> >> >
> >> > On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer 
> >> > wrote:
> >> >>
> >> >> This is a genuine, heartfelt plea:  The Builder pattern
> >> >> (DatastoreServiceConfig, FetchOptions) makes code extra annoying when
> >> >> layering an API on top of the low-level API.
> >> >>
> >> >> Let's say you are writing some code by hand that creates a
> >> >> FetchOptions with a limit and an offset:
> >> >>
> >> >> FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20);
> >> >>
> >> >> Pretty straightforward when typing it out by hand, but the lack of
> >> >> orthogonality between withLimit() and limit() is a PITA when you're
> >> >> trying to automate the creation of a builder.  The problem is, you
> >> >> can't start with a "blank" FetchOptions.  The result is we end up
> >> >> writing lots of code like this:
> >> >>
> >> >> if (limit != null)
> >> >> {
> >> >>if (opts == null)
> >> >>opts = FetchOptions.Builder.withLimit(limit);
> >> >>else
> >> >>opts = opts.limit(limit);
> >> >&

Re: [appengine-java] Google: Please, stop using the Builder pattern in the Low-Level API!

2010-04-01 Thread Max Ross (Google)
Ok, we'll expose that method.

With a public constructor it's very easy to mix up your args, especially
when you have args of the same type.  For example, someone is pretty much
guaranteed to mix up the offset, limit, and prefetch args.  A Builder
prevents this.  Josh Bloch has a nice chapter on this in the 2nd edition of
Effective Java.

Max

On Thu, Apr 1, 2010 at 11:10 AM, Jeff Schnitzer  wrote:

> Yes, that would solve the problem.  Although I have to wonder, how is
> this any better than having a public constructor?
>
> Jeff
>
> On Thu, Apr 1, 2010 at 10:08 AM, Max Ross (Google)
> > wrote:
> > Hi Jeff,
> >
> > Note that DatastoreServiceConfig exposes a withDefaults() method.
> > FetchOptions has one too but it's package protected.  We didn't expose it
> > because FetchOptions isn't required for many low level datastore calls
> and
> > we didn't see why users would want to create one if they didn't plan to
> > adjust the offset, the limit, the prefetch size, etc.  We didn't consider
> > your use case though, and it makes perfect sense.  Unless there's some
> other
> > aspect of the Builder pattern that is getting in your way that you have
> > explained, I think we could easily address your concern if we exposed
> > FetchOptions.withDefaults().  Is that right?
> >
> > Thanks,
> > Max
> >
> >
> > On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer 
> wrote:
> >>
> >> This is a genuine, heartfelt plea:  The Builder pattern
> >> (DatastoreServiceConfig, FetchOptions) makes code extra annoying when
> >> layering an API on top of the low-level API.
> >>
> >> Let's say you are writing some code by hand that creates a
> >> FetchOptions with a limit and an offset:
> >>
> >> FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20);
> >>
> >> Pretty straightforward when typing it out by hand, but the lack of
> >> orthogonality between withLimit() and limit() is a PITA when you're
> >> trying to automate the creation of a builder.  The problem is, you
> >> can't start with a "blank" FetchOptions.  The result is we end up
> >> writing lots of code like this:
> >>
> >> if (limit != null)
> >> {
> >>if (opts == null)
> >>opts = FetchOptions.Builder.withLimit(limit);
> >>else
> >>opts = opts.limit(limit);
> >> }
> >>
> >> This wouldn't be necessary if FetchOptions.Builder had a "create()"
> >> method that would produce a blank FetchOptions.  Or if FetchOptions
> >> had a public constructor.  Or if FetchOptions was an interface or even
> >> a nonfinal class.
> >>
> >> I notice that DatastoreServiceConfig is following in the path of
> >> FetchOptions.  My initial reaction was Noo!  :-)
> >>
> >> Thanks for listening,
> >> 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.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/google-appengine-java?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] com.google.appengine.api.datastore.DatastoreServiceConfig; not resolved by Eclipse with GAE plugin v1.3.2

2010-04-01 Thread Max Ross (Google)
Hi Didier,

I can't say what's going on with your plugin but this is almost certainly a
classpath issue.  DatastoreServiceConfig was introduced in 1.3.2 so make
sure you have the appengine-api.jar that shipped with SDK 1.3.2 in your
classpath.

Max

On Thu, Apr 1, 2010 at 4:01 AM, Didier Durand wrote:

> Hello,
>
> I need to use com.google.appengine.api.datastore.DatastoreConfig ->
> works fine under Eclipse
>
> The Javadoc at
> http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreConfig.html
> recommends to switch to
> com.google.appengine.api.datastore.DatastoreServiceConfig;
>
> When I do this change under Eclipse: I get an "import
> com.google.appengine.api.datastore.DatastoreServiceConfig cannot be
> resolved"
>
> a) Is there something missing in my plugin v1.3.2?
>
> b) Can some of you do the same test and let me know if they get the
> same error ?
>
>
> regards
> didier
>
> --
> 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] Google: Please, stop using the Builder pattern in the Low-Level API!

2010-04-01 Thread Max Ross (Google)
Hi Jeff,

Note that DatastoreServiceConfig exposes a withDefaults() method.
FetchOptions has one too but it's package protected.  We didn't expose it
because FetchOptions isn't required for many low level datastore calls and
we didn't see why users would want to create one if they didn't plan to
adjust the offset, the limit, the prefetch size, etc.  We didn't consider
your use case though, and it makes perfect sense.  Unless there's some other
aspect of the Builder pattern that is getting in your way that you have
explained, I think we could easily address your concern if we exposed
FetchOptions.withDefaults().  Is that right?

Thanks,
Max


On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer  wrote:

> This is a genuine, heartfelt plea:  The Builder pattern
> (DatastoreServiceConfig, FetchOptions) makes code extra annoying when
> layering an API on top of the low-level API.
>
> Let's say you are writing some code by hand that creates a
> FetchOptions with a limit and an offset:
>
> FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20);
>
> Pretty straightforward when typing it out by hand, but the lack of
> orthogonality between withLimit() and limit() is a PITA when you're
> trying to automate the creation of a builder.  The problem is, you
> can't start with a "blank" FetchOptions.  The result is we end up
> writing lots of code like this:
>
> if (limit != null)
> {
>if (opts == null)
>opts = FetchOptions.Builder.withLimit(limit);
>else
>opts = opts.limit(limit);
> }
>
> This wouldn't be necessary if FetchOptions.Builder had a "create()"
> method that would produce a blank FetchOptions.  Or if FetchOptions
> had a public constructor.  Or if FetchOptions was an interface or even
> a nonfinal class.
>
> I notice that DatastoreServiceConfig is following in the path of
> FetchOptions.  My initial reaction was Noo!  :-)
>
> Thanks for listening,
> 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.
>
>

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



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

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

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

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

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



Re: [appengine-java] error in the GAE/J transaction docs?

2010-03-25 Thread Max Ross (Google)
We could perhaps be a bit more precise in our language here.  You can run
any query you want inside a transaction but the results are only guaranteed
to be transactionally consistent if the query is an ancestor query.  In
other words, begin/commit are no-ops for non-ancestor queries.

Here's the history of it:
We considered throwing an exception, but the problem was that when we first
launched we didn't support transactional queries of any sort.  We concluded
that requiring developers to step around transactions any time they wanted
to issue a query was a pretty heavy burden, so we decided to ignore active
transactions for all queries.  Then, once we figured out how ancestor
queries could participate in a transaction, there was no way to go back
because if we started throwing exceptions for non-ancestor queries in
transactions existing apps would break when we pushed a new SDK to the
back-ends.

Hope that helps,
Max

On Thu, Mar 25, 2010 at 11:49 AM, AJ  wrote:

> hi,
>
> The documentation on transactions says:
> "An app can perform a query during a transaction, but only if it
> includes an ancestor filter."
> ( transactions.html#What_Can_Be_Done_In_a_Transaction
> >)
>
> This does not seem to be the case-- it seems that more general queries
> are okay (as long as they don't return objects outside the entity
> group).  I noticed that some of the examples on Max's blog showed non-
> ancestor-filter queries inside a transaction.
> So, I gave it a try myself (the test query returned an object in the
> same entity group as the other transaction operations) and it worked
> fine.
>
> S... what is the status of this restriction, of requiring an
> ancestor filter?  If it no longer holds, it would be useful to remove
> the qualification from the docs.  Or is the situation more complex?
>
> --
> 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] JDO/JPA Snippets That Work - Executing Simple Joins Across Owned Relationships

2010-03-21 Thread Max Ross (Google)
http://gae-java-persistence.blogspot.com/2010/03/executing-simple-joins-across-owned.html

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



Re: [appengine-java] a question about transactional tasks

2010-03-21 Thread Max Ross (Google)
Hi AJ,

Your understanding is correct and I don't quite know what we meant when we
said "same level of isolation and consistency."  I'll get this sorted out.

Thanks,
Max

On Sun, Mar 21, 2010 at 1:11 PM, AJ  wrote:

> hi,
>
> I could use a clarification about transactional tasks.
>
> My understanding was that a transactional task is enqueued if and only
> if the transaction succeeds, but is performed outside the transaction
> (so, is not restricted to objects in the same entity group as the
> transaction, and does not share the same Datastore 'snapshot' seen by
> the transaction).
>
> But, the documentation states that "tasks added within a transaction
> are considered to be a part of it and have the same level of isolation
> and consistency."  This seems to imply something different than what I
> had been thinking. What does 'same level of isolation and consistency'
> mean here?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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-15 Thread Max Ross (Google)
No problem David, these things happen, and I'm glad to hear you've found the
culprit.  Thanks for doing all the digging.

Max

On Mon, Mar 15, 2010 at 2:19 PM, David Fuelling  wrote:

> Hey Max,
>
> I'm eating crow now.  Turns out this is *not* a bug in the datastore
> code.  I discovered that one of my DAO parent classes was doing a
> lookup before it actually created the Entity, and this lookup was
> getting an EntityManager but not closing it.  Turns out my own code
> was the leak.
>
> DOH!  Appologies for the false alarm and the waste of time
>
> david
>
> On Mar 15, 8:00 pm, David Fuelling  wrote:
> > Hey Max,
> >
> > Took a heap dump using two different scenarios.  In test 1, I set the -
> > Xmx to 100M, and in test 2 I set the max to 512M, and am comparing the
> > difference between the number of objects across the two memory
> > scenarios.  In my code, I'm running a for-loop that executes 5000
> > times, and most of the objects present in JHat show up no more than
> > 500 times, and in equal amounts, in either memory scenario (leads me
> > to believe these are not the culprits).  However, there are a handful
> > of datastore classes that show a 1:1 relationship between the amount
> > of memory I allow in each test.  Following are the outputs from JHat:
> >
> > TEST #1 (100M Max)
> > 101489 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $PropertyValue
> > 101488 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $Property
> > 52846 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $Path$Element
> > 43623 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $Path
> > 29782 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $Reference
> > 15944 instances of class com.google.apphosting.api.DatastorePb$Query
> > 13839 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $EntityProto
> > 9237 instances of class
> > com.google.appengine.api.datastore.dev.LocalCompositeIndexManager
> > $IndexComponentsOnlyQuery
> > 6705 instances of class
> > com.google.appengine.api.datastore.dev.LocalDatastoreService
> > $LiveQuery
> > 4613 instances of class
> > com.google.appengine.api.datastore.dev.LocalDatastoreService$Profile
> > $EntityGroup
> >
> > TEST #2 (512M Max)
> > 579558 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $Property
> > 579558 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $PropertyValue
> > 25863 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $Path$Element
> > 24805 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $Path
> > 17683 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $Reference
> > 10564 instances of class com.google.apphosting.api.DatastorePb$Query
> > 8441 instances of class
> > com.google.appengine.api.datastore.dev.LocalDatastoreService
> > $LiveQuery
> > 6065 instances of class com.google.storage.onestore.v3.OnestoreEntity
> > $EntityProto
> > 5002 instances of class
> > com.google.appengine.api.datastore.dev.LocalDatastoreService$Profile
> > $EntityGroup
> >
> > From what I can tell, the OnestoreEntity$Property and  OnestoreEntity
> > $PropertyValue classes are growing the most (and somewhat linearly)
> > with the number of Datastore operations I execute (capped only by the
> > amount of memory I allow the JVM).  Now, my first inclination is to
> > explain my error away on the grounds that the local datastore is "in-
> > memory", and so if I don't allow enough JVM memory for my datastore,
> > this is expected behavior.
> >
> > However, I'm only persisting 5,000 User entities (and not even getting
> > that far).  My "User" is not terribly complicated (6 properties, 4
> > Lists, and a Preferences object).  The lists and preferences are Lazy
> > and empty -- I'm not creating anything for these in my test -- just a
> > Userplus I'm only populating one of the field properties
> > (username) with a very short string.
> >
> > For me to run out of 512MB of memory after creating only 4k-ish users
> > means that each of my User entities is taking up around 125k each.
> > Accounting for other datastore components taking up memory, we could
> > say that my entities are only taking up 100k each, leaving the
> > datastore the other 25k, or 100MB of memory.  That still seems like my
> > entities are taking up way

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 gr

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.



Re: [appengine-java] Re: Error when deleting entities - Id cannot be zero

2010-03-12 Thread Max Ross (Google)
Which version of the App Engine SDK?


On Fri, Mar 12, 2010 at 1:43 PM, Pavel Byles  wrote:

> GWT: 2.0.3
>
> On Fri, Mar 12, 2010 at 4:38 PM, Max Ross (Google) <
> maxr+appeng...@google.com > wrote:
>
>> What version of the sdk are you using?
>>
>> On Fri, Mar 12, 2010 at 1:36 PM, Pavel Byles wrote:
>>
>>> Anyone?
>>>
>>>
>>> On Fri, Mar 12, 2010 at 8:41 AM, Pavel Byles wrote:
>>>
>>>> I'm trying to delete all entities in my datastore but I receive the
>>>> following error:
>>>>
>>>> javax.jdo.JDOUserException: One or more instances could not be deleted...
>>>> NestedThrowablesStackTrace:
>>>> java.lang.IllegalArgumentException: id cannot be zero...
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Caused by:java.lang.IllegalArgumentException: id cannot be zero
>>>>
>>>>
>>>> For the following code:
>>>>
>>>>   public void deleteAllMyType() {
>>>> PersistenceManager pm = PMF.get().getPersistenceManager();
>>>> Query query = pm.newQuery(MyType.class);
>>>> try {
>>>>   query.deletePersistentAll();
>>>>   //List clist = (List) query.execute();
>>>>   //pm.deletePersistentAll(clist); // This doesn't work either
>>>> } finally {
>>>>   query.closeAll();
>>>>   pm.close();
>>>> }
>>>>   }
>>>>
>>>> My entity class looks like this:
>>>>
>>>> @PersistenceCapable(identityType = IdentityType.APPLICATION)//,
>>>> detachable = "false")
>>>> public class MyType implements Serializable {
>>>>   @PrimaryKey
>>>>   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>>>>   private Long id;
>>>>
>>>>   @Persistent
>>>>   private String name;
>>>>   .
>>>>   .
>>>>   .
>>>> }
>>>>
>>>> --
>>>> -Pav
>>>>
>>>
>>>
>>>
>>> --
>>> -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 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.
>>
>
>
>
> --
> -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 at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



Re: [appengine-java] Re: Error when deleting entities - Id cannot be zero

2010-03-12 Thread Max Ross (Google)
What version of the sdk are you using?

On Fri, Mar 12, 2010 at 1:36 PM, Pavel Byles  wrote:

> Anyone?
>
>
> On Fri, Mar 12, 2010 at 8:41 AM, Pavel Byles  wrote:
>
>> I'm trying to delete all entities in my datastore but I receive the
>> following error:
>>
>> javax.jdo.JDOUserException: One or more instances could not be deleted...
>> NestedThrowablesStackTrace:
>> java.lang.IllegalArgumentException: id cannot be zero...
>>
>>
>> Caused by:java.lang.IllegalArgumentException: id cannot be zero
>>
>>
>> For the following code:
>>
>>   public void deleteAllMyType() {
>> PersistenceManager pm = PMF.get().getPersistenceManager();
>> Query query = pm.newQuery(MyType.class);
>> try {
>>   query.deletePersistentAll();
>>   //List clist = (List) query.execute();
>>   //pm.deletePersistentAll(clist); // This doesn't work either
>> } finally {
>>   query.closeAll();
>>   pm.close();
>> }
>>   }
>>
>> My entity class looks like this:
>>
>> @PersistenceCapable(identityType = IdentityType.APPLICATION)//,
>> detachable = "false")
>> public class MyType implements Serializable {
>>   @PrimaryKey
>>   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>>   private Long id;
>>
>>   @Persistent
>>   private String name;
>>   .
>>   .
>>   .
>> }
>>
>> --
>> -Pav
>>
>
>
>
> --
> -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 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] Memory Leak in the EntityManagerFactory?

2010-03-12 Thread Max Ross (Google)
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#Getting_an_EntityManager_Instance
>  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
> .
> 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] TransactionalTaskException when enqueuing more than 5 tasks

2010-03-08 Thread Max Ross (Google)
Oops, that was the python link.  Java link is
http://code.google.com/appengine/docs/java/datastore/transactions.html#What_Can_Be_Done_In_a_Transaction

On Mon, Mar 8, 2010 at 10:02 AM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> Yes, the limit is 5:
>
> http://code.google.com/appengine/docs/python/datastore/transactions.html#What_Can_Be_Done_In_a_Transaction
>
>
> On Mon, Mar 8, 2010 at 4:10 AM, JD  wrote:
>
>> I am enqueuing tasks within a transaction.
>>
>>
>> tx.begin()
>>
>> for (int i=0;i<10;i++) {
>>  Queue queue = QueueFactory.getDefaultQueue();
>>  TaskOptions task = url("/taskurl");
>>  task.param("param", "value");
>>  queue.add(task);
>> }
>> tx.commit();
>>
>>
>> I constantly get TransactionalTaskException when enqueuing task number
>> #6  (everything until number 5 goes through without issues).
>>
>> Is there a limit on the number of tasks which can be enqueued within a
>> transaction ?
>>
>>
>> com.google.appengine.api.labs.taskqueue.TransactionalTaskException
>>at
>>
>> com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:
>> 50)
>>at
>>
>> com.google.appengine.api.labs.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java:
>> 32)
>>at
>> com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:
>> 241)
>>at
>> com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:
>> 231)
>>
>> Caused by: java.lang.IllegalArgumentException:
>>at
>>
>> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
>> 33)
>>at
>>
>> com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:
>> 51)
>>... 51 more
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>

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

2010-03-08 Thread Max Ross (Google)
Yes, the limit is 5:
http://code.google.com/appengine/docs/python/datastore/transactions.html#What_Can_Be_Done_In_a_Transaction

On Mon, Mar 8, 2010 at 4:10 AM, JD  wrote:

> I am enqueuing tasks within a transaction.
>
>
> tx.begin()
>
> for (int i=0;i<10;i++) {
>  Queue queue = QueueFactory.getDefaultQueue();
>  TaskOptions task = url("/taskurl");
>  task.param("param", "value");
>  queue.add(task);
> }
> tx.commit();
>
>
> I constantly get TransactionalTaskException when enqueuing task number
> #6  (everything until number 5 goes through without issues).
>
> Is there a limit on the number of tasks which can be enqueued within a
> transaction ?
>
>
> com.google.appengine.api.labs.taskqueue.TransactionalTaskException
>at
>
> com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:
> 50)
>at
>
> com.google.appengine.api.labs.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java:
> 32)
>at
> com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:
> 241)
>at
> com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:
> 231)
>
> Caused by: java.lang.IllegalArgumentException:
>at
>
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
> 33)
>at
>
> com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:
> 51)
>... 51 more
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] What is the purpose of keyName? (Low-level API)

2010-02-22 Thread Max Ross (Google)
Jeff,

I agree with the majority of your design philosophy and the advice you're
dispensing, but I still disagree with you on one pretty fundamental point.
If I'm understanding your argument correctly, you're saying that best
practices for primary key management don't involve user-defined strings,
therefore user-defined strings aren't a necessary feature, but I think this
ignores a pretty basic usage of uniqueness constraints.  Let's say you're a
domain registrar, you're building your registration workflow on App Engine,
and you need to guarantee that a domain name can only be claimed once.  If
you use a numeric id mapped to the domain name you run the risk of letting
two users reserve the same domain, and if you're a domain registrar that's
really really bad.  There's no natural key we can bring in here.  Whether we
as application developers run into them frequently or not, there exists a
class of problems where a user-defined string pk is a necessary part of the
solution.

Regards,
Max

On Mon, Feb 22, 2010 at 1:52 PM, Jeff Schnitzer  wrote:

> On Mon, Feb 22, 2010 at 1:19 PM, Max Ross (Google)
> > wrote:
> >
> > user-defined long-id keys are not quite as easily used.  You either need
> to
> > commit to not letting the datastore generate ids for that kind or you
> need
> > to reserve a batch of ids using the DatastoreService.allocateIds method.
> > Otherwise you run the risk of a silent collision.  There is no such risk
> > with user-defined string keys.
>
> Right, but if the user has a natural key (long, String, whatever) they
> won't be using the generator anyways.  There are plenty of natural
> long keys in the world... facebook userid being a popular one.
>
> FWIW, Objectify makes the distinction between ids of type Long, which
> can be null and thus autogenerated, and long (the primitive) which
> cannot be autogenerated.  I really hadn't intended to plug Objectify
> here, really!
>
> > Valid point about renaming, but going back to the example I provided, the
> > datastore does not distinguish between inserts and updates.  The only way
> > you can guarantee that an entity was inserted, and therefore the only way
> > you can guarantee the uniqueness of the name, is to use a user-defined
> key.
> > If you're mapping id to name it will be possible to create two entities
> with
> > the same name.  It's of course up to you to decide how important this is
> to
> > defend against, but without the ability to provide your own id you
> wouldn't
> > get to make this choice, and without the ability to provide your own
> string
> > id you wouldn't be able to add some application-specific meaning to this
> > choice.
>
> I totally agree with you WRT user-defined vs generated values, I just
> don't see anything wrong with using the long id as a user-defined
> value.  Just make sure you never ask for a generated one.  Seems
> pretty straightforward.
>
> 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.
>
>

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



Re: [appengine-java] What is the purpose of keyName? (Low-level API)

2010-02-22 Thread Max Ross (Google)
On Mon, Feb 22, 2010 at 12:54 PM, Jeff Schnitzer wrote:

> I hate to be the dork that argues with the referees, but I'm not fond
> of this advice...
>
No problem, I'm happy to discuss.

>
>  * long-id keys can be user-defined just as easily as string-name
> keys, so you can enforce uniqueness constraints either way if you have
> some sort of natural key.
>
> user-defined long-id keys are not quite as easily used.  You either need to
commit to not letting the datastore generate ids for that kind or you need
to reserve a batch of ids using the DatastoreService.allocateIds method.
Otherwise you run the risk of a silent collision.  There is no such risk
with user-defined string keys.


>  * Readable urls are a high level construct, and it's easy enough to
> use pretty names mapped to ids using the memcache.  If you ever want
> to be able to rename people, you probably shouldn't use their name as
> a key!
>
> Valid point about renaming, but going back to the example I provided, the
datastore does not distinguish between inserts and updates.  The only way
you can guarantee that an entity was inserted, and therefore the only way
you can guarantee the uniqueness of the name, is to use a user-defined key.
If you're mapping id to name it will be possible to create two entities with
the same name.  It's of course up to you to decide how important this is to
defend against, but without the ability to provide your own id you wouldn't
get to make this choice, and without the ability to provide your own string
id you wouldn't be able to add some application-specific meaning to this
choice.

I'd say that the use case of string name vs numeric id is...  is your
> id a number or is it a string?  Boring answer but seems to sum it up
> pretty well.
>
> Jeff
>
> On Mon, Feb 22, 2010 at 10:50 AM, Max Ross (Google)
> > wrote:
> > 1) Readable-urls.  http://yourapp.appspot.com/users/max versus
> > http://yourapp.appspot.com/users/192398411324987
> >
> > 2) The datastore doesn't support uniqueness constraints so a user-defined
> > key is the only way you can do a true createIfNonExistent() method:
> >
> > beginTxn();
> > Entity e;
> > try {
> >   e = lookupByKeyName(keyName);
> > } cath (EntityNotFoundException enfe) {
> >   e = createNewEntity(keyName);
> > }
> > commitTxn();
> >
> > The final line throws ConcurrentModificationException if someone else
> > created an entity with the same keyName in between the lookup and the
> > commit.
> >
> > Max
> > On Sun, Feb 21, 2010 at 5:08 PM, DutrowLLC  wrote:
> >>
> >> Hi,
> >>
> >> What is the intended purpose of keyName when creating a new Key or new
> >> Entity in the low-level API?  What are the proper use cases for
> >> keyName?
> >>
> >> Thanks!
> >>
> >> Chris
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Google App Engine for Java" group.
> >> To post to this group, send email to
> >> google-appengine-j...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-appengine-java+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/google-appengine-java?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/google-appengine-java?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] What is the purpose of keyName? (Low-level API)

2010-02-22 Thread Max Ross (Google)
1) Readable-urls.  http://yourapp.appspot.com/users/max versus
http://yourapp.appspot.com/users/192398411324987

2) The datastore doesn't support uniqueness constraints so a user-defined
key is the only way you can do a true createIfNonExistent() method:

beginTxn();
Entity e;
try {
  e = lookupByKeyName(keyName);
} cath (EntityNotFoundException enfe) {
  e = createNewEntity(keyName);
}
commitTxn();

The final line throws ConcurrentModificationException if someone else
created an entity with the same keyName in between the lookup and the
commit.

Max
On Sun, Feb 21, 2010 at 5:08 PM, DutrowLLC  wrote:

> Hi,
>
> What is the intended purpose of keyName when creating a new Key or new
> Entity in the low-level API?  What are the proper use cases for
> keyName?
>
> Thanks!
>
> Chris
>
> --
> 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] NullPointerException at Transaction.commit()

2010-02-17 Thread Max Ross (Google)
Can you please post your model object definitions for Employee and
Department?

Thanks,
Max

On Mon, Feb 15, 2010 at 11:53 PM, sushama  wrote:

> import java.util.List;
>
> import javax.jdo.JDOHelper;
> import javax.jdo.PersistenceManager;
> import javax.jdo.PersistenceManagerFactory;
> import javax.jdo.Transaction;
> import javax.persistence.EntityManager;
> import javax.persistence.EntityManagerFactory;
> import javax.persistence.EntityTransaction;
> import javax.persistence.Persistence;
> import javax.persistence.Query;
>
> import com.google.gwt.user.client.Window;
> import com.google.gwt.user.server.rpc.RemoteServiceServlet;
> import com.wissen.enterprisebysush.client.GreetingService;
> import com.wissen.enterprisebysush.server.domainobject.Department;
> import com.wissen.enterprisebysush.server.domainobject.Employee;
>
> /**
>  * The server side implementation of the RPC service.
>  */
> @SuppressWarnings("serial")
> public class GreetingServiceImpl extends RemoteServiceServlet
> implements GreetingService {
>
>EntityManagerFactory emf =
> Persistence.createEntityManagerFactory("transactions-optional");
>
>public String greetServer(String input) {
>String serverInfo = getServletContext().getServerInfo();
>String userAgent = getThreadLocalRequest().getHeader("User-
> Agent");
>return "Hello, " + input + "!I am running " +
> serverInfo + ".It looks like you are using:" + userAgent;
>}
>
>@SuppressWarnings("unchecked")
>public void addDept(String dept_name, String dept_head) {
>
>EntityManager em = null;
>
>try {
>em = emf.createEntityManager();
>em.getTransaction().begin();
>Department d = new Department();
>d.setDept_name(dept_name);
>d.setHead(dept_head);
>
>Query q = em.createQuery("select from
> com.wissen.enterprisebysush.server.domainobject.Department d");
>List deptList = q.getResultList();
>
>for (Department dept : deptList) {
>System.out.println("Department name: " +
> dept.getDept_name());
>}
>
>em.persist(d);
>
>} finally {
>em.getTransaction().commit();
>em.close();
>
>}
>
>}
>
>public void addEmp(String emp_name, String emp_sal, String did) {
>EntityManager em = emf.createEntityManager();
>try {
>
>
>String s = did;
>
>EntityTransaction transaction = em.getTransaction();
>transaction.begin();
>System.out.println("value of Department_name is::" + s);
>System.out.println("Transaction is active and
> is::"+transaction);
>
>//Query q = em.createQuery("select dept_id
> from com.wissen.enterprisebysush.server.domainobject.Department d
> where d.dept_name = ?1");
>//q.setParameter(1, s);
>//System.out.println("Name of Department is::"
> + s);
>//Department dept = (Department)
> q.getSingleResult();
>
>Query q = em.createQuery("select from
> com.wissen.enterprisebysush.server.domainobject.Department d");
>Department dept = (Department) q.getResultList().get(0);
>System.out.println("Name of Department is::" +
> dept.getDept_name());
>
>//System.out.println("Query executed
> Successfully!!" + q.getSingleResult());
>Employee e = new Employee();
>e.setEmp_name("Abdch");
>e.setEmp_sal("5000");
>e.setDepartment(dept);
>em.persist(e);
>
>System.out.println("Transaction: " + transaction);
>
>transaction.commit();
>em.close();
>
>} catch (NullPointerException e) {
>e.printStackTrace();
>System.out.println("Exception::" + e.getCause());
>} finally {
>
>}
>}
>
> }
>
> output::
>
>
> value of Department_name is::Production
> Transaction is active and
> is::org.datanucleus.jpa.entitytransactioni...@1a21c7d
> Name of Department is::Accounts
> Transaction: org.datanucleus.jpa.entitytransactioni...@1a21c7d
> java.lang.NullPointerException
> Exception::null at
> com.google.appengine.api.datastore.KeyFactory.stringToKey(KeyFactory.java:
> 181)
>at
>
> org.datanucleus.store.appengine.DatastoreElementContainerStoreSpecialization.extractElementKey(DatastoreElementContainerStoreSpecialization.java:
> 170)
>at
>
> org.datanucleus.store.appengine.DatastoreAbstractCollectionStoreSpecialization.contains(DatastoreAbstractCollectionStoreSpecialization.java:
> 57)
>at
>
> org.datanucleus.store.mapped.scostore.AbstractCollectionStore.contains(AbstractCollectionStore.java:
> 116)
>at org.datanucleus.sco.backed.List.contains(List.java:455)
>at
>
> org.datanucleus.state.RelationshipManager.processManyToOneBidirectionalRelation(RelationshipManager.java:
> 690)
>at
> org.da

Re: [appengine-java] Re: How to get testing working with anything other than the default queue

2010-02-16 Thread Max Ross (Google)
Sorry Will, we look for ./WEB-INF/queue.xml by default.  Anyway glad you got
it working with the workaround.  I'll get this straightened out for the next
release.

Max

On Tue, Feb 16, 2010 at 11:41 AM, Will Bunker  wrote:

> I put in queue.xml in the test directory and it didn't seem to find
> it.
>
> On Feb 16, 10:47 am, "Max Ross (Google)" 
> 
> >
> wrote:
> > I see.  In the test environment it looks in "." by default so if you
> place
> > queue.xml in the directory from which you're executing the test it should
> > pick it up.I
> >
> > On Tue, Feb 16, 2010 at 10:35 AM, Will Bunker 
> wrote:
> > > I am saying that it is not reading queue.xml.  I am testing to make
> > > sure a certain function puts "x" number tasks in a queue that is not
> > > the default.  It doesn't load the queue.xml file unless I use your
> > > workaround (then it works great.)
> >
> > > On Feb 16, 10:21 am, "Max Ross (Google)" 
> > > 
> >
> >
> > > wrote:
> > > > By default the LocalTaskQueueTestConfig configures the local task
> queue
> > > > service to not automatically execute tasks:
> > >http://code.google.com/appengine/docs/java/tools/localunittesting/jav.
> ..
> >
> > > > Or are you saying it's not reading queue.xml?
> >
> > > > On Tue, Feb 16, 2010 at 10:16 AM, Will Bunker 
> > > wrote:
> > > > > Actually it doesn't seem to be reading the queue at all.  It is
> coming
> > > > > from the standard directory in WAR, but doesn't seem to pick it up.
>  I
> > > > > am on Mac OS if that makes any difference.
> >
> > > > > On Feb 16, 9:35 am, "Max Ross (Google)" 
> > > > > 
> >
> > >  <
> maxr%252bappeng...@google.com >>
> >
> > > > > wrote:
> > > > > > Hi Will,
> >
> > > > > > You're loading queue.xml from a different location in your unit
> > > tests?
> > > > >  This
> > > > > > is a use case I didn't thoroughly consider.  I can certainly fix
> this
> > > for
> > > > > > the next release but let me see if I can find a workaround for
> you.
> >
> > > > > > 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 at
> > > > >http://groups.google.com/group/google-appengine-java?hl=en.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google App Engine for Java" group.
> > > To post to this group, send email to
> > > google-appengine-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-appengine-java+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: How to get testing working with anything other than the default queue

2010-02-16 Thread Max Ross (Google)
I see.  In the test environment it looks in "." by default so if you place
queue.xml in the directory from which you're executing the test it should
pick it up.

On Tue, Feb 16, 2010 at 10:35 AM, Will Bunker  wrote:

> I am saying that it is not reading queue.xml.  I am testing to make
> sure a certain function puts "x" number tasks in a queue that is not
> the default.  It doesn't load the queue.xml file unless I use your
> workaround (then it works great.)
>
> On Feb 16, 10:21 am, "Max Ross (Google)" 
> 
> >
> wrote:
> > By default the LocalTaskQueueTestConfig configures the local task queue
> > service to not automatically execute tasks:
> http://code.google.com/appengine/docs/java/tools/localunittesting/jav...
> >
> > Or are you saying it's not reading queue.xml?
> >
> > On Tue, Feb 16, 2010 at 10:16 AM, Will Bunker 
> wrote:
> > > Actually it doesn't seem to be reading the queue at all.  It is coming
> > > from the standard directory in WAR, but doesn't seem to pick it up.  I
> > > am on Mac OS if that makes any difference.
> >
> > > On Feb 16, 9:35 am, "Max Ross (Google)" 
> > > 
> >
> >
> > > wrote:
> > > > Hi Will,
> >
> > > > You're loading queue.xml from a different location in your unit
> tests?
> > >  This
> > > > is a use case I didn't thoroughly consider.  I can certainly fix this
> for
> > > > the next release but let me see if I can find a workaround for you.
> >
> > > > 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 at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: How to get testing working with anything other than the default queue

2010-02-16 Thread Max Ross (Google)
By default the LocalTaskQueueTestConfig configures the local task queue
service to not automatically execute tasks:
http://code.google.com/appengine/docs/java/tools/localunittesting/javadoc/com/google/appengine/tools/development/testing/LocalTaskQueueTestConfig.html

Or are you saying it's not reading queue.xml?

On Tue, Feb 16, 2010 at 10:16 AM, Will Bunker  wrote:

> Actually it doesn't seem to be reading the queue at all.  It is coming
> from the standard directory in WAR, but doesn't seem to pick it up.  I
> am on Mac OS if that makes any difference.
>
> On Feb 16, 9:35 am, "Max Ross (Google)" 
> 
> >
> wrote:
> > Hi Will,
> >
> > You're loading queue.xml from a different location in your unit tests?
>  This
> > is a use case I didn't thoroughly consider.  I can certainly fix this for
> > the next release but let me see if I can find a workaround for you.
> >
> > 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 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] How to get testing working with anything other than the default queue

2010-02-16 Thread Max Ross (Google)
Try this:
private final LocalServiceTestHelper helper =
new LocalServiceTestHelper(new LocalTaskQueueTestConfig()) {
  @Override
  protected LocalServerEnvironment newLocalServerEnvironment() {
final LocalServerEnvironment lse =
super.newLocalServerEnvironment();
return new LocalServerEnvironment() {
  public File getAppDir() {
return new File("dir/with/queues.xml");
  }

  public String getAddress() {
return lse.getAddress();
  }

  public int getPort() {
return lse.getPort();
  }

  public void waitForServerToStart() throws InterruptedException
{
lse.waitForServerToStart();
  }
};
  }
};


On Tue, Feb 16, 2010 at 9:35 AM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> Hi Will,
>
> You're loading queue.xml from a different location in your unit tests?
> This is a use case I didn't thoroughly consider.  I can certainly fix this
> for the next release but let me see if I can find a workaround for you.
>
> Thanks,
> Max
>
> On Tue, Feb 16, 2010 at 9:24 AM, Will Bunker  wrote:
>
>> Prior to version 2.01 I was able to get testing to work with other
>> queues by the following code:
>>
>>LocalTaskQueue ltq =
>> LocalTaskQueueTestConfig.getLocalTaskQueue();
>>
>>
>>LocalServiceContext ctx = new LocalServiceContext() {
>>public File getAppDir() {
>>Logger.getAnonymousLogger().info("trying to run
>> getAppDir()");
>>File file = new File("war");
>>return file;
>>}
>>};
>>
>>HashMap prop = new HashMap();
>>ltq.init(ctx, prop);
>>ltq.start();
>>
>> You had to tell it where to find the config file queue.xml.  Now after
>> upgrading and using
>>
>>private static LocalServiceTestHelper helper =
>>new LocalServiceTestHelper(new LocalTaskQueueTestConfig());
>>
>> along with: helper.setUp
>>
>> I am getting the old testing errors of:
>> java.lang.IllegalStateException: The specified queue is unknown :
>>
>> How do I get the Queue environment to recognize the queues in the
>> queue.xml file?
>>
>> --
>> 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] How to get testing working with anything other than the default queue

2010-02-16 Thread Max Ross (Google)
Hi Will,

You're loading queue.xml from a different location in your unit tests?  This
is a use case I didn't thoroughly consider.  I can certainly fix this for
the next release but let me see if I can find a workaround for you.

Thanks,
Max
On Tue, Feb 16, 2010 at 9:24 AM, Will Bunker  wrote:

> Prior to version 2.01 I was able to get testing to work with other
> queues by the following code:
>
>LocalTaskQueue ltq =
> LocalTaskQueueTestConfig.getLocalTaskQueue();
>
>
>LocalServiceContext ctx = new LocalServiceContext() {
>public File getAppDir() {
>Logger.getAnonymousLogger().info("trying to run
> getAppDir()");
>File file = new File("war");
>return file;
>}
>};
>
>HashMap prop = new HashMap();
>ltq.init(ctx, prop);
>ltq.start();
>
> You had to tell it where to find the config file queue.xml.  Now after
> upgrading and using
>
>private static LocalServiceTestHelper helper =
>new LocalServiceTestHelper(new LocalTaskQueueTestConfig());
>
> along with: helper.setUp
>
> I am getting the old testing errors of:
> java.lang.IllegalStateException: The specified queue is unknown :
>
> How do I get the Queue environment to recognize the queues in the
> queue.xml file?
>
> --
> 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] JDO/JPA Snippets That Work - The Truth About Joins

2010-02-12 Thread Max Ross (Google)
http://gae-java-persistence.blogspot.com/2010/02/truth-about-joins.html

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



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

2010-02-12 Thread Max Ross (Google)
Thanks for making the code available.  This looks like an unintentional bug
fix to me.  There is a hard and fast rule that you can't operate on more
than one entity group inside a transaction, so creating and saving two
instances of EntityA should always generate an exception because they are
both root entities and therefore part of different entity groups.  This code
_should_ have thrown an exception in 1.3.0 (and earlier), but it didn't.  I
made some implementation changes to how transactions are managed in 1.3.1
and it looks like I fixed this problem as part of it.

Max

On Fri, Feb 12, 2010 at 12:10 AM, vori  wrote:

> The following source code has the same problem.
>
> -
> PersistenceManager pm = pmfInstance.getPersistenceManager();
>
> pm.makePersistent(new EntityB("key"));  // If this two lines are
> commented out,
> pm.getObjectById(EntityB.class, "key"); // the following code throws
> exception on sdk1.3.0 too.
>
> Transaction tx = pm.currentTransaction();
> tx.begin();
> pm.makePersistent(new EntityA());
> pm.makePersistent(new EntityA()); // it throws exception if it
> compiled using sdk1.3.1.
> tx.commit();
> -
>
> Full source code is included in the following repository.
> Hg repo
> https://test-gae-j-sdk-131.googlecode.com/hg/
> Project page: http://code.google.com/p/test-gae-j-sdk-131/
>
> On 2月12日, 午後4:25, vori  wrote:
> > Sorry, I am wrong.
> > I inspected my source code and found the real cause.
> >
> > The following code can works on SDK1.3.0, but it throws
> > "java.lang.IllegalArgumentException:
> >  can't operate on multiple entity groups in a single transaction."
> > when it used on SDK1.3.1.
> >
> > 
> > PersistenceManager pm = pmfInstance.getPersistenceManager();
> >
> > pm.makePersistent(new EntityB("key"));  // If this two lines are
> > commented out,
> > pm.getObjectById(EntityB.class, "key"); // the following code throws
> > exception on SDK1.3.0 too.
> >
> > ArrayList entities = new ArrayList(2);
> > entities.add(new EntityA());
> > entities.add(new EntityA());
> > Transaction tx = pm.currentTransaction();
> > tx.begin();
> > pm.makePersistentAll(entities); // it throws exception if it compiled
> > using sdk1.3.1.
> > tx.commit();
> > 
> >
> > Full source code is here.https://test-gae-j-sdk-131.googlecode.com/hg/
> >
> > On 2月12日, 午前3:11, "Max Ross (Google)" 
> > 
> >
> > wrote:
> >
> >
> >
> > > Assuming a ClassA object with the specified id already exists, the code
> > > you've posted works fine for me.  Could you put together a complete
> example
> > > that demonstrates the unexpected behavior?
> >
> > > Thanks,
> > > Max
> >
> > > On Wed, Feb 10, 2010 at 7:49 PM, vori  wrote:
> > > > Is it a bug on JDO of SDK 1.3.1?
> >
> > > > --
> > > > PersistentManager pm = PMF.get().getPersistenceManager();;
> >
> > > > ClassA classA = pm.getObjectById(ClassA.class, "id");
> > > > ClassB classB = new ClassB();
> >
> > > > Transaction tx = pm.currentTransaction();
> > > > tx.begin();
> > > > pm.makePersistent(classB);
> >
> > > > tx.commit(); // It throws "javax.jdo.JDOException: can't operate on
> > > > multiple entity groups in a single transaction."
> > > > --
> >
> > > > --
> > > > 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...@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 use junit test in the newest SDK1.3.1

2010-02-11 Thread Max Ross (Google)
Great, glad to hear it!  I forgot to add a method to LocalServiceTestHelper
to set a custom app id.  My mistake.  I'll make sure this gets added for the
next release so you don't need to provide your own Environment
implementation.

Max

On Thu, Feb 11, 2010 at 10:30 AM, Krishna Caldas wrote:

> You're right!
> I refactored my code and forget to annotate the new setUp method with
> @Before.
> Sorry for taking your time! It works now.
>
> Thanks,
> Krishna
>
>
> 2010/2/11 Max Ross (Google) 
> 
> >:
> > Your code looks fine.  Are you sure you're calling setUp() on the
> > LocalServiceTestHelper?
> >
> > On Thu, Feb 11, 2010 at 10:11 AM, Krishna Caldas <
> krishnacal...@gmail.com>
> > wrote:
> >>
> >> Ooops.. missed your question!
> >> It's just:
> >>@Override
> >>protected Environment newEnvironment() {
> >>return new TestEnvironment();
> >>}
> >>
> >> Thanks,
> >> Krishna
> >>
> >> 2010/2/11 Max Ross (Google) 
> >> 
> >:
> >> > Subclassing LocalServiceTestHelper and overriding newEnvironment()
> >> > should
> >> > work fine.  What does your implementation of newEnvironment() look
> like?
> >> >
> >> > On Wed, Feb 10, 2010 at 7:35 PM, Krishna 
> >> > wrote:
> >> >>
> >> >> Ok!
> >> >>
> >> >> But when I'm using transactions I'm getting:
> >> >>
> >> >> java.lang.NullPointerException: No API environment is registered for
> >> >> this thread.
> >> >>at
> >> >>
> >> >>
> >> >>
> com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
> >> >> 67)
> >> >>at
> >> >>
> >> >>
> >> >>
> com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
> >> >> 270)
> >> >>
> >> >> I've tried to extend LocalServiceTestHelper and overwrite
> >> >> newEnvironment()  with my Environment (who returns appId) but it
> >> >> didn't work...
> >> >>
> >> >> What's wrong?
> >> >>
> >> >> Thanks,
> >> >> Krishna
> >> >>
> >> >> On Feb 10, 10:25 pm, "Ikai L (Google)"  wrote:
> >> >> > We've got a more simple interface for you now. Take a look:
> >> >> >
> >> >> >
> >> >> >
> http://code.google.com/appengine/docs/java/tools/localunittesting.html
> >> >> >
> >> >> > 2010/2/10 时空之蕊 
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > > I found the class
> >> >> > > com.google.appengine.tools.development.ApiProxyLocalImpl is not
> >> >> > > public,but before 1.3.1 it's public!
> >> >> > > In the JUnit document:
> >> >> >
> >> >> > > import java.io.File;
> >> >> > > import com.google.appengine.tools.development.ApiProxyLocalImpl;
> >> >> > > import com.google.apphosting.api.ApiProxy;
> >> >> >
> >> >> > > ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
> >> >> >
> >> >> > > So I can't new a ApiProxyLocalImpl instance!
> >> >> > > Any body know how to use JUnit?
> >> >> > > 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
>  >> >> > > unsubscr...@googlegroups.com>
> >> >> > > .
> >> >> > > For more options, visit this group at
> >> >>

Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Max Ross (Google)
Your code looks fine.  Are you sure you're calling setUp() on the
LocalServiceTestHelper?

On Thu, Feb 11, 2010 at 10:11 AM, Krishna Caldas wrote:

> Ooops.. missed your question!
> It's just:
>@Override
>protected Environment newEnvironment() {
>return new TestEnvironment();
> }
>
> Thanks,
> Krishna
>
> 2010/2/11 Max Ross (Google) 
> 
> >:
> > Subclassing LocalServiceTestHelper and overriding newEnvironment() should
> > work fine.  What does your implementation of newEnvironment() look like?
> >
> > On Wed, Feb 10, 2010 at 7:35 PM, Krishna 
> wrote:
> >>
> >> Ok!
> >>
> >> But when I'm using transactions I'm getting:
> >>
> >> java.lang.NullPointerException: No API environment is registered for
> >> this thread.
> >>at
> >>
> >>
> com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
> >> 67)
> >>at
> >>
> >>
> com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
> >> 270)
> >>
> >> I've tried to extend LocalServiceTestHelper and overwrite
> >> newEnvironment()  with my Environment (who returns appId) but it
> >> didn't work...
> >>
> >> What's wrong?
> >>
> >> Thanks,
> >> Krishna
> >>
> >> On Feb 10, 10:25 pm, "Ikai L (Google)"  wrote:
> >> > We've got a more simple interface for you now. Take a look:
> >> >
> >> >
> http://code.google.com/appengine/docs/java/tools/localunittesting.html
> >> >
> >> > 2010/2/10 时空之蕊 
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > > I found the class
> >> > > com.google.appengine.tools.development.ApiProxyLocalImpl is not
> >> > > public,but before 1.3.1 it's public!
> >> > > In the JUnit document:
> >> >
> >> > > import java.io.File;
> >> > > import com.google.appengine.tools.development.ApiProxyLocalImpl;
> >> > > import com.google.apphosting.api.ApiProxy;
> >> >
> >> > > ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
> >> >
> >> > > So I can't new a ApiProxyLocalImpl instance!
> >> > > Any body know how to use JUnit?
> >> > > 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
>  >> > > unsubscr...@googlegroups.com>
> >> > > .
> >> > > For more options, visit this group at
> >> > >http://groups.google.com/group/google-appengine-java?hl=en.
> >> >
> >> > --
> >> > Ikai Lan
> >> > Developer Programs Engineer, Google App
> >> > Enginehttp://googleappengine.blogspot.com|
> http://twitter.com/app_engine
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Google App Engine for Java" group.
> >> To post to this group, send email to
> >> google-appengine-j...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-appengine-java+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/google-appengine-java?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/google-appengine-java?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



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

2010-02-11 Thread Max Ross (Google)
Assuming a ClassA object with the specified id already exists, the code
you've posted works fine for me.  Could you put together a complete example
that demonstrates the unexpected behavior?

Thanks,
Max

On Wed, Feb 10, 2010 at 7:49 PM, vori  wrote:

> Is it a bug on JDO of SDK 1.3.1?
>
> --
> PersistentManager pm = PMF.get().getPersistenceManager();;
>
> ClassA classA = pm.getObjectById(ClassA.class, "id");
> ClassB classB = new ClassB();
>
> Transaction tx = pm.currentTransaction();
> tx.begin();
> pm.makePersistent(classB);
>
> tx.commit(); // It throws "javax.jdo.JDOException: can't operate on
> multiple entity groups in a single transaction."
> --
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1

2010-02-11 Thread Max Ross (Google)
Subclassing LocalServiceTestHelper and overriding newEnvironment() should
work fine.  What does your implementation of newEnvironment() look like?

On Wed, Feb 10, 2010 at 7:35 PM, Krishna  wrote:

> Ok!
>
> But when I'm using transactions I'm getting:
>
> java.lang.NullPointerException: No API environment is registered for
> this thread.
>at
>
> com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:
> 67)
>at
>
> com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java:
> 270)
>
> I've tried to extend LocalServiceTestHelper and overwrite
> newEnvironment()  with my Environment (who returns appId) but it
> didn't work...
>
> What's wrong?
>
> Thanks,
> Krishna
>
> On Feb 10, 10:25 pm, "Ikai L (Google)"  wrote:
> > We've got a more simple interface for you now. Take a look:
> >
> > http://code.google.com/appengine/docs/java/tools/localunittesting.html
> >
> > 2010/2/10 时空之蕊 
> >
> >
> >
> >
> >
> > > I found the class
> > > com.google.appengine.tools.development.ApiProxyLocalImpl is not
> > > public,but before 1.3.1 it's public!
> > > In the JUnit document:
> >
> > > import java.io.File;
> > > import com.google.appengine.tools.development.ApiProxyLocalImpl;
> > > import com.google.apphosting.api.ApiProxy;
> >
> > > ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")){});
> >
> > > So I can't new a ApiProxyLocalImpl instance!
> > > Any body know how to use JUnit?
> > > 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 unsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
> >
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Enginehttp://
> googleappengine.blogspot.com|http://twitter.com/app_engine
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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: getNextID

2010-02-10 Thread Max Ross (Google)
If sequential ids is important I'd recommend allocating a suitably large
batch up front and then managing the assignment yourself.  You can get a
batch of sequential ids using the standalone JDO sequences to which Andy is
referring or the low-level datastore api.  Since your domain is
Accounting/HR I'm guessing 1 million ids should be plenty.  You can then
store nextId in the datastore.  As long as your fetch and your update of
this value are in the same transaction it should work fine, and since I
doubt you'll be dealing with a high rate of employee creation you shouldn't
run into much entity group contention, if any.

On Wed, Feb 10, 2010 at 5:15 AM, aswath satrasala <
aswath.satras...@gmail.com> wrote:

> Hello Max,
> thanks.
> I think sequential ids will be a must in my case. It does not have to be
> for a PK, but for non-pk is also fine.
> I am creating a small multi-tenancy Accounting/HR application and when I
> create employees, I am thinking of giving an employeeID for the employee.
> In addition, I want to be able to specify the start range of the employeeID
> also and add prefix for the start range
>
> Looking into the following for a non-pk field.
> @Persistent(valueStrategy = IdGeneratorStrategy.SEQUENCE)
>
> Hopefully this will work for me.
>
> Thanks
> -Aswath
>
>
>
>
> On Wed, Feb 10, 2010 at 10:42 AM, Max Ross (Google) <
> maxr+appeng...@google.com > wrote:
>
>> Hi Aswath,
>>
>> Unfortunately there is no way to guarantee the assignment of sequential
>> ids using JDO on App Engine, or even using the low-level datastore api.
>> This is because ids are allocated in batches across many datastore backends,
>> and one request to get the next id may hit one backend while another may hit
>> a different backend.  Is sequential ids a hard requirement?
>>
>> Max
>>
>> On Tue, Feb 9, 2010 at 8:27 PM, aswath satrasala <
>> aswath.satras...@gmail.com> wrote:
>>
>>> Hello Max,
>>> I am planning to use IdGeneratorStrategy.INCREMENT feature to assign
>>> sequential ids for entities I am creating.  for example, Employee.
>>>
>>> -Aswath
>>>
>>> On Wed, Feb 10, 2010 at 5:49 AM, Max Ross (Google) <
>>> maxr+appeng...@google.com > wrote:
>>>
>>>> JDO Sequences work, we just haven't publicized them.  The DataNucleus
>>>> docs should tell you everything you need to know:
>>>> http://www.datanucleus.org/products/accessplatform/jdo/sequences.html
>>>>
>>>> IdGeneratorStrategy.INCREMENT is not yet implemented.  What are you
>>>> looking to use it for?
>>>>
>>>> Max
>>>>
>>>>
>>>> On Mon, Feb 8, 2010 at 3:20 AM, Vincent TELLIER <
>>>> tellier.vinc...@gmail.com> wrote:
>>>>
>>>>> I tried the incrementation, but I got an error saying that it was not
>>>>> implemented in the appengine datastore.
>>>>>
>>>>>
>>>>> TELLIER Vincent
>>>>> + Email : cont...@tellier-vincent.eu
>>>>> + Contact messenger (msn) : abs...@esugenus.fr
>>>>>
>>>>>
>>>>> 2010/2/8 aswath satrasala 
>>>>>
>>>>> See if the following annotation help you.
>>>>>> @Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT)
>>>>>>
>>>>>> -Aswath
>>>>>>
>>>>>>
>>>>>> On Mon, Feb 8, 2010 at 1:18 AM, datanucleus >>>>> > wrote:
>>>>>>
>>>>>>> What getNextID feature on JDO ? i.e please make reference to the JDO
>>>>>>> API and which particular API Method you're referring to
>>>>>>>
>>>>>>> --
>>>>>>> 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
>>&

Re: [appengine-java] Re: getNextID

2010-02-10 Thread Max Ross (Google)
Both value-strategy of SEQUENCE and the standalone sequences work.  See

http://code.google.com/p/datanucleus-appengine/source/browse/trunk/tests/org/datanucleus/test/SequenceExamplesJDO.java
and
http://code.google.com/p/datanucleus-appengine/source/browse/trunk/tests/org/datanucleus/store/appengine/JDOSequenceTest.java


On Wed, Feb 10, 2010 at 2:55 AM, datanucleus wrote:

> > JDO Sequences work, we just haven't publicized them.
>
> Max, you mean value-strategy of SEQUENCE ? I was referring to
> "pm.getSequence()", which maps across to
> your implementation of StoreManager.getNucleusSequence(). i.e a stand-
> alone way of having sequences available to the user
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Re: getNextID

2010-02-09 Thread Max Ross (Google)
Hi Aswath,

Unfortunately there is no way to guarantee the assignment of sequential ids
using JDO on App Engine, or even using the low-level datastore api.  This is
because ids are allocated in batches across many datastore backends, and one
request to get the next id may hit one backend while another may hit a
different backend.  Is sequential ids a hard requirement?

Max

On Tue, Feb 9, 2010 at 8:27 PM, aswath satrasala  wrote:

> Hello Max,
> I am planning to use IdGeneratorStrategy.INCREMENT feature to assign
> sequential ids for entities I am creating.  for example, Employee.
>
> -Aswath
>
> On Wed, Feb 10, 2010 at 5:49 AM, Max Ross (Google) <
> maxr+appeng...@google.com > wrote:
>
>> JDO Sequences work, we just haven't publicized them.  The DataNucleus docs
>> should tell you everything you need to know:
>> http://www.datanucleus.org/products/accessplatform/jdo/sequences.html
>>
>> IdGeneratorStrategy.INCREMENT is not yet implemented.  What are you
>> looking to use it for?
>>
>> Max
>>
>>
>> On Mon, Feb 8, 2010 at 3:20 AM, Vincent TELLIER <
>> tellier.vinc...@gmail.com> wrote:
>>
>>> I tried the incrementation, but I got an error saying that it was not
>>> implemented in the appengine datastore.
>>>
>>>
>>> TELLIER Vincent
>>> + Email : cont...@tellier-vincent.eu
>>> + Contact messenger (msn) : abs...@esugenus.fr
>>>
>>>
>>> 2010/2/8 aswath satrasala 
>>>
>>> See if the following annotation help you.
>>>> @Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT)
>>>>
>>>> -Aswath
>>>>
>>>>
>>>> On Mon, Feb 8, 2010 at 1:18 AM, datanucleus 
>>>> wrote:
>>>>
>>>>> What getNextID feature on JDO ? i.e please make reference to the JDO
>>>>> API and which particular API Method you're referring to
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Google App Engine for Java" group.
>>>>> To post to this group, send email to
>>>>> google-appengine-j...@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> google-appengine-java+unsubscr...@googlegroups.com
>>>>> .
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>>>
>>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Google App Engine for Java" group.
>>>> To post to this group, send email to
>>>> google-appengine-j...@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> google-appengine-java+unsubscr...@googlegroups.com
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine for Java" group.
>>> To post to this group, send email to
>>> google-appengine-j...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-appengine-java+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

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



Re: [appengine-java] Re: getNextID

2010-02-09 Thread Max Ross (Google)
JDO Sequences work, we just haven't publicized them.  The DataNucleus docs
should tell you everything you need to know:
http://www.datanucleus.org/products/accessplatform/jdo/sequences.html

IdGeneratorStrategy.INCREMENT is not yet implemented.  What are you looking
to use it for?

Max

On Mon, Feb 8, 2010 at 3:20 AM, Vincent TELLIER
wrote:

> I tried the incrementation, but I got an error saying that it was not
> implemented in the appengine datastore.
>
>
> TELLIER Vincent
> + Email : cont...@tellier-vincent.eu
> + Contact messenger (msn) : abs...@esugenus.fr
>
>
> 2010/2/8 aswath satrasala 
>
> See if the following annotation help you.
>> @Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT)
>>
>> -Aswath
>>
>>
>> On Mon, Feb 8, 2010 at 1:18 AM, datanucleus wrote:
>>
>>> What getNextID feature on JDO ? i.e please make reference to the JDO
>>> API and which particular API Method you're referring to
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine for Java" group.
>>> To post to this group, send email to
>>> google-appengine-j...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-appengine-java+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group 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] VerifyError on StreamingQueryResult

2010-02-09 Thread Max Ross (Google)
Thanks for the report.  This is indeed the same issue.  We're testing a fix
now and hope to have this resolved very soon.

Max

On Tue, Feb 9, 2010 at 4:27 AM, paweł majewski wrote:

> Look similar to
>
> http://groups.google.com/group/google-appengine-java/browse_thread/thread/daa540465c4605d/c155d492b8fe89c9?lnk=gst&q=StreamingQueryResult%241#c155d492b8fe89c9
>
> app id: swiatlo-czuli
> gae version: 1.2.1 (?)
>
>
> Uncaught exception from servlet
> java.lang.VerifyError: org/datanucleus/store/appengine/query/
> StreamingQueryResult$1
>at
>
> org.datanucleus.store.appengine.query.StreamingQueryResult.listIterator(StreamingQueryResult.java:
> 128)
>at
>
> org.datanucleus.store.appengine.query.StreamingQueryResult.iterator(StreamingQueryResult.java:
> 120)
>at
>
> pl.simpatico.swiatloczuli.server.supports.FolderSupport.getFoldersTree(FolderSupport.java:
> 179)
>at org.apache.jsp.gallery_jsp._jspService(gallery_jsp.java:83)
>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
> $CachedChain.doFilter(ServletHandler.java:1093)
>at
>
> com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:
> 129)
>at
>
> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:
> 77)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1084)
>at
>
> pl.simpatico.swiatloczuli.server.filter.CharEncodingFilter.doFilter(CharEncodingFilter.java:
> 44)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1084)
>at
>
> com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:
> 97)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1084)
>at
>
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
> 35)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1084)
>at
>
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
> 43)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1084)
>at
> 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(AppVersionHandlerMap.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(RpcRequestParser.java:
> 76)
>at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>at
>
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
> 135)
>at
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
> 235)
>at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $6.handleBlockingRequest(RuntimePb.java:5485)
>at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> $6.handleBlockingRequest(RuntimePb.java:5483)
>at
>
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:
> 24)
>at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> 363)
>at com.google.net.rpc.impl.Server$2.run(Server.java:837)
>at
> com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:
> 56)
>at
>
> com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:
> 536)
>at com.google.net.rpc.impl.Server.startRpc(Server.java:792)
>at com.google.net.rpc.impl.Server.processRequest(Server.java:367)
>at
>
> com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:
> 448)
>at
> com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:
> 319)
>at
> com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:
> 290)
>at com.google.net.async.Conne

Re: [appengine-java] java.lang.VerifyError

2010-02-09 Thread Max Ross (Google)
Hi Steve, thanks for bringing this to our attention.  We've identified a
problem on our end and we're in the process of correcting it.  You're of
course free to continue using an older version of the SDK, but newer
versions are not susceptible to this problem.

Max

On Tue, Feb 9, 2010 at 5:56 AM, Steve Shrader wrote:

> I have an application that has been deployed and running for several
> months.  Yesterday it began throwing the error java.lang.VerifyError.
> No new deployments or changes in usage on my side.  The code throwing
> the error is in this method...
>
>/**
> * Retrieve a list of Expense depending on the Dates and
> Vendor passed in.  There will be two
> * execution paths because Vendor does not need to be passed
> in as a filter.
> */
>@SuppressWarnings("unchecked")  //query is against
> Expense.class so it will return List
>public List
> getExpenses(Date startDate, Date endDate, String vendor) {
>List
> dtoExpenses = new ArrayList();
>String userId = getUserId();
>if(userId != null) {
>List expenses = null;
>
>PersistenceManager pm =
> PMF.get().getPersistenceManager();
>Query query = pm.newQuery(Expense.class);
>query.declareImports("import java.util.Date");
>query.setOrdering("date asc");
>
>String queryFilter = "userId == userIdParam &&
> date >= startDateParam && date <= endDateParam";
>
>Map queryParameters = new HashMap();
>queryParameters.put("userIdParam", userId);
>queryParameters.put("startDateParam",
> startDate);
>queryParameters.put("endDateParam", endDate);
>
>if(vendor != null && vendor.trim().length() >
> 0) {  //if a vendor passed in
>queryFilter = queryFilter + " &&
> vendor == vendorParam";
>queryParameters.put("vendorParam",
> vendor);
>}
>
>query.setFilter(queryFilter);
>expenses = (List)
> query.executeWithMap(queryParameters);
>
>for(Expense e : expenses) {
>dtoExpenses.add(new
> steveshrader.budget.client.dto.Expense(e.getId(), e.getDate(),
> e.getAmount(), e.getVendor(), e.getExpenseType(),
> e.getPaymentType()));
>}
>
>pm.close();
>}
>return dtoExpenses;
>}
>
> The complete stack trace is...
>
> javax.servlet.ServletContext log: Exception while dispatching incoming
> RPC call
> com.google.gwt.user.server.rpc.UnexpectedException: Service method
> 'public abstract java.util.List
>
> steveshrader.budget.client.BudgetService.getExpenses(java.util.Date,java.util.Date,java.lang.String)'
> threw an unexpected exception: java.lang.VerifyError: org/datanucleus/
> store/appengine/query/StreamingQueryResult$1
>at
> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
> 360)
>at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
> 546)
>at
>
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
> 166)
>at
>
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
> 86)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
> 487)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1093)
>at
>
> com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:
> 97)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1084)
>at
>
> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:
> 35)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1084)
>at
>
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
> 43)
>at org.mortbay.jetty.servlet.ServletHandler
> $CachedChain.doFilter(ServletHandler.java:1084)
>at
> 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.

Re: [appengine-java] Task queues and transaction support

2010-01-25 Thread Max Ross (Google)
Hi JD,

We released the api for this feature ahead of the backend support so you'll
need to wait for the next release (currently making its way through QA) to
be able to take advantage of transactional tasks.  Once the feature is
enabled, tasks that are added to queues when there is an active datastore
transaction will be automatically enlisted in the datastore transaction so
most of the time you won't actually need to get ahold of the active
com.google.appengine.api.datastore.Transaction.  That said, you can always
get ahold of the active datastore transaction via
DatastoreService.getCurrentTransaction().

Hope this helps,
Max

On Mon, Jan 25, 2010 at 5:11 PM, JD  wrote:

> The Queue interface has a method:
> TaskHandle add(Transaction txn,
>   TaskOptions taskOptions)
>
>
> How does one get a handle on
> com.google.appengine.api.datastore.Transaction in the first place ?
> The persistent manager only returns  a transaction of type
> javax.jdo.Transaction  which is not compatible with
> com.google.appengine.api.datastore.Transaction expected by the task
> queue API.
>
>
> Is this a bug ?
>
> JD
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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] KeyFactory.keyToString format?

2010-01-25 Thread Max Ross (Google)
Today our implementation is consistent with that assumption but in the
future it may not be.  KeyFactory.stringToKey() returning a valid Key object
is a more future-proof indicator.

On Mon, Jan 25, 2010 at 5:04 PM, Eric Jain  wrote:

> Is it safe to assume that the regular expression [a-zA-Z0-9]+ will
> match any string generated by KeyFactory.keyToString?
>
> --
> 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] Cannot have a java.lang.Long primary key and be a child object

2010-01-15 Thread Max Ross (Google)
Hi Carl,

You can use a string-encoded key on the child object to avoid a dependency
on proprietary google classes.  More info here:
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys

(search for Key as Encoded String)

Hope this helps,
Max

On Fri, Jan 15, 2010 at 6:24 AM, Carl Ballantyne
wrote:

> Hi All,
>
> I have two classes, a Parent and a Child. (See below for code) The
> Parent class contains a reference to a Child instance. However when I
> try and save a Parent instance I get the following error: Cannot have
> a java.lang.Long primary key and be a child object.
>
> The error is clear enough and upon searching around I have found the
> solution is to convert the primary key of my Child class to Key.
> However this just does not sit well with me that I have to modify my
> domain classes with proprietary google classes to suit the datastore.
> Is there no other way to do this without resorting to custom APIs at
> the domain level? Or is this a limitation of JDO and I need to do a
> bit more research?
>
> Cheers,
> Carl.
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Parent {
>
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Long id;
>@Persistent
>private String name;
>
>@Persistent
>private Child child;
>
>public Long getId() {
>return id;
>}
>public void setId(Long id) {
>this.id = id;
>}
>public String getName() {
>return name;
>}
>public void setName(String name) {
>this.name = name;
>}
>public Child getChild() {
>return child;
>}
>public void setChild(Child child) {
>this.child = child;
>}
>
>
> }
>
>
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Child {
>
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Long id;
>@Persistent
>private String name;
>
>
>public Long getId() {
>return id;
>}
>public void setId(Long id) {
>this.id = id;
>}
>public String getName() {
>return name;
>}
>public void setName(String name) {
>this.name = name;
>}
>
> }
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>
>
-- 

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] Wildcard must appear at the end of the expression string (only prefix matches are supported)

2010-01-14 Thread Max Ross (Google)
Thanks for the report Steve, looks like a bug.  The information in the error
message is still relevant though.  The datastore does not support real
regular expression matching, but rather just "startsWith" filters.  So, if
your regex can be rewritten to use "GrpName.startsWith()" then you can use
that as your workaround, but if it can't be written this way then the
datastore won't be able to fulfill this query even once this bug is fixed.

Sorry for the trouble,
Max

On Wed, Jan 13, 2010 at 3:42 AM, Steve Pritchard  wrote:

> I get this exception.
>
> viewItemByQuery
> Exception:org.datanucleus.store.appengine.query.DatastoreQuery
> $UnsupportedDatastoreFeatureException: Problem with query  com.rsi.gems.bbb.gdo.GdoSysGroups WHERE this.GrpName.matches(".*")>:
> Wildcard must appear at the end of the expression string (only prefix
> matches are supported)
>
> The Datanucleus doc clearly states this is a String Regex expression
> which is what I have.
>
> To quote: Returns whether string matches the passed expression. The
> pattern argument follows the rules of java.lang.String.matches
> method.
>
> How do I proceed?
>
> Steve
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>
>
-- 

You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.

To post to this group, send email to google-appengine-j...@googlegroups.com.

To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Unexpected error during precommit, with owned relation, if childList is null

2010-01-12 Thread Max Ross (Google)
Fixed in trunk

On Tue, Jan 12, 2010 at 12:56 PM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> Sure, glad I could help.
>
> On Tue, Jan 12, 2010 at 12:52 PM, Kemal Dogan wrote:
>
>> hi max,
>> thanks you very much.
>>
>>
>> On Tue, Jan 12, 2010 at 10:44 PM, Max Ross (Google)
>> > wrote:
>> > Filed
>> http://code.google.com/p/datanucleus-appengine/issues/detail?id=188
>> >
>> ...
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>>
>>
>
-- 

You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.

To post to this group, send email to google-appengine-j...@googlegroups.com.

To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Unexpected error during precommit, with owned relation, if childList is null

2010-01-12 Thread Max Ross (Google)
Sure, glad I could help.

On Tue, Jan 12, 2010 at 12:52 PM, Kemal Dogan  wrote:

> hi max,
> thanks you very much.
>
>
> On Tue, Jan 12, 2010 at 10:44 PM, Max Ross (Google)
> > wrote:
> > Filed
> http://code.google.com/p/datanucleus-appengine/issues/detail?id=188
> >
> ...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>
>
-- 

You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.

To post to this group, send email to google-appengine-j...@googlegroups.com.

To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Unexpected error during precommit, with owned relation, if childList is null

2010-01-12 Thread Max Ross (Google)
Filed http://code.google.com/p/datanucleus-appengine/issues/detail?id=188

On Tue, Jan 12, 2010 at 11:01 AM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> Hi Kemal, thanks for the report.  I can reproduce the exception and I can
> make the exception go away by removing the column = "F_PK" attributes from
> the @Persistent annotations.  I don't yet know why this is causing a problem
> but overriding the name of a primary key column doesn't do anything (the
> primary key is always mapped to the Entity key, not a named property on the
> Entity), so removing them shouldn't hurt.
>
> Max
>
> On Thu, Jan 7, 2010 at 10:20 AM, Kemal Dogan  wrote:
>
>> is there any solution for this problem?
>>
>> On Thu, Dec 31, 2009 at 8:46 PM, Kemal Dogan 
>> wrote:
>> > hi,
>> > I have two entity with owned relation. Order is master entity and
>> > OrderItem is child entity.
>> > When I have to persist Order without OrderItem, but
>> > it gives an exception (javax.jdo.JDOException: Unexpected error during
>> > precommit) at commit line.
>> >
>> > But if I add an OrderItem instance to orderItemChilds, then it works.
>> >
>> > My sample code is at below, how can I solve this problem.
>> > Please help.
>> >
>> > Kemal Dogan.
>> >
>> >
>> > ---
>> > My Codes:
>> >
>> > Master Entity:
>> > @PersistenceCapable(identityType = IdentityType.APPLICATION, table =
>> > "T_Order", detachable = "true")
>> > @Inheritance(customStrategy = "complete-table")
>> > public class Order extends MasterEntityImpl {
>> >
>> >@Persistent(mappedBy = "order")
>> >@Element(dependent = "true")
>> >@javax.jdo.annotations.Order(extensions = @Extension(vendorName =
>> > "datanucleus", key = "list-ordering", value = "pk asc"))
>> >private List orderItemChilds = new ArrayList();
>> > ...
>> > Child Entity:
>> > @PersistenceCapable(identityType = IdentityType.APPLICATION, table =
>> > "T_OrderItem", detachable = "true")
>> > public class OrderItem extends ChildEntityImpl {
>> >@Persistent
>> >private Order order;
>> > ...
>> > DAO code:
>> >public void test_With_ERROR() {
>> >OrderDAO orderDAO = DAOFactory.getInstance().getOrderDAO();
>> >Order order= new Order();
>> >orderDAO.persist(order);
>> >}
>> >public void test_With_NO_ERROR() {
>> >OrderDAO orderDAO = DAOFactory.getInstance().getOrderDAO();
>> >Order order= new Order();
>> >List orderItems= (List)
>> > order.getOrderItemChilds();
>> >OrderItem item= new OrderItem();
>> >orderItems.add(item);
>> >orderDAO.persist(order);
>> >}
>> > .
>> >
>> > Other abtract classes.
>> > @PersistenceCapable(identityType = IdentityType.APPLICATION,
>> > detachable = "true")
>> > @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
>> > public abstract class MasterEntityImpl implements MasterEntity {
>> >@PrimaryKey
>> >@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, column =
>> "F_PK")
>> >private Key pk;
>> > ...
>> > @PersistenceCapable(identityType = IdentityType.APPLICATION,
>> > detachable = "true")
>> > @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
>> > public abstract class ChildEntityImpl
>> > implements ChildEntity {
>> >@PrimaryKey
>> >@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, column =
>> "F_PK")
>> >private Key pk;
>> > ...
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>>
>>
>
-- 

You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.

To post to this group, send email to google-appengine-j...@googlegroups.com.

To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Unexpected error during precommit, with owned relation, if childList is null

2010-01-12 Thread Max Ross (Google)
Hi Kemal, thanks for the report.  I can reproduce the exception and I can
make the exception go away by removing the column = "F_PK" attributes from
the @Persistent annotations.  I don't yet know why this is causing a problem
but overriding the name of a primary key column doesn't do anything (the
primary key is always mapped to the Entity key, not a named property on the
Entity), so removing them shouldn't hurt.

Max

On Thu, Jan 7, 2010 at 10:20 AM, Kemal Dogan  wrote:

> is there any solution for this problem?
>
> On Thu, Dec 31, 2009 at 8:46 PM, Kemal Dogan  wrote:
> > hi,
> > I have two entity with owned relation. Order is master entity and
> > OrderItem is child entity.
> > When I have to persist Order without OrderItem, but
> > it gives an exception (javax.jdo.JDOException: Unexpected error during
> > precommit) at commit line.
> >
> > But if I add an OrderItem instance to orderItemChilds, then it works.
> >
> > My sample code is at below, how can I solve this problem.
> > Please help.
> >
> > Kemal Dogan.
> >
> >
> > ---
> > My Codes:
> >
> > Master Entity:
> > @PersistenceCapable(identityType = IdentityType.APPLICATION, table =
> > "T_Order", detachable = "true")
> > @Inheritance(customStrategy = "complete-table")
> > public class Order extends MasterEntityImpl {
> >
> >@Persistent(mappedBy = "order")
> >@Element(dependent = "true")
> >@javax.jdo.annotations.Order(extensions = @Extension(vendorName =
> > "datanucleus", key = "list-ordering", value = "pk asc"))
> >private List orderItemChilds = new ArrayList();
> > ...
> > Child Entity:
> > @PersistenceCapable(identityType = IdentityType.APPLICATION, table =
> > "T_OrderItem", detachable = "true")
> > public class OrderItem extends ChildEntityImpl {
> >@Persistent
> >private Order order;
> > ...
> > DAO code:
> >public void test_With_ERROR() {
> >OrderDAO orderDAO = DAOFactory.getInstance().getOrderDAO();
> >Order order= new Order();
> >orderDAO.persist(order);
> >}
> >public void test_With_NO_ERROR() {
> >OrderDAO orderDAO = DAOFactory.getInstance().getOrderDAO();
> >Order order= new Order();
> >List orderItems= (List)
> > order.getOrderItemChilds();
> >OrderItem item= new OrderItem();
> >orderItems.add(item);
> >orderDAO.persist(order);
> >}
> > .
> >
> > Other abtract classes.
> > @PersistenceCapable(identityType = IdentityType.APPLICATION,
> > detachable = "true")
> > @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> > public abstract class MasterEntityImpl implements MasterEntity {
> >@PrimaryKey
> >@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, column =
> "F_PK")
> >private Key pk;
> > ...
> > @PersistenceCapable(identityType = IdentityType.APPLICATION,
> > detachable = "true")
> > @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> > public abstract class ChildEntityImpl
> > implements ChildEntity {
> >@PrimaryKey
> >@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, column =
> "F_PK")
> >private Key pk;
> > ...
> >
>
> --
> 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] question for Max Ross

2010-01-12 Thread Max Ross (Google)
Hi Rusty,

This is something we've planned to support all along, we just haven't gotten
around to it yet.  There's an issue filed for it here:
http://code.google.com/p/datanucleus-appengine/issues/detail?id=86

(already quite a few stars)

There are 2 things that make this work complicated.  The first is explained
in the above issue (no way to resolve unowned relationships inside a txn due
to multiple entity groups).  The second is that we need to start storing the
Keys of the referenced objects in a list property on the parent.  This is
optional for owned relationships because we can use an ancestor query to
find children (this is what we do now), but required for unowned
relationships because there's no other way to store the relationship.  This
is one of the things I've been working on the last few weeks, and once this
work is done it unlocks a ton of good stuff, including unowned
relationships.

Max

On Mon, Jan 11, 2010 at 11:50 PM, Rusty Wright wrote:

> If I understand things correctly, it seems to me that a class would have a
> field
>
>  @Persistent(defaultFetchGroup = "true")
>  List myClassKeys; // keys are from MyClass objects
>
> instead of
>
>  @Persistent(defaultFetchGroup = "true")
>  List list;
>
> because in the latter case, when an object is added to the List, it's
> parented to the enclosing object.  In the case of the List of Key, no
> parenting happens so you can add keys for objects that are already parented
> or at the root level.
>
> Why can't you create an annotation parameter or new annotation so that we
> can use the latter form, and the annotation specifies that the objects'
> parenting remains unchanged?  So under the hood it behaves like the former
> List of Key, but it provides a cleaner interface like the latter.
>
> --
> 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] Persist/query test.test1.Test and test.test2.Test

2010-01-11 Thread Max Ross (Google)
By default the kind of the datastore entity is derived from the simple name
of the class, and test.test1.Test.class.getSimpleName() is the same as
test.test2.Test.class.getSimpleName().  This is documented here:
http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Class_and_Field_Annotations

If you need to persist two classes in different packages but with the same
name you can override the kind like this:

@PersistenceCapable(table = "SomethingElse")
public class Test {
  // ...
}

Hope this helps,
Max

On Fri, Jan 8, 2010 at 3:45 PM, w  wrote:

> I have two persistable classes: test.test1.Test and test.test2.Test,
> but I can't persist/query objects of these classes right. There is a
> simple example shows wrong behavior:
>
> test.TestServlet.java:
>
> package test;
>
> import java.io.IOException;
>
> import javax.jdo.JDOHelper;
> import javax.jdo.PersistenceManager;
> import javax.jdo.PersistenceManagerFactory;
> import javax.servlet.http.HttpServlet;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
>
> public class TestServlet extends HttpServlet {
>
>  public void doGet(HttpServletRequest request, HttpServletResponse
> response) throws IOException {
>PersistenceManager pm = pmFactory.getPersistenceManager();
>pm.makePersistent(new test.test1.Test("1", "test1"));
>pm.close();
>
>pm = pmFactory.getPersistenceManager();
>pm.makePersistent(new test.test2.Test("1", "test2"));
>pm.close();
>
>pm = pmFactory.getPersistenceManager();
>response.getWriter().println("RESULT:  " + pm.getObjectById
> (test.test1.Test.class, "1"));
>pm.close();
>  }
>
>  public static final PersistenceManagerFactory pmFactory =
> JDOHelper.getPersistenceManagerFactory("transactions-optional");
>
> }
>
> test.test1.TestServlet.java and test.test2.TestServlet.java are the
> same except package name, so I missed it:
>
> import javax.jdo.annotations.*;
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Test {
>
>  public Test(String id, String data) {
>this.id = id; this.data = data;
>  }
>
>  public String toString() {
>return getClass().getName() + ": id=" + id + " data=" + data;
>  }
>
>  @PrimaryKey
>  private String id;
>
>  @Persistent
>  private String data;
>
> }
>
> Surprising result I got is following:
>
> RESULT:  test.test1.Test: id=1 data=test2
>
> Expected result:
>
> RESULT:  test.test1.Test: id=1 data=test1
>
> --
> 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] No JDO support for datanucleus ObjectStringConverter?

2010-01-11 Thread Max Ross (Google)
I'm sorry to report that we have not yet hooked in support for
ObjectStringConverter.  It shouldn't be too difficult though and I can
definitely see how it would be useful.  Please file an issue and we'll get
to it as soon as we can.

http://code.google.com/p/datanucleus-appengine/issues/list

Thanks,
Max
On Fri, Jan 8, 2010 at 3:47 PM, inetdevboy  wrote:

> I wrote a datanucleus javaTypes plugin (for joda-time LocalDate) based
> on the org.datanuclues.store.types.ObjectStringConverter interface.
> You probably know that this interface allows non-basic types to
> declare their ability to marshal themselves to/from a String
> representation for persistence.  In my case it'd be particularly
> helpful because the String representation's natural sort order matches
> the sort order of the class itself, so it'd be indexable.
>
> The datanucleus layer seems to find and register the plugin, because I
> get this FINE debug line when I include my plugin:
>
> Jan 8, 2010 8:47:42 PM org.datanucleus.store.types.TypeManager
> addJavaType
> FINE: Adding support for Java type org.joda.time.LocalDate
> (persistent=true, DFG=true, embedded=true)
>
> But when it tries to persist a field of type LocalDate I still get the
> following stack, with or without my plugin:
>
> java.lang.IllegalArgumentException: eventDate: org.joda.time.LocalDate
> is not a supported property type.
>at
> com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue
> (DataTypeUtils.java:145)
>at
> com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue
> (DataTypeUtils.java:127)
>at
> com.google.appengine.api.datastore.Entity.setProperty(Entity.java:
> 280)
>at
> org.datanucleus.store.appengine.DatastoreFieldManager.storeObjectField
> (DatastoreFieldManager.java:798)
>at org.datanucleus.state.AbstractStateManager.providedObjectField
> (AbstractStateManager.java:1037)
>at com.inetdevboy.model.Event.jdoProvideField(Event.java)
>at com.inetdevboy.model.Event.jdoProvideFields(Event.java)
> [more]...
>
> I'd really like to avoid having to declare separate persistence fields
> with lifecycle listeners to accommodate every LocalDate field.  Is
> there a lever in the existing GAE implementation I haven't pulled to
> engage my plugin?
>
> BTW, I'm aware that there's an existing JodaTime datanucleus plugin,
> but it appears to require DataNucleus 2, and my implementation is
> essentially the same as theirs, just without the ORM support.
>
> Please help!
>
> [Using GAE SDK 1.3.0]
>
> --
> 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] multiple contains() clauses on the same table

2010-01-08 Thread Max Ross (Google)
Fixed in trunk.

On Fri, Jan 8, 2010 at 10:31 AM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> Issued filed:
> http://code.google.com/p/datanucleus-appengine/issues/detail?id=185
>
>
> On Fri, Jan 8, 2010 at 10:12 AM, Max Ross (Google) <
> maxr+appeng...@google.com > wrote:
>
>> I'm really sorry but I've been unable to construct an equivalent query
>> that avoids this bug.  If the size of keyList isn't too large I'd recommend
>> executing a batch get to retrieve all those objects by id and then applying
>> the rest of your filter in-memory.
>>
>> Sorry for the trouble.
>>
>> Max
>>
>>
>> On Fri, Jan 8, 2010 at 9:48 AM, Max Ross (Google) <
>> maxr+appeng...@google.com > wrote:
>>
>>> Thanks for the report, looks like a bug.  Multiple contains() clauses are
>>> fine but I didn't properly account for the case where one of the clauses is
>>> on the primary key of the object.  The fix should be straightforward but let
>>> me see if I can get you a workaround.
>>>
>>> Max
>>>
>>> On Thu, Jan 7, 2010 at 7:06 PM, siliconeagle  wrote:
>>>
>>>> Basically i have 3 fields in the same table to select by
>>>> using .contains() clauses - one is the primary key field
>>>>
>>>> so :keyList (java.util.Set) , :feedTypes (java.util.Set)
>>>> & :contentTypes(java.util.Set) with values i need to select
>>>> with.
>>>>
>>>> The Feed object (and the relevant fields) is
>>>> @PersistenceCapable(identityType = IdentityType.APPLICATION)
>>>> public class Feed {
>>>>
>>>>@PrimaryKey
>>>>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>>>>private Key id;
>>>>  ...
>>>>@Persistent
>>>>private int typeFeed ;
>>>>@Persistent
>>>>private int typeContent = CONTENT_TYPE_NOTCHECKED;
>>>> 
>>>> }
>>>>
>>>> so i try this
>>>> Query query1 = pm.newQuery(Feed.class);
>>>> query1.setFilter(":keyList.contains(id) && :feedTypes.contains
>>>> (typeFeed) &&  :contentTypes.contains(typeContent)");
>>>> query1.setRange(0,500);
>>>> Map paramsf = new HashMap();
>>>> paramsf.put("keyList", feedIds);
>>>> paramsf.put("feedTypes", feedTypes);
>>>> paramsf.put("contentTypes", contentTypes);
>>>> feeds = (List) query1.executeWithMap(paramsf);
>>>>
>>>> and i get
>>>> javax.jdo.JDOFatalUserException: Batch lookup by primary key is only
>>>> supported if no other filters and no sort orders are defined.
>>>>
>>>> Is there any way around it - from other posts it looks like subqueries
>>>> an the IN syntax arent supported.
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> 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] [ANN] DataNucleus AccessPlatform 2.0 released

2010-01-08 Thread Max Ross (Google)
Congrats on the release Andy!

The App Engine DataNucleus plugin is not going to work out-of-the-box with
DN 2.0 so please wait until we (Google) update our stuff.  This is going to
take some time for us but we will get it taken care of.

Max

On Fri, Jan 8, 2010 at 9:44 AM, Rusty Wright wrote:

> If we're getting the DataNucleus jars by way of maven dependencies, do you
> recommend that we wait until Google updates their stuff before we use 2.0 or
> can we start using your 2.0 version now?
>
>
>
> datanucleus wrote:
>
>> The next generation of DataNucleus AccessPlatform has now been
>> released. This includes much internal restructuring and API changes to
>> simplify future directions, as well as many feature additions,
>> including support for more datastore types. Of the things that impact
>> on GAE/J usage : non-tx persist/delete operations are now atomic, L2
>> cached is enabled by default, support for singleton PMF/EMF pattern,
>> preview for many JPA2 features, full support for JDO2.3 features, auto-
>> generation of primary key classes during enhancement, support for
>> persistence of JodaTime types, ability to cache query compilations and
>> query results, and many other things.
>>
>> Obviously, the current version of the GAE/J DataNucleus plugin doesn't
>> support this version of DataNucleus yet, but if any of the items
>> listed above would be desirable to your project then I suggest that
>> you "star" the following issue
>>
>> http://code.google.com/p/datanucleus-appengine/issues/detail?id=103&colspec=ID%20Stars%20Type%20Status%20Priority%20FoundIn%20TargetRelease%20Owner%20Summary
>>
>>
> --
> 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] multiple contains() clauses on the same table

2010-01-08 Thread Max Ross (Google)
Issued filed:
http://code.google.com/p/datanucleus-appengine/issues/detail?id=185

On Fri, Jan 8, 2010 at 10:12 AM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> I'm really sorry but I've been unable to construct an equivalent query that
> avoids this bug.  If the size of keyList isn't too large I'd recommend
> executing a batch get to retrieve all those objects by id and then applying
> the rest of your filter in-memory.
>
> Sorry for the trouble.
>
> Max
>
>
> On Fri, Jan 8, 2010 at 9:48 AM, Max Ross (Google) <
> maxr+appeng...@google.com > wrote:
>
>> Thanks for the report, looks like a bug.  Multiple contains() clauses are
>> fine but I didn't properly account for the case where one of the clauses is
>> on the primary key of the object.  The fix should be straightforward but let
>> me see if I can get you a workaround.
>>
>> Max
>>
>> On Thu, Jan 7, 2010 at 7:06 PM, siliconeagle  wrote:
>>
>>> Basically i have 3 fields in the same table to select by
>>> using .contains() clauses - one is the primary key field
>>>
>>> so :keyList (java.util.Set) , :feedTypes (java.util.Set)
>>> & :contentTypes(java.util.Set) with values i need to select
>>> with.
>>>
>>> The Feed object (and the relevant fields) is
>>> @PersistenceCapable(identityType = IdentityType.APPLICATION)
>>> public class Feed {
>>>
>>>@PrimaryKey
>>>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>>>private Key id;
>>>  ...
>>>@Persistent
>>>private int typeFeed ;
>>>@Persistent
>>>private int typeContent = CONTENT_TYPE_NOTCHECKED;
>>> 
>>> }
>>>
>>> so i try this
>>> Query query1 = pm.newQuery(Feed.class);
>>> query1.setFilter(":keyList.contains(id) && :feedTypes.contains
>>> (typeFeed) &&  :contentTypes.contains(typeContent)");
>>> query1.setRange(0,500);
>>> Map paramsf = new HashMap();
>>> paramsf.put("keyList", feedIds);
>>> paramsf.put("feedTypes", feedTypes);
>>> paramsf.put("contentTypes", contentTypes);
>>> feeds = (List) query1.executeWithMap(paramsf);
>>>
>>> and i get
>>> javax.jdo.JDOFatalUserException: Batch lookup by primary key is only
>>> supported if no other filters and no sort orders are defined.
>>>
>>> Is there any way around it - from other posts it looks like subqueries
>>> an the IN syntax arent supported.
>>>
>>>
>>>
>>>
>>> --
>>> 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] multiple contains() clauses on the same table

2010-01-08 Thread Max Ross (Google)
I'm really sorry but I've been unable to construct an equivalent query that
avoids this bug.  If the size of keyList isn't too large I'd recommend
executing a batch get to retrieve all those objects by id and then applying
the rest of your filter in-memory.

Sorry for the trouble.

Max

On Fri, Jan 8, 2010 at 9:48 AM, Max Ross (Google)

> wrote:

> Thanks for the report, looks like a bug.  Multiple contains() clauses are
> fine but I didn't properly account for the case where one of the clauses is
> on the primary key of the object.  The fix should be straightforward but let
> me see if I can get you a workaround.
>
> Max
>
> On Thu, Jan 7, 2010 at 7:06 PM, siliconeagle  wrote:
>
>> Basically i have 3 fields in the same table to select by
>> using .contains() clauses - one is the primary key field
>>
>> so :keyList (java.util.Set) , :feedTypes (java.util.Set)
>> & :contentTypes(java.util.Set) with values i need to select
>> with.
>>
>> The Feed object (and the relevant fields) is
>> @PersistenceCapable(identityType = IdentityType.APPLICATION)
>> public class Feed {
>>
>>@PrimaryKey
>>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>>private Key id;
>>  ...
>>@Persistent
>>private int typeFeed ;
>>@Persistent
>>private int typeContent = CONTENT_TYPE_NOTCHECKED;
>> 
>> }
>>
>> so i try this
>> Query query1 = pm.newQuery(Feed.class);
>> query1.setFilter(":keyList.contains(id) && :feedTypes.contains
>> (typeFeed) &&  :contentTypes.contains(typeContent)");
>> query1.setRange(0,500);
>> Map paramsf = new HashMap();
>> paramsf.put("keyList", feedIds);
>> paramsf.put("feedTypes", feedTypes);
>> paramsf.put("contentTypes", contentTypes);
>> feeds = (List) query1.executeWithMap(paramsf);
>>
>> and i get
>> javax.jdo.JDOFatalUserException: Batch lookup by primary key is only
>> supported if no other filters and no sort orders are defined.
>>
>> Is there any way around it - from other posts it looks like subqueries
>> an the IN syntax arent supported.
>>
>>
>>
>>
>> --
>> 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] multiple contains() clauses on the same table

2010-01-08 Thread Max Ross (Google)
Thanks for the report, looks like a bug.  Multiple contains() clauses are
fine but I didn't properly account for the case where one of the clauses is
on the primary key of the object.  The fix should be straightforward but let
me see if I can get you a workaround.

Max

On Thu, Jan 7, 2010 at 7:06 PM, siliconeagle  wrote:

> Basically i have 3 fields in the same table to select by
> using .contains() clauses - one is the primary key field
>
> so :keyList (java.util.Set) , :feedTypes (java.util.Set)
> & :contentTypes(java.util.Set) with values i need to select
> with.
>
> The Feed object (and the relevant fields) is
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Feed {
>
>@PrimaryKey
>@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>private Key id;
>  ...
>@Persistent
>private int typeFeed ;
>@Persistent
>private int typeContent = CONTENT_TYPE_NOTCHECKED;
> 
> }
>
> so i try this
> Query query1 = pm.newQuery(Feed.class);
> query1.setFilter(":keyList.contains(id) && :feedTypes.contains
> (typeFeed) &&  :contentTypes.contains(typeContent)");
> query1.setRange(0,500);
> Map paramsf = new HashMap();
> paramsf.put("keyList", feedIds);
> paramsf.put("feedTypes", feedTypes);
> paramsf.put("contentTypes", contentTypes);
> feeds = (List) query1.executeWithMap(paramsf);
>
> and i get
> javax.jdo.JDOFatalUserException: Batch lookup by primary key is only
> supported if no other filters and no sort orders are defined.
>
> Is there any way around it - from other posts it looks like subqueries
> an the IN syntax arent supported.
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>
>
-- 

You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.

To post to this group, send email to google-appengine-j...@googlegroups.com.

To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Datanucleus initialization performance

2010-01-06 Thread Max Ross (Google)
Yeah, 5 shouldn't be a problem at all.  It should certainly be possible to
force-feed the list of plugins to DataNucleus, but it's likely this will
require changes to DataNucleus core.  Could you please file an issue?  I'll
investigate.

Thanks,
Max

On Wed, Jan 6, 2010 at 10:40 AM, Todd Lindner wrote:

> Only 5 :)
>
> But your first point could explain things...  I probably have a few
> too many 3rd party jars in my war.  Will look for unnecessary ones.
>
> But to be even more pro-active, is there a way we can tell it what
> bundles to load?  So it can skip all the jar searching?  Especially
> since it does enhancement before hand, it should write out a manifest
> of exactly which classes need to have metadata constructed.  _or_
> (haha) the metadata could be pre-built as well.
>
>
> On Jan 6, 1:02 pm, "Max Ross (Google)" 
> 
> >
> wrote:
> > DataNucleus has an internal plugin mechanism that spins through all the
> jars
> > on the classpath looking for bundles to load.  This can certainly take
> some
> > time.  Construction of metadata is also pretty involved, but the amount
> of
> > time that takes should be proportional to the number of enhanced classes
> you
> > have.  How many do you have?
> >
> >
> >
> > On Wed, Jan 6, 2010 at 4:36 AM, Todd Lindner 
> wrote:
> > > @Don - yes
> >
> > > @Toby - yes on the dev appserver the first request also takes about 6
> > > seconds.  Watching the info log I see it finishes initialization of my
> > > servlet after 1.5 seconds and then starts up the datanucleus
> > > initialization, which takes about 4-5 seconds.   Attaching a profiler
> > > is a good idea and I will do it tonight but I'm 99% sure the hotspots
> > > will be in org.datanucleus packages, which is why I was posting here
> > > to hopefully find the ear of Max Ross or the like...
> >
> > > On Jan 5, 12:56 pm, Toby Reyelts  wrote:
> > > > Also, can you duplicate the slowness in the dev_appserver? If so, you
> can
> > > > hook up a profiling tool yourself and see if there are any obvious
> > > hotspots.
> >
> > > > On Tue, Jan 5, 2010 at 12:44 PM, Don Schwarz 
> > > wrote:
> > > > > Have you tried enabling offline precompilation?
> >
> > > > > On Tue, Jan 5, 2010 at 8:52 AM, Todd Lindner <
> todd.lind...@gmail.com
> > > >wrote:
> >
> > > > >> Since Google App Engine will power down the app if there aren't
> any
> > > > >> requests for ~10 minutes, it has to re-initialize your application
> > > > >> often.  Not a problem  I was able to trim my app init down to
> > > > >> about 1.5 seconds, so its reasonable, but datanucleus itself takes
> > > > >> about 5 seconds on top of that (and I only have 5 persistent
> > > > >> entities!).  This is a real drag on my app and I almost want to
> keep
> > > > >> it awake with a pinger...
> >
> > > > >> Any way to speed up initialization?  I'm using JPA.
> >
> > > > >> Thanks
> > > > >> -Todd
> >
> > > > >> --
> >
> > > > >> 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> > > 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 unsubscr...@googlegroups.com> > > unsubscr...@googlegroups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/google-appengine-java?

Re: [appengine-java] Re: Datanucleus initialization performance

2010-01-06 Thread Max Ross (Google)
DataNucleus has an internal plugin mechanism that spins through all the jars
on the classpath looking for bundles to load.  This can certainly take some
time.  Construction of metadata is also pretty involved, but the amount of
time that takes should be proportional to the number of enhanced classes you
have.  How many do you have?

On Wed, Jan 6, 2010 at 4:36 AM, Todd Lindner  wrote:

> @Don - yes
>
> @Toby - yes on the dev appserver the first request also takes about 6
> seconds.  Watching the info log I see it finishes initialization of my
> servlet after 1.5 seconds and then starts up the datanucleus
> initialization, which takes about 4-5 seconds.   Attaching a profiler
> is a good idea and I will do it tonight but I'm 99% sure the hotspots
> will be in org.datanucleus packages, which is why I was posting here
> to hopefully find the ear of Max Ross or the like...
>
>
> On Jan 5, 12:56 pm, Toby Reyelts  wrote:
> > Also, can you duplicate the slowness in the dev_appserver? If so, you can
> > hook up a profiling tool yourself and see if there are any obvious
> hotspots.
> >
> >
> >
> > On Tue, Jan 5, 2010 at 12:44 PM, Don Schwarz 
> wrote:
> > > Have you tried enabling offline precompilation?
> >
> > > On Tue, Jan 5, 2010 at 8:52 AM, Todd Lindner  >wrote:
> >
> > >> Since Google App Engine will power down the app if there aren't any
> > >> requests for ~10 minutes, it has to re-initialize your application
> > >> often.  Not a problem  I was able to trim my app init down to
> > >> about 1.5 seconds, so its reasonable, but datanucleus itself takes
> > >> about 5 seconds on top of that (and I only have 5 persistent
> > >> entities!).  This is a real drag on my app and I almost want to keep
> > >> it awake with a pinger...
> >
> > >> Any way to speed up initialization?  I'm using JPA.
> >
> > >> Thanks
> > >> -Todd
> >
> > >> --
> >
> > >> 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 unsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>
>
-- 

You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.

To post to this group, send email to google-appengine-j...@googlegroups.com.

To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Query with inequality operators on a single property fails

2010-01-05 Thread Max Ross (Google)
Implicit parameters need to be prefixed with a ':'

query.setFilter("dueDate >= :beginDateParam && dueDate <= :endDateParam");

Max
On Tue, Jan 5, 2010 at 10:53 AM, dantuluri  wrote:

> Hi,
>
> I have the following query with inequality operators on a single
> property:
>
> query = pm.newQuery(File.class);
> query.setFilter("dueDate >= beginDateParam && dueDate <=
> endDateParam");
> List storedFiles = (List)query.executeWithArray(begin,
> end);
>
> Runtime is throwing this exception:
> java.lang.RuntimeException:
> org.datanucleus.store.appengine.query.DatastoreQuery
> $UnsupportedDatastoreFeatureException: Problem with query  Flow WHERE dueDate >= beginDateParam && dueDate <= endDateParam>:
> Operator  >=  cannot be used as part of the join condition.  Use
> 'contains' if joining on a Collection field and equality if joining on
> a single-value field.
>
> AppEngine documentation clearly says it supports inequality operators
> on a single property. Following is the quote from the documentation:
>
> Inequality Filters Are Allowed On One Property Only
> A query may only use inequality filters (<, <=, >=, >, !=) on one
> property across all of its filters.
> For example, this query is allowed:
> select from Person where birthYear >= minBirthYearParam
>  && birthYear <= maxBirthYearParam
>
> Can anyone with App Engine experience please explain whats wrong with
> this query?
>
> 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.
>
>
>
>
-- 

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] SUBSTRING function for JPA

2010-01-04 Thread Max Ross (Google)
It's not implemented.  Could you please file a bug?

http://code.google.com/p/datanucleus-appengine/issues/list

Thanks,
Max

On Sun, Jan 3, 2010 at 7:16 AM, Wong  wrote:

>
> SUBSTRING function for JPA is not working.
>
> entityManager.createQuery("SELECT SUBSTRING(v.name, 1, 3) from Venue
> v") return v.name but NOT the substring.
>
>
> Anyone has any idea?
>
> --
>
> 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] Simple one to many problem!!!

2009-12-30 Thread Max Ross (Google)
The difference between your code and the code in the blog post is that
you're calling em.persist() on the child object but the blog post is calling
em.persist() on the parent object.  If you want to take advantage of
implicit entity group assignment it's important to manage children via their
parents.  If you switch em.persist(search) to em.persist(member) you should
be fine.

Max

On Wed, Dec 30, 2009 at 3:22 PM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> I'd recommend basing your code on the example here to get something
> working:
>
> http://gae-java-persistence.blogspot.com/2009/10/creating-bidrectional-owned-one-to-many.html
>
> Then you can start tweaking.
>
> Max
>
>
> On Wed, Dec 30, 2009 at 3:02 PM, markm208  wrote:
>
>> I am thoroughly confused… I am trying to set up a simple one to many
>> relationship using JPA, I think that this should work but instead I
>> get the error "Primary key for object of type Member is null." Any
>> help would be greatly appreciated.
>>
>> @Entity(name = "Member")
>> public class Member
>> {
>>@Id
>>@GeneratedValue(strategy = GenerationType.IDENTITY)
>>private Key id;
>>
>>@Basic //datastore specific type
>>private Email memberEmail;
>>private String memberPassword;
>>private String memberFirstName;
>>private String memberLastName;
>>@Basic //blob of text not searchable
>>private Text memberDescription;
>>
>>//Member 'owns' the Searches
>>@OneToMany(mappedBy = "memberWhoCreated", cascade=CascadeType.ALL)
>>private List < Search > searches = new ArrayList < Search >();
>>
>>//getters and setters
>>//...
>> }
>>
>> @Entity(name = "Search")
>> public class Search
>> {
>>@Id
>>@GeneratedValue(strategy = GenerationType.IDENTITY)
>>private Key id;
>>
>>private List < String > searchStrings;
>>private boolean allowOthersToSee;
>>@Basic //datastore specific type
>>private Text contextOfSearch;
>>
>>@ManyToOne(fetch = FetchType.LAZY)
>>private Member memberWhoCreated;
>>
>>public static Search createASearch(boolean allowOthersToSee, String
>> context, Member member)
>>{
>>Search search = null;
>>
>>EntityManager em = null;
>>try
>>{
>>//get the entity manager
>>em = EMF.get().createEntityManager();
>>
>>//create the search from the form variables
>>search = new Search();
>>search.setAllowOthersToSee(allowOthersToSee);
>>search.setContextOfSearch(new Text(context));
>>search.setMemberWhoCreated(member);
>>
>>em.getTransaction().begin();
>>try
>>{
>>
>>//store the member
>>em.persist(search);
>>em.getTransaction().commit();
>>}
>>finally
>>{
>>if (em.getTransaction().isActive())
>>{
>>em.getTransaction().rollback();
>>}
>>}
>>}
>>finally
>>{
>>em.close();
>>}
>>
>>return search;
>>}
>>
>>//getters and setters
>>//...
>> }
>>
>> --
>>
>> 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] Simple one to many problem!!!

2009-12-30 Thread Max Ross (Google)
I'd recommend basing your code on the example here to get something working:
http://gae-java-persistence.blogspot.com/2009/10/creating-bidrectional-owned-one-to-many.html

Then you can start tweaking.

Max

On Wed, Dec 30, 2009 at 3:02 PM, markm208  wrote:

> I am thoroughly confused… I am trying to set up a simple one to many
> relationship using JPA, I think that this should work but instead I
> get the error "Primary key for object of type Member is null." Any
> help would be greatly appreciated.
>
> @Entity(name = "Member")
> public class Member
> {
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>private Key id;
>
>@Basic //datastore specific type
>private Email memberEmail;
>private String memberPassword;
>private String memberFirstName;
>private String memberLastName;
>@Basic //blob of text not searchable
>private Text memberDescription;
>
>//Member 'owns' the Searches
>@OneToMany(mappedBy = "memberWhoCreated", cascade=CascadeType.ALL)
>private List < Search > searches = new ArrayList < Search >();
>
>//getters and setters
>//...
> }
>
> @Entity(name = "Search")
> public class Search
> {
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>private Key id;
>
>private List < String > searchStrings;
>private boolean allowOthersToSee;
>@Basic //datastore specific type
>private Text contextOfSearch;
>
>@ManyToOne(fetch = FetchType.LAZY)
>private Member memberWhoCreated;
>
>public static Search createASearch(boolean allowOthersToSee, String
> context, Member member)
>{
>Search search = null;
>
>EntityManager em = null;
>try
>{
>//get the entity manager
>em = EMF.get().createEntityManager();
>
>//create the search from the form variables
>search = new Search();
>search.setAllowOthersToSee(allowOthersToSee);
>search.setContextOfSearch(new Text(context));
>search.setMemberWhoCreated(member);
>
>em.getTransaction().begin();
>try
>{
>
>//store the member
>em.persist(search);
>em.getTransaction().commit();
>}
>finally
>{
>if (em.getTransaction().isActive())
>{
>em.getTransaction().rollback();
>}
>}
>}
>finally
>{
>em.close();
>}
>
>return search;
>}
>
>//getters and setters
>//...
> }
>
> --
>
> 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] JDO/JPA Snippets That Work - More compact @PersistenceCapable declarations

2009-12-30 Thread Max Ross (Google)
http://gae-java-persistence.blogspot.com/2009/12/more-compact-persistencecapable.html

--

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




Re: [appengine-java] StackOverFlowError on JPA Remove() with @OneToMany and abstract base classes.

2009-12-24 Thread Max Ross (Google)
Turns out this is a DataNuc issue so I've filed
http://www.datanucleus.org/servlet/jira/browse/NUCCORE-435.

On Wed, Dec 23, 2009 at 1:28 PM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> Workaround posted to the bug.  Thanks!
>
>
> On Sun, Dec 20, 2009 at 6:22 AM, David Fuelling wrote:
>
>> I'm pretty sure my issue is a bug, but upon further reflection I
>> figured I'd bring it to light here in the discussion groups just to be
>> sure.
>>
>> Here's the issue, with test code:
>> http://code.google.com/p/googleappengine/issues/detail?id=2541
>>
>> Basically, I'm trying to model a User entity that has more than 5,000
>> "tags" (Strings).  Since the GAE datastore can't store more
>> than 5,000 strings in a List attribute, I'm following the design
>> pattern outlined in this Google Tech Talk (basically, have the
>> User entity hold a List of Entity's, each of which hold a
>> List.  The 5000+1 string gets put into the 2nd
>> TagReferenceEntity in the User):
>>
>> http://sites.google.com/site/io/building-scalable-web-applications-with-google-app-engine
>>
>> I'm using JPA to implement this setup, and everything works except for
>> delete operations.  The google-code issue contains a stack-trace and
>> an attached .zip file with code to reproduce the problem (main error
>> is java.lang.StackOverflowError).
>>
>> Thanks!
>>
>> david
>>
>> --
>>
>> 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] StackOverFlowError on JPA Remove() with @OneToMany and abstract base classes.

2009-12-23 Thread Max Ross (Google)
Workaround posted to the bug.  Thanks!

On Sun, Dec 20, 2009 at 6:22 AM, David Fuelling  wrote:

> I'm pretty sure my issue is a bug, but upon further reflection I
> figured I'd bring it to light here in the discussion groups just to be
> sure.
>
> Here's the issue, with test code:
> http://code.google.com/p/googleappengine/issues/detail?id=2541
>
> Basically, I'm trying to model a User entity that has more than 5,000
> "tags" (Strings).  Since the GAE datastore can't store more
> than 5,000 strings in a List attribute, I'm following the design
> pattern outlined in this Google Tech Talk (basically, have the
> User entity hold a List of Entity's, each of which hold a
> List.  The 5000+1 string gets put into the 2nd
> TagReferenceEntity in the User):
>
> http://sites.google.com/site/io/building-scalable-web-applications-with-google-app-engine
>
> I'm using JPA to implement this setup, and everything works except for
> delete operations.  The google-code issue contains a stack-trace and
> an attached .zip file with code to reproduce the problem (main error
> is java.lang.StackOverflowError).
>
> Thanks!
>
> david
>
> --
>
> 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] Unindexed property

2009-12-23 Thread Max Ross (Google)
Looks like you're using the JPA Extension annotation.  If you're using JDO,
use javax.jdo.annotations.Extension.

On Wed, Dec 23, 2009 at 8:50 AM, Peter Ondruska wrote:

> I have set few properties unindexed like this:
>
>@Persistent
>@Extension(vendorName = "datanucleus", key = "gae.unindexed", value
> =
> "true")
>private Float amount = 1.0f;
>
> But I get this exception:
>
> org.datanucleus.jdo.metadata.JDOAnnotationReader
> processMemberAnnotations: Class/Field "amount" has an annotation
> "org.datanucleus.jpa.annotations.Extension" which was not processed.
>
> Is it OK and shall I adjust logging:
>
> DataNucleus.jdo.metadata.JDOAnnotationReader.level=OFF
>
> Or is there any other/better way? Am I not going to miss other
> exceptions in JDOAnnotationReader?
>
> Peter
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

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: IdGeneratorStrategy.SEQUENCE

2009-12-22 Thread Max Ross (Google)
Unfortunately there's nothing you can do right now to get JDO to give you a
monotonically increasing sequence.  The App Engine's JDO implementation is
based on the features of the datastore, and since the datastore does not
support monotonically increasing sequences the JDO implementation does not
either.  You could implement this yourself on top of the datastore and then
write your own JDO sequence provider, but you're going to end up doing an
extra round-trip to the datastore for every write that needs a sequence
value.  This performance/cpu hit may be acceptable for your app or it may
not.  My advice would be to try to make do without a monotonically
increasing sequence, but if you need it you need it.

Max

On Mon, Dec 21, 2009 at 11:26 PM, Philip Tucker  wrote:

> Hmm, I thought I'd read that in the DataNucleus documentation, but I
> can't find any clear definition of it.  I must have just assumed
> sequences were sequential.
>
> Borrowing from your example here (http://code.google.com/p/datanucleus-
> appengine/source/browse/trunk/tests/org/datanucleus/test/<http://code.google.com/p/datanucleus-%0Aappengine/source/browse/trunk/tests/org/datanucleus/test/>
> SequenceExamplesJDO.java), it seems if I specify a named sequence and
> set SequenceStrategy.CONTIGUOUS (NONCONTIGUOUS might work too, I'm
> guessing !TRANSACTIONAL is the key) that I get a monotonically
> increasing sequence. Does that seem right?
>
> Thanks for the input,
> Philip
>
> On Dec 21, 2:46 pm, "Max Ross (Google)" 
> 
> >
> wrote:
> > Where are you reading the definition of the contract?
> >
> >
> >
> > On Mon, Dec 21, 2009 at 2:41 PM, Philip Tucker 
> wrote:
> > > Thanks!
> >
> > > Unless I'm misreading the documentation for SEQUENCE, that breaks the
> > > contract of the JDP annotation API, doesn't it?
> >
> > > Is there a way to annotate a field as a true sequence, or do I need to
> > > create my own sequence and assign the value myself?
> >
> > > On Dec 21, 9:29 am, "Max Ross (Google)" 
> > > 
> >
> >
> > > wrote:
> > > > Hi Philip,
> >
> > > > IdGeneratorStrategy.SEQUENCE support is implemented on top of
> > > > DatastoreService.allocateIds(), which is itself the mechanism that
> the
> > > > datastore uses internally to assign ids.  So, all properties of
> datastore
> > > id
> > > > allocation apply to SEQUENCE.  There is a lot of good information
> about
> > > > these properties in this thread:
> > >http://groups.google.com/group/google-appengine/browse_thread/thread/.
> ..
> >
> > > > But in short, sequences are guaranteed to be unique but not
> monotically
> > > > increasing.
> >
> > > > Hope this helps,
> > > > Max
> >
> > > > On Mon, Dec 21, 2009 at 12:04 AM, Philip Tucker 
> > > wrote:
> > > > > I'm using IdGeneratorStrategy.SEQUENCE for the primary key of a
> table,
> > > > > but it appears AppEngine bounces between 2 different sequence
> > > > > generators as I create new entries. IDs are unique, but not
> > > > > monotonically increasing. It's possible I've coded something wrong,
> > > > > but I'm oretty sure this is a bug.
> >
> > > > > --
> >
> > > > > 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> > > 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 unsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

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




Re: [appengine-java] Re: Any advantages on using the Key type instead of String or Long for PK

2009-12-22 Thread Max Ross (Google)
Please note that you can still query a Key primary key using comparison, you
just can't do it the exact way you've written your example:

pm.newQuery("select from Person where key >= :p").execute(person.getKey());


On Tue, Dec 22, 2009 at 6:30 AM, Michael Chan  wrote:

> Thanks a lot!
>
>
> On 22 Dec 2009, at 14:16, datanucleus wrote:
>
> >> Is that mean that using a String type is not a bad thing to do?
> >
> > From a pure persistence point of view, using a portable type (Long,
> > String etc) makes total sense, since your classes aren't tied to GAE.
> > Obviously Google may have some hidden functionality in their Key but
> > thats for them to comment on
> >
> > --
> >
> > 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.
>
>
>

--

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: IdGeneratorStrategy.SEQUENCE

2009-12-21 Thread Max Ross (Google)
Where are you reading the definition of the contract?

On Mon, Dec 21, 2009 at 2:41 PM, Philip Tucker  wrote:

> Thanks!
>
> Unless I'm misreading the documentation for SEQUENCE, that breaks the
> contract of the JDP annotation API, doesn't it?
>
> Is there a way to annotate a field as a true sequence, or do I need to
> create my own sequence and assign the value myself?
>
> On Dec 21, 9:29 am, "Max Ross (Google)" 
> 
> >
> wrote:
> > Hi Philip,
> >
> > IdGeneratorStrategy.SEQUENCE support is implemented on top of
> > DatastoreService.allocateIds(), which is itself the mechanism that the
> > datastore uses internally to assign ids.  So, all properties of datastore
> id
> > allocation apply to SEQUENCE.  There is a lot of good information about
> > these properties in this thread:
> http://groups.google.com/group/google-appengine/browse_thread/thread/...
> >
> > But in short, sequences are guaranteed to be unique but not monotically
> > increasing.
> >
> > Hope this helps,
> > Max
> >
> >
> >
> > On Mon, Dec 21, 2009 at 12:04 AM, Philip Tucker 
> wrote:
> > > I'm using IdGeneratorStrategy.SEQUENCE for the primary key of a table,
> > > but it appears AppEngine bounces between 2 different sequence
> > > generators as I create new entries. IDs are unique, but not
> > > monotonically increasing. It's possible I've coded something wrong,
> > > but I'm oretty sure this is a bug.
> >
> > > --
> >
> > > 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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




Re: [appengine-java] IdGeneratorStrategy.SEQUENCE

2009-12-21 Thread Max Ross (Google)
Hi Philip,

IdGeneratorStrategy.SEQUENCE support is implemented on top of
DatastoreService.allocateIds(), which is itself the mechanism that the
datastore uses internally to assign ids.  So, all properties of datastore id
allocation apply to SEQUENCE.  There is a lot of good information about
these properties in this thread:
http://groups.google.com/group/google-appengine/browse_thread/thread/dec83c2dbd9542e4

But in short, sequences are guaranteed to be unique but not monotically
increasing.

Hope this helps,
Max

On Mon, Dec 21, 2009 at 12:04 AM, Philip Tucker  wrote:

> I'm using IdGeneratorStrategy.SEQUENCE for the primary key of a table,
> but it appears AppEngine bounces between 2 different sequence
> generators as I create new entries. IDs are unique, but not
> monotonically increasing. It's possible I've coded something wrong,
> but I'm oretty sure this is a bug.
>
> --
>
> 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] preparedQuery.asQueryResultList and Cursor

2009-12-17 Thread Max Ross (Google)
Hi Laco,

We're actively working on the Cursors feature but it's not finished yet.
The api for this feature went out in the latest SDK but the backend changes
did not, which explains the exceptions you're seeing.  Cursors will be
available in our next release, due out early next year.

Thanks,
Max

On Thu, Dec 17, 2009 at 5:55 AM, Laco Skokan  wrote:

> Hello,
>
> I am trying to use Cursors for pagination and it does not seems to
> work on local sdk 1.3.0. It fails on this row:
>
> cursor = preparedQuery.asQueryResultList(withLimit(10)).getCursor()
>
> error:
> groovy.lang.MissingMethodException: No signature of method:
> com.google.appengine.api.datastore.DatastoreServiceImpl
> $PreparedQueryImpl.asQueryResultList() is applicable for argument
> types: (com.google.appengine.api.datastore.FetchOptions) values:
> [com.google.appengine.api.datastore.fetchopti...@a00fd]
>
> Interesting is, that  the error is different on the online version for
> the engine. There is no error, just the cursor is null.
>
> Any idea?
> Ladislav.
>
> --
>
> 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] One to many with JPA

2009-12-16 Thread Max Ross (Google)
I'd recommend reading this blog post - it contains everything you need to
know to persist a one-to-many with JPA:

http://gae-java-persistence.blogspot.com/2009/10/creating-bidrectional-owned-one-to-many.html

Max

On Wed, Dec 16, 2009 at 2:21 PM, Richard  wrote:

> Hi guys,
>
>  I try to persist a one to many relationship but I get the following
> error (It's my first app):
>
> Caused by: java.lang.IllegalStateException: Field
> "fr.beasymptotic.bookmark.client.model.BookmarkUser.bookmarks"
> contains a persistable object that isnt persistent, but the field
> doesnt allow cascade-persist!
>
>
> What's wrong here :
>
> @Entity
> public class Bookmark implements Serializable {
>/**
> *
> */
>private static final long serialVersionUID =
> -5148690849535943792L;
>
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>@Extension(vendorName="datanucleus", key="gae.encoded-pk",
> value="true")
>private String id;
>
>@Basic
>private String link;
>@Basic
>private String shortName;
>
> ...
>
> }
>
>
>
> @Entity
> public class BookmarkUser implements Serializable {
>/**
> *
> */
>private static final long serialVersionUID =
> -4970721952298475845L;
>
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>private Long id;
>
>@Basic
>private String userUIDFromGoogle;
>
>@Basic
>private List bookmarks;
> ...
>
> }
>
> Thanks,
> Richard
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

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




Re: [appengine-java] Re: TaskQueue and null host name

2009-12-16 Thread Max Ross (Google)
Yup, it's a bug.  Would you mind filing it in the issue tracker?  I'll get
it sorted out for the next release.

Thanks,
Max

On Wed, Dec 16, 2009 at 9:34 AM, Max Ross (Google) <
maxr+appeng...@google.com > wrote:

> Interesting, let me take a look.
>
>
> On Tue, Dec 15, 2009 at 6:47 PM, Millisecond wrote:
>
>> It's in a normal doGet method of a servlet.
>>
>> Re-enabled it to double-check that I was failing on the version in
>> doGet (originally I had it in an init() method) and ran into something
>> that may be the cause.
>>
>> If I request the servlet from http://localhost:8080/ it fails, the
>> same servlet also responds to http://localhost:8080/Index and there it
>> works fine.
>>
>> I can't see anything in my code making it fail from the "bare" URL,
>> but there is a fair amount going on in that servlet.  I was just doing
>> it there for expediency while testing, can't see any good reason to
>> enqueue something from / anyway so should be fine.
>>
>> Thanks,
>> -C
>>
>>
>>
>> On Dec 15, 6:26 pm, "Max Ross (Google)" 
>> 
>> >
>> wrote:
>> > Where is your code that adds the task to the queue?  Is it being run
>> during
>> > server initializaiton, perhaps as part of a static block or a
>> LoadOnStartup
>> > servlet?
>> >
>> > Thanks,
>> > Max
>> >
>> > On Tue, Dec 15, 2009 at 8:27 AM, Millisecond 
>> wrote:
>> > > Hello,
>> >
>> > > I'm just testing out super basic TaskQueue stuff in the dev
>> > > environment and running into an exception I just can't seem to shake.
>> >
>> > > Code:
>> >
>> > > Queue queue = QueueFactory.getQueue("mail-queue");
>> > > queue.add(url("/api/RunMonitor"));
>> >
>> > > Exception:
>> >
>> > > java.lang.IllegalArgumentException: Host name may not be null
>> > >at org.apache.commons.httpclient.HttpHost.(Unknown
>> Source)
>> > >at org.apache.commons.httpclient.HttpHost.(Unknown
>> Source)
>> > >at org.apache.commons.httpclient.HttpMethodBase.setURI(Unknown
>> > > Source)
>> > >at org.apache.commons.httpclient.HttpMethodBase.(Unknown
>> > > Source)
>> > >at
>> org.apache.commons.httpclient.methods.ExpectContinueMethod.
>> > > (Unknown Source)
>> > >at
>> > > org.apache.commons.httpclient.methods.EntityEnclosingMethod.
>> > > (Unknown Source)
>> > >at
>> org.apache.commons.httpclient.methods.PostMethod.(Unknown
>> > > Source)
>> > >at com.google.appengine.api.urlfetch.dev.LocalURLFetchService
>> > > $RedirectablePostMethod.(LocalURLFetchService.java:348)
>> > >at com.google.appengine.api.urlfetch.dev.LocalURLFetchService
>> > > $4.buildMethod(LocalURLFetchService.java:95)
>> >
>> > > I've tried this about half a dozen ways, starting with different --
>> > > address parameters thinking something wasn't picking up right on the
>> > > default 0.0.0.0 argument and on 1.2.8 and 1.3 versions.
>> >
>> > > The same code works fine if I publish to to production and run it
>> > > there.
>> >
>> > > My environment:
>> > > -OSX
>> > > -IntelliJ w/plugin
>> > > -JDK1.6
>> >
>> > > Thanks!
>> > > -Millisecond
>> >
>> > > --
>> >
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > > "Google App Engine for Java" group.
>> > > To post to this group, send email to
>> > > google-appengine-j...@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > google-appengine-java+unsubscr...@googlegroups.com
>> 
>> >
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/google-appengine-java?hl=en.
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To post to this group, send email to
>> google-appengine-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>>
>>
>>
>

--

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




Re: [appengine-java] Re: TaskQueue and null host name

2009-12-16 Thread Max Ross (Google)
Interesting, let me take a look.

On Tue, Dec 15, 2009 at 6:47 PM, Millisecond  wrote:

> It's in a normal doGet method of a servlet.
>
> Re-enabled it to double-check that I was failing on the version in
> doGet (originally I had it in an init() method) and ran into something
> that may be the cause.
>
> If I request the servlet from http://localhost:8080/ it fails, the
> same servlet also responds to http://localhost:8080/Index and there it
> works fine.
>
> I can't see anything in my code making it fail from the "bare" URL,
> but there is a fair amount going on in that servlet.  I was just doing
> it there for expediency while testing, can't see any good reason to
> enqueue something from / anyway so should be fine.
>
> Thanks,
> -C
>
>
>
> On Dec 15, 6:26 pm, "Max Ross (Google)" 
> 
> >
> wrote:
> > Where is your code that adds the task to the queue?  Is it being run
> during
> > server initializaiton, perhaps as part of a static block or a
> LoadOnStartup
> > servlet?
> >
> > Thanks,
> > Max
> >
> > On Tue, Dec 15, 2009 at 8:27 AM, Millisecond 
> wrote:
> > > Hello,
> >
> > > I'm just testing out super basic TaskQueue stuff in the dev
> > > environment and running into an exception I just can't seem to shake.
> >
> > > Code:
> >
> > > Queue queue = QueueFactory.getQueue("mail-queue");
> > > queue.add(url("/api/RunMonitor"));
> >
> > > Exception:
> >
> > > java.lang.IllegalArgumentException: Host name may not be null
> > >at org.apache.commons.httpclient.HttpHost.(Unknown Source)
> > >at org.apache.commons.httpclient.HttpHost.(Unknown Source)
> > >at org.apache.commons.httpclient.HttpMethodBase.setURI(Unknown
> > > Source)
> > >at org.apache.commons.httpclient.HttpMethodBase.(Unknown
> > > Source)
> > >at
> org.apache.commons.httpclient.methods.ExpectContinueMethod.
> > > (Unknown Source)
> > >at
> > > org.apache.commons.httpclient.methods.EntityEnclosingMethod.
> > > (Unknown Source)
> > >at
> org.apache.commons.httpclient.methods.PostMethod.(Unknown
> > > Source)
> > >at com.google.appengine.api.urlfetch.dev.LocalURLFetchService
> > > $RedirectablePostMethod.(LocalURLFetchService.java:348)
> > >at com.google.appengine.api.urlfetch.dev.LocalURLFetchService
> > > $4.buildMethod(LocalURLFetchService.java:95)
> >
> > > I've tried this about half a dozen ways, starting with different --
> > > address parameters thinking something wasn't picking up right on the
> > > default 0.0.0.0 argument and on 1.2.8 and 1.3 versions.
> >
> > > The same code works fine if I publish to to production and run it
> > > there.
> >
> > > My environment:
> > > -OSX
> > > -IntelliJ w/plugin
> > > -JDK1.6
> >
> > > Thanks!
> > > -Millisecond
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google App Engine for Java" group.
> > > To post to this group, send email to
> > > google-appengine-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-appengine-java+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>

--

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




Re: [appengine-java] com.google.appengine.api.datastore.Text with JPA

2009-12-16 Thread Max Ross (Google)
Try adding @Basic.  More info here:
http://code.google.com/appengine/docs/java/datastore/usingjpa.html#Class_and_Field_Annotations

On Tue, Dec 15, 2009 at 11:55 PM, Compi  wrote:

> Hey Everyone,
>
> I can't seem to get this working.  How do you save and read
> com.google.appengine.api.datastore.Text in google appengine with JPA,
> NOT JDO!!
>
> I have a simple POJO (Simplified example):
>
> import javax.persistence.Entity;
> import javax.persistence.GeneratedValue;
> import javax.persistence.GenerationType;
> import javax.persistence.Id;
>
> import com.google.appengine.api.datastore.Text;
>
> @Entity
> public class NewsItem implements Serializable {
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>private Long id;
>private Text content;
>private Date created;
>private String title;
>private String user;
>
>public NewsItem(Text content, Date created, String title, String
> user) {
>super();
>this.content = content;
>this.created = created;
>this.title = title;
>this.user = user;
>}
>
>public Text getContent() {
>return content;
>}
>
>public void setContent(Text content) {
>this.content = content;
>}
> }
>
>
> Which I save in my dao:
>
> @Repository("newsItemDao")
> @Transactional
> public class NewsItemDao implements Dao {
>private EntityManager entityManager = EMF.getEntityManager();
>
>
>@Override
>public void save(NewsItem entity) {
>EntityTransaction tx = entityManager.getTransaction();
>tx.begin();
>entityManager.persist(entity);
>entityManager.flush();
>clearCache();
>tx.commit();
>}
> }
>
>
>
> But in my dashboard I can't find the content, so I think it's not
> saved, and so I can't retrieve it.
>
> Can someone help me.
>
> Thx
> Compi
>
> --
>
> 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] TaskQueue and null host name

2009-12-15 Thread Max Ross (Google)
Where is your code that adds the task to the queue?  Is it being run during
server initializaiton, perhaps as part of a static block or a LoadOnStartup
servlet?

Thanks,
Max

On Tue, Dec 15, 2009 at 8:27 AM, Millisecond  wrote:

> Hello,
>
> I'm just testing out super basic TaskQueue stuff in the dev
> environment and running into an exception I just can't seem to shake.
>
> Code:
>
> Queue queue = QueueFactory.getQueue("mail-queue");
> queue.add(url("/api/RunMonitor"));
>
> Exception:
>
> java.lang.IllegalArgumentException: Host name may not be null
>at org.apache.commons.httpclient.HttpHost.(Unknown Source)
>at org.apache.commons.httpclient.HttpHost.(Unknown Source)
>at org.apache.commons.httpclient.HttpMethodBase.setURI(Unknown
> Source)
>at org.apache.commons.httpclient.HttpMethodBase.(Unknown
> Source)
>at org.apache.commons.httpclient.methods.ExpectContinueMethod.
> (Unknown Source)
>at
> org.apache.commons.httpclient.methods.EntityEnclosingMethod.
> (Unknown Source)
>at org.apache.commons.httpclient.methods.PostMethod.(Unknown
> Source)
>at com.google.appengine.api.urlfetch.dev.LocalURLFetchService
> $RedirectablePostMethod.(LocalURLFetchService.java:348)
>at com.google.appengine.api.urlfetch.dev.LocalURLFetchService
> $4.buildMethod(LocalURLFetchService.java:95)
>
> I've tried this about half a dozen ways, starting with different --
> address parameters thinking something wasn't picking up right on the
> default 0.0.0.0 argument and on 1.2.8 and 1.3 versions.
>
> The same code works fine if I publish to to production and run it
> there.
>
> My environment:
> -OSX
> -IntelliJ w/plugin
> -JDK1.6
>
> Thanks!
> -Millisecond
>
> --
>
> 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.




  1   2   >