[appengine-java] Re: How-to debug JSP stack dump on GAE production

2010-04-03 Thread James H
I confirmed that the line number reported in a JSP stack dump from
production will NOT match that reported in the test environment.  The
generated java memberHome_jsp.java located in the test environment is
NOT the same source as used for production.  Hence, the line number is
of NO use unless we are given the source used by production deploy
process.

HOW DO WE ACCESS the generated Java for JSPs created during the deploy
process so that we can trouble-shoot stack dumps containing source
code line numbers?

On Apr 2, 11:01 pm, James H  wrote:
> This trace below is from production environment.  How do I find the
> memberHome_jsp.java so I can verify the problem at line 165?  I found
> the .java file used for running locally, but this line# in question
> was inappropriate in regard to causing a null issue...so I must be
> looking at the wrong .java in the case of production dumps.  Thanks, J
>
> Programming Details - java.lang.NullPointerException
> at org.apache.jsp.app2.memberHome_jsp._jspService(memberHome_jsp.java:
> 165)
> 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:
> 511)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
> 390)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
> 216)

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



[appengine-java] How-to debug JSP stack dump on GAE production

2010-04-02 Thread James H
This trace below is from production environment.  How do I find the
memberHome_jsp.java so I can verify the problem at line 165?  I found
the .java file used for running locally, but this line# in question
was inappropriate in regard to causing a null issue...so I must be
looking at the wrong .java in the case of production dumps.  Thanks, J

Programming Details - java.lang.NullPointerException
at org.apache.jsp.app2.memberHome_jsp._jspService(memberHome_jsp.java:
165)
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:
511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
390)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email 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] GWT + GAE Performance

2009-12-18 Thread James H
I began using GAE for a project earlier this year and am aware of the
throughput documented in the GAE docs and this forum.  Now, I am
considering using GWT as the front-end to my GAE application.

Can anyone share their experience in regard to performance when using
GWT with GAE?  For example, does GWT introduce alot of overhead as
compared to a Struts/JSP solution?

Can anyone share their experience in regard to CPU Quota usage when
using GWT with GAE?  Or any other resource quota related?

Given a 1000 or 10,000 simultaneous users, what would their response
time be like when comparing GWT vs Struts/JSP both on GAE?  I need GWT
on GAE to support the potential for a very large number of
simultaneous users.

Thanks, J

--

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




[appengine-java] Datastore Quota

2009-12-15 Thread James H
Is space consumed by datastore for secondary and tertiary backups of
production Entities reflected in the quota for billing purposes?  Or,
is only the spaced used for the primary Entities used for billing?

In other words, are we charged for 1 copy of the data or 3 copies?

Thanks, J

--

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




[appengine-java] Re: Photo and Video services

2009-12-07 Thread James H
Excellent, look forward to trying it out!

On Dec 3, 4:35 pm, Vince Bonfanti  wrote:
> I just committed the code to add support for the If-Modified-Since request
> header (and the Last-Modified and Content-Length response headers). It'll be
> in the next GaeVFS release, which will happen after SDK 1.2.8 is released to
> production.
>
> BTW, the way this works is that the client simply takes the value from the
> Last-Modified response header and sends it back as the If-Modified-Since
> request header, so there's no need to worry about synchronization between
> client time and server time. I tested on Chrome, IE8, and Firefox (all on
> Windows).
>
> Thanks for the info.
>
> Vince
>
> On Fri, Nov 27, 2009 at 12:56 PM, James H wrote:
>
>
>
> > Here's some legwork...you can drill-down to section 14.25 of the page
> > below where it describes the If-Modified-Since header.  Basically, any
> > Get with this header including a timestamp can be compared to the
> > timestamp for the matching Entity to determine whether to respond
> > normally (return the image) or respond with a 304 (Not modified)
> > response.  I think the trick is determining the compare granualarity
> > since the server time and the client time are never exactly in sync.
> > Perhaps the granularity for comparison should be down to the minute,
> > not seconds and definitely not millisecond.  What do you think?
>
> >http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html
>
> > On Oct 23, 10:08 am, Vince Bonfanti  wrote:
> > > No, not yet. It's on the TODO list (see line 171 of the GaeVfsServlet
> > > source code). If you--or anyone else--wants to add this I'll be happy
> > > to accept a patch.
>
> > > Vince
>
> > > On Fri, Oct 23, 2009 at 11:42 AM, Diana Cruise 
> > wrote:
>
> > > > In terms of performance does gaevfs accmmodate http resource timestamp
> > > > checks to avoid re-downloading repeated requests for the same images?-
> > Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

--

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




[appengine-java] Re: task queue once-only semantics

2009-12-02 Thread James H
Great!  We'll talk more when I start using it shortly.

On Dec 2, 8:25 am, Vince Bonfanti  wrote:
> Yes, I received your patch and it's on my TODO list to review it and add it
> to the code. Unfortunately, I've been a bit backed up with other projects.
> I'm trying to get a new version of GaeVFS ready for release in the next few
> weeks and will try to include your patch.
>
> Vince
>
>
>
> On Wed, Dec 2, 2009 at 12:08 AM, James H  wrote:
> > Ah, short execution time and bullet-proof re-runs...I see how memcache
> > would work in this case.  On another topic, I recall you wrote
> > GaeVFS...I recently added a comment related to a patch for checking
> > file timestamp to avoid redundant downloads.  On the surface it
> > appears straight forward...if the http header was supplied then just
> > compare with the Entity's timestamp and you're done.  Is it really
> > that simple?  Are you or someone else familiar with the code
> > considering adding this check?- Hide quoted text -
>
> - Show quoted text -

--

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




[appengine-java] Re: task queue once-only semantics

2009-12-01 Thread James H
Ah, short execution time and bullet-proof re-runs...I see how memcache
would work in this case.  On another topic, I recall you wrote
GaeVFS...I recently added a comment related to a patch for checking
file timestamp to avoid redundant downloads.  On the surface it
appears straight forward...if the http header was supplied then just
compare with the Entity's timestamp and you're done.  Is it really
that simple?  Are you or someone else familiar with the code
considering adding this check?

On Dec 1, 4:34 pm, Vince Bonfanti  wrote:
> Yes, obviously I can't use task names because of the 7-day expiration; I
> just happened to be testing something else on the dev server when I noticed
> that it behaved the way I wanted.
>
> In my case the unreliability of memcache isn't too much of a concern for two
> reasons. First, I expect the tasks be executed relatively quickly--within a
> few hundred milliseconds--and hopefully memcache can be relied upon for at
> least that long. Second, there's no real harm if my tasks get executed more
> than once.
>
> I just opened a new issue on this, if you want to go star it:
>
>  http://code.google.com/p/googleappengine/issues/detail?id=2459
>
> Vince
>
>
>
> On Tue, Dec 1, 2009 at 5:24 PM, James H  wrote:
> > Sorry, I was writing my 2nd reply prior to seeing yours...but I mean't
> > don't specify a Task Name in order to free yourself from the
> > rediculous 7-day rule (what good is that?).  So really since memcache
> > is not a good choice for sensitive mutable data such as a mutex, you'd
> > have to implement your own as I suggested.  I'll be curious to hear
> > other alternatives since this would be a common requirement in apps!
>
> > On Dec 1, 4:17 pm, James H  wrote:
> > > Also, the nature of memcache is such that it would not be reliable for
> > > a mutex (since objects can be removed by the system at any time
> > > regardless if Task N is running), hence the potential for duplicate
> > > task entries.
>
> > > On Dec 1, 4:08 pm, James H  wrote:
>
> > > > Vince, shouldn't you use an un-named Task queue (to avoid Naming rules
> > > > mentioned) but query your own datastore semaphore prior to adding to
> > > > the queue.  This way when task N runs it manages the semaphore (a
> > > > Entity) to implement a mutex begin/end sequence.  I believe this
> > > > implies that task N will in fact run 3 transactions: #1 - mutex begin
> > > > (create Entity), #2 - work for N, and #3 - mutex end (remove Entity).
>
> > > > Anyhow assuming your logic to trigger a new Task N can incorporate the
> > > > criteria for mutex exists, then what would keep this from working?
>
> > > > On Dec 1, 2:37 pm, Vince Bonfanti  wrote:
>
> > > > > BTW, I've noticed that the dev server actually behaves the way I
> > would like
> > > > > it to. It only throws a "Task name already exists" exception while
> > the task
> > > > > is queued; as soon as the task runs it allows you to queue up another
> > task
> > > > > with the same name.
>
> > > > > I guess I'll just open a feature request on this in the issue
> > tracker.
>
> > > > > Vince
>
> > > > > On Tue, Dec 1, 2009 at 11:39 AM, Vince Bonfanti 
> > wrote:
> > > > > > I'm trying to solve the following problem using task queues:
>
> > > > > >   1. Queue a task to perform some action "N".
> > > > > >   2. Until action N has been performed, don't allow any other tasks
> > to be
> > > > > > queued that also perform action N.
> > > > > >   3. As soon as action N has been performed, immediately allow
> > other tasks
> > > > > > to be queued to perform action N (repeat from step 1).
>
> > > > > > Using task names almost accomplishes what I need, except that at
> > step 3 it
> > > > > > will be at least seven days before another task can be queued to
> > perform
> > > > > > action N, when I need it to be allowed immediately:
>
> > > > > >   "This (task names) provides a lightweight mechanism for ensuring
> > > > > > once-only semantics. Once a Task with name N is written, any
> > subsequent
> > > > > > attempts to insert a Task named N will fail. Eventually (at least
> > seven days
> > > > > > after the task successfully executes), the task will be deleted and
> > the name
> 

[appengine-java] Re: task queue once-only semantics

2009-12-01 Thread James H
Sorry, I was writing my 2nd reply prior to seeing yours...but I mean't
don't specify a Task Name in order to free yourself from the
rediculous 7-day rule (what good is that?).  So really since memcache
is not a good choice for sensitive mutable data such as a mutex, you'd
have to implement your own as I suggested.  I'll be curious to hear
other alternatives since this would be a common requirement in apps!

On Dec 1, 4:17 pm, James H  wrote:
> Also, the nature of memcache is such that it would not be reliable for
> a mutex (since objects can be removed by the system at any time
> regardless if Task N is running), hence the potential for duplicate
> task entries.
>
> On Dec 1, 4:08 pm, James H  wrote:
>
>
>
> > Vince, shouldn't you use an un-named Task queue (to avoid Naming rules
> > mentioned) but query your own datastore semaphore prior to adding to
> > the queue.  This way when task N runs it manages the semaphore (a
> > Entity) to implement a mutex begin/end sequence.  I believe this
> > implies that task N will in fact run 3 transactions: #1 - mutex begin
> > (create Entity), #2 - work for N, and #3 - mutex end (remove Entity).
>
> > Anyhow assuming your logic to trigger a new Task N can incorporate the
> > criteria for mutex exists, then what would keep this from working?
>
> > On Dec 1, 2:37 pm, Vince Bonfanti  wrote:
>
> > > BTW, I've noticed that the dev server actually behaves the way I would 
> > > like
> > > it to. It only throws a "Task name already exists" exception while the 
> > > task
> > > is queued; as soon as the task runs it allows you to queue up another task
> > > with the same name.
>
> > > I guess I'll just open a feature request on this in the issue tracker.
>
> > > Vince
>
> > > On Tue, Dec 1, 2009 at 11:39 AM, Vince Bonfanti  
> > > wrote:
> > > > I'm trying to solve the following problem using task queues:
>
> > > >   1. Queue a task to perform some action "N".
> > > >   2. Until action N has been performed, don't allow any other tasks to 
> > > > be
> > > > queued that also perform action N.
> > > >   3. As soon as action N has been performed, immediately allow other 
> > > > tasks
> > > > to be queued to perform action N (repeat from step 1).
>
> > > > Using task names almost accomplishes what I need, except that at step 3 
> > > > it
> > > > will be at least seven days before another task can be queued to perform
> > > > action N, when I need it to be allowed immediately:
>
> > > >   "This (task names) provides a lightweight mechanism for ensuring
> > > > once-only semantics. Once a Task with name N is written, any subsequent
> > > > attempts to insert a Task named N will fail. Eventually (at least seven 
> > > > days
> > > > after the task successfully executes), the task will be deleted and the 
> > > > name
> > > > N can be reused."
>
> > > > I've thought of different ways to solve this, most likely by using a
> > > > memcache flag as a semaphore. But, it would be nice if the task queue 
> > > > API
> > > > could support this natively, maybe by adding a "reuse time" or 
> > > > "exclusion
> > > > time" parameter when setting the TaskOptions name parameter.
>
> > > > Any thoughts on this?
>
> > > > Vince- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

--

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




[appengine-java] Re: task queue once-only semantics

2009-12-01 Thread James H
Also, the nature of memcache is such that it would not be reliable for
a mutex (since objects can be removed by the system at any time
regardless if Task N is running), hence the potential for duplicate
task entries.

On Dec 1, 4:08 pm, James H  wrote:
> Vince, shouldn't you use an un-named Task queue (to avoid Naming rules
> mentioned) but query your own datastore semaphore prior to adding to
> the queue.  This way when task N runs it manages the semaphore (a
> Entity) to implement a mutex begin/end sequence.  I believe this
> implies that task N will in fact run 3 transactions: #1 - mutex begin
> (create Entity), #2 - work for N, and #3 - mutex end (remove Entity).
>
> Anyhow assuming your logic to trigger a new Task N can incorporate the
> criteria for mutex exists, then what would keep this from working?
>
> On Dec 1, 2:37 pm, Vince Bonfanti  wrote:
>
>
>
> > BTW, I've noticed that the dev server actually behaves the way I would like
> > it to. It only throws a "Task name already exists" exception while the task
> > is queued; as soon as the task runs it allows you to queue up another task
> > with the same name.
>
> > I guess I'll just open a feature request on this in the issue tracker.
>
> > Vince
>
> > On Tue, Dec 1, 2009 at 11:39 AM, Vince Bonfanti  wrote:
> > > I'm trying to solve the following problem using task queues:
>
> > >   1. Queue a task to perform some action "N".
> > >   2. Until action N has been performed, don't allow any other tasks to be
> > > queued that also perform action N.
> > >   3. As soon as action N has been performed, immediately allow other tasks
> > > to be queued to perform action N (repeat from step 1).
>
> > > Using task names almost accomplishes what I need, except that at step 3 it
> > > will be at least seven days before another task can be queued to perform
> > > action N, when I need it to be allowed immediately:
>
> > >   "This (task names) provides a lightweight mechanism for ensuring
> > > once-only semantics. Once a Task with name N is written, any subsequent
> > > attempts to insert a Task named N will fail. Eventually (at least seven 
> > > days
> > > after the task successfully executes), the task will be deleted and the 
> > > name
> > > N can be reused."
>
> > > I've thought of different ways to solve this, most likely by using a
> > > memcache flag as a semaphore. But, it would be nice if the task queue API
> > > could support this natively, maybe by adding a "reuse time" or "exclusion
> > > time" parameter when setting the TaskOptions name parameter.
>
> > > Any thoughts on this?
>
> > > Vince- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

--

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




[appengine-java] Re: task queue once-only semantics

2009-12-01 Thread James H
Vince, shouldn't you use an un-named Task queue (to avoid Naming rules
mentioned) but query your own datastore semaphore prior to adding to
the queue.  This way when task N runs it manages the semaphore (a
Entity) to implement a mutex begin/end sequence.  I believe this
implies that task N will in fact run 3 transactions: #1 - mutex begin
(create Entity), #2 - work for N, and #3 - mutex end (remove Entity).

Anyhow assuming your logic to trigger a new Task N can incorporate the
criteria for mutex exists, then what would keep this from working?

On Dec 1, 2:37 pm, Vince Bonfanti  wrote:
> BTW, I've noticed that the dev server actually behaves the way I would like
> it to. It only throws a "Task name already exists" exception while the task
> is queued; as soon as the task runs it allows you to queue up another task
> with the same name.
>
> I guess I'll just open a feature request on this in the issue tracker.
>
> Vince
>
>
>
> On Tue, Dec 1, 2009 at 11:39 AM, Vince Bonfanti  wrote:
> > I'm trying to solve the following problem using task queues:
>
> >   1. Queue a task to perform some action "N".
> >   2. Until action N has been performed, don't allow any other tasks to be
> > queued that also perform action N.
> >   3. As soon as action N has been performed, immediately allow other tasks
> > to be queued to perform action N (repeat from step 1).
>
> > Using task names almost accomplishes what I need, except that at step 3 it
> > will be at least seven days before another task can be queued to perform
> > action N, when I need it to be allowed immediately:
>
> >   "This (task names) provides a lightweight mechanism for ensuring
> > once-only semantics. Once a Task with name N is written, any subsequent
> > attempts to insert a Task named N will fail. Eventually (at least seven days
> > after the task successfully executes), the task will be deleted and the name
> > N can be reused."
>
> > I've thought of different ways to solve this, most likely by using a
> > memcache flag as a semaphore. But, it would be nice if the task queue API
> > could support this natively, maybe by adding a "reuse time" or "exclusion
> > time" parameter when setting the TaskOptions name parameter.
>
> > Any thoughts on this?
>
> > Vince- Hide quoted text -
>
> - Show quoted text -

--

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




[appengine-java] Re: Transaction Error with No Transactions

2009-11-30 Thread James H
So, you are saying that your code did NOT perform a tx.begin() yet the
exception is complaining that Multiple Entity Groups have been
accessed during the course of a transaction?  Note that only a query
(not an update) of an entity outside the currently Entity Group update
triggers this error.

I assume if a transaction is NOT active then NO read locks occur and
all updates are considered Singleton updates.  Note that updates in
JDO are triggered by simply using a setter on a persisted Entity
attribute.

On Nov 30, 11:26 am, Jeffrey Goetsch  wrote:
> I am getting an exception that I pasted below.  It describes a transaction
> error, but I have not programmed any transactions.  On top of that, the
> request that I made should not have changed any data.  Has anyone else been
> getting errors like this?
>
> Caused by: java.lang.IllegalArgumentException: can't operate on multiple
> entity groups in a single transaction.
>
>         at 
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError(Datast­oreApiHelper.java:33)
>         at 
> com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(Datastor­eApiHelper.java:60)
>         at 
> com.google.appengine.api.datastore.DatastoreServiceImpl$1.run(DatastoreServ­iceImpl.java:113)
>         at 
> com.google.appengine.api.datastore.TransactionRunner.runInTransaction(Trans­actionRunner.java:30)
>         at 
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:99)
>         at 
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:72)
>         at 
> com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServic­eImpl.java:60)
>         at 
> org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.ge­t(RuntimeExceptionWrappingDatastoreService.java:63)
>         at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePe­rsistenceHandler.java:81)
>         at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePe­rsistenceHandler.java:91)
>         at 
> org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(Da­tastorePersistenceHandler.java:487)
>         at 
> org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:45­76)
>         at 
> org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2814­)
>         at 
> org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:2754)
>         at 
> org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:2893)
>         at 
> org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:369)
>         at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:256)
>         at org.datanucleus.ObjectManagerImpl.close(ObjectManagerImpl.java:801)
>         at 
> org.datanucleus.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:­271)
>         ... 51 more
>
> Thanks,
>
> Jeffrey

--

You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email 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: 5000 row query

2009-11-27 Thread James H
Seems intense transactions like yours are what GAE is trying to avoid
with high priority cycles reserved for the User Interface.  The Task
Queue and Cron subsystems help with intense batch operations such as
this.  But, even with those you have to breakdown the work into small
units.

On Nov 27, 8:32 am, chris  wrote:
> Hi,
>
> I'm trying to return 5000 rows by using 5 sets of 1000.  However the
> CPU utlization is really high.  I need to get the full 5000 to work
> out a calculation based on the data.  This prevents me from performing
> any paging operations.  I don't need to display all the data at once
> but simply getting the rows is causing some issues.  I don't want the
> high cpu utilization to cause the requests to timeout.
>
> Does anyone know of anything i could try?
>
> Regards
>
> 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.




[appengine-java] Re: Photo and Video services

2009-11-27 Thread James H
Here's some legwork...you can drill-down to section 14.25 of the page
below where it describes the If-Modified-Since header.  Basically, any
Get with this header including a timestamp can be compared to the
timestamp for the matching Entity to determine whether to respond
normally (return the image) or respond with a 304 (Not modified)
response.  I think the trick is determining the compare granualarity
since the server time and the client time are never exactly in sync.
Perhaps the granularity for comparison should be down to the minute,
not seconds and definitely not millisecond.  What do you think?

http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html

On Oct 23, 10:08 am, Vince Bonfanti  wrote:
> No, not yet. It's on the TODO list (see line 171 of the GaeVfsServlet
> source code). If you--or anyone else--wants to add this I'll be happy
> to accept a patch.
>
> Vince
>
>
>
> On Fri, Oct 23, 2009 at 11:42 AM, Diana Cruise  
> wrote:
>
> > In terms of performance does gaevfs accmmodate http resource timestamp
> > checks to avoid re-downloading repeated requests for the same images?- Hide 
> > quoted text -
>
> - Show quoted text -

--

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




[appengine-java] Re: select count(*) ?

2009-11-25 Thread James H
Jason, the problem with the "increment a counter on your own" trick is
that would be in a separate Transaction and thus, unreliably linked to
the first insert Transaction right?

Also, the Stats hook mentioned above is NOT realtime is it?  I believe
I read it is updated "at least once a day".

On Oct 21, 12:54 pm, "Jason (Google)"  wrote:
> The query restrictions are an artifact of the way App Engine's datastore is
> constructed, which makes certain operations (e.g. queries and reads) very
> fast and scalable but does limit the types of queries you can make, though
> you can typically get around these restrictions by re-thinking your model a
> bit.
>
> We are working on adding built-in cursor support for easier paging through
> entities and have just added a datastore statistics API for, among other
> things, getting the total entity count, even if it exceeds 1,000. More
> details here:
>
> http://code.google.com/appengine/docs/java/datastore/stats.html
>
> And we also have a data export utility included with the SDK to make it
> easier for you to back up or even move off of App Engine should you choose
> to, and we're continuing to look at ways of making App Engine, particularly
> the datastore component, easier to use.
>
> http://code.google.com/appengine/docs/python/tools/uploadingdata.html...
>
> - Jason
>
>
>
> On Mon, Oct 19, 2009 at 1:53 PM, vetch  wrote:
>
> > On 6 Paź, 10:03, "Jason (Google)"  wrote:
> > > * Because App Engine queries can only return up to 1,000 results,
> > > count(this) will never return above 1,000, even if you have more than
> > 1,000
> > > entities, so bear this in mind.
>
> > I'm deeply shocked. This works like some black hole.
>
> > You put your data there simply, but can't get them back that simply.
>
> > In connection with restricions (inequality property filter), it is
> > even harder to get anything more complex.
>
> > BiGAppEngine disappointment.- Hide quoted text -
>
> - Show quoted text -

--

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




[appengine-java] Re: Entity Group limitations

2009-11-12 Thread James H
Nevermind, I found the link that describes Transactions as limiting
queries as well as updates...

http://code.google.com/appengine/docs/java/datastore/transactions.html#What_Can_Be_Done_In_a_Transaction

On Nov 12, 9:51 am, James H  wrote:
> I was under the impression that transaction updates could only occur
> to 1 Entity Group at a time and I understand that.  But, it appears
> during the transaction we also can NOT read another Entity Group...is
> that correct?
>
> If so, that seems to be quite limiting to NOT be able to collect
> information from other Entity Groups A, B (ie reads) in preparation
> for the update to the targeted Entity Group C.  Am I missing
> something?
>
> J
>
> On Nov 10, 4:37 pm, "Ikai L (Google)"  wrote:
>
>
>
> > James,
>
> > For all practical intents and purposes, there are no limits on the number of
> > entity kinds per entity group or limits imposed by the underlying physical
> > hardware.
>
> > On Fri, Nov 6, 2009 at 6:56 PM, James H  wrote:
>
> > > Is there any limit on number of entity kinds per entity group or any
> > > limit on amount of physical storage consumed by a single entity group?
>
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine- Hide quoted text -
>
> - Show quoted text -

--

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




[appengine-java] Re: Entity Group limitations

2009-11-12 Thread James H
I was under the impression that transaction updates could only occur
to 1 Entity Group at a time and I understand that.  But, it appears
during the transaction we also can NOT read another Entity Group...is
that correct?

If so, that seems to be quite limiting to NOT be able to collect
information from other Entity Groups A, B (ie reads) in preparation
for the update to the targeted Entity Group C.  Am I missing
something?

J

On Nov 10, 4:37 pm, "Ikai L (Google)"  wrote:
> James,
>
> For all practical intents and purposes, there are no limits on the number of
> entity kinds per entity group or limits imposed by the underlying physical
> hardware.
>
> On Fri, Nov 6, 2009 at 6:56 PM, James H  wrote:
>
> > Is there any limit on number of entity kinds per entity group or any
> > limit on amount of physical storage consumed by a single entity group?
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine

--

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




[appengine-java] Re: why my app on GAE first access is so slow

2009-11-12 Thread James H
So at best, we have to use a 1-minute pinger for the app
geographically close to our targeted users right?  And am I
understanding that reactivating an app server with our app is very
costly towards quota...meaning we pay extra each time our app is
activated for the overhead of loading the app on the various app
servers?

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

[appengine-java] Re: Bi-directional unowned one-to-many relationships?

2009-11-11 Thread James H

This seems to be at the core of much confusion...hopefully one of the
persistence experts will weigh in and enlighten us.  I keep watch on
this thread and weigh in a bit later, in a rush at the moment!

On Nov 11, 7:39 am, "a.maza"  wrote:
> I am thinking if it makes sense from a design perspektive to model
> unowned bi-directional one-to-many relationships.I did some search on
> the web but didn't find many thoughts about such type of relationship.
>
> The two entity types I have should not be in an owned relationship for
> some reasons. Thus, I was thinking about using the relation index
> pattern as presented at Google I/O (http://code.google.com/intl/de-AT/
> events/io/2009/sessions/BuildingScalableComplexApps.html)
>
> However, I am not fully happy with that as outlined in another thread
> (http://groups.google.com/group/google-appengine-java/browse_thread/
> thread/2bba41ce4699d65e/918fee627cc41e02?#918fee627cc41e02) mainly due
> to performance issues when iterating over the keys in memory.
>
> Thus I was thinking about modeling the two entities in an unowned bi-
> directional style implying that I have to update the two entities in
> separate transactions in order to keep the relationship between the
> two entities. I would like to hear your thoughts about this. My main
> concern is consistency when something goes wrong in one of the two
> transactions.
>
> thanks,
> andr
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: why my app on GAE first access is so slow

2009-11-11 Thread James H

So, 1-3 minute intervals seem to do the trick?  Is this technique
still working for you?

On Nov 10, 8:24 pm, "zhiw...@gmail.com"  wrote:
> i think the gae cloud envrionment does not have the region concept.
> every app run on a virtual server , the cron job is used to make the
> virtual server active.  if the virtual server is active, when access
> the app, there is no need to reinit such as spring listener etc, so
> delay time is short, that is so simple  i think.
>
> On Nov 10, 7:30 am, James H  wrote:
>
>
>
> > How would a single cron task really help in an environment where
> > multitudes of app servers are involved based on demand, geography,
> > etc?  So, how will the task that just ran help someone in U.S. and
> > simultaneously help someone in Russia on the same app?  I assume they
> > are potentially running on different app servers.
>
> > On Nov 10, 1:51 am, m seleron  wrote:
>
> > > Thank you for useful information.
>
> > > Though various situations are thought
> > > I think that a detailed analysis might be necessary to decrease the CPU 
> > > TIME.
>
> > > thunks
>
> > > 2009/11/10 zhiw...@gmail.com :
>
> > > > now i set the schedule time to 3min, it seems work, every time i
> > > > access my app, i can hardly feel slow. my cron job access a servlet
> > > > that do nothing and just for active my app. set the schedule time to
> > > > 1min is better i think,although it will take some cpu time.
>
> > > > On Nov 9, 11:31 pm, m seleron  wrote:
> > > >> I'm sorry very much.
>
> > > >> It examined.
> > > >> ServletContextListener#contextDestoryed was not called.
> > > >> It was necessary to examine it accurately.
>
> > > >> Nichole.
> > > >> Thank you for advice.
>
> > > >> Does not the page access speed become early?
>
> > > >> When you access that I think access speed is open in since the second
> > > >> times always
> > > >> because by the thing that keeps being accessed with cron
>
> > > >> If the display speed is still slow, the cause might be different.
>
> > > >> thanks,
>
> > > >> On Nov 9, 11:30 pm, "zhiw...@gmail.com"  wrote:
>
> > > >> > i set the time to 5min , but i can still find the contextInitialized
> > > >> > info, seems gae's time-out is very short, now i test set it to 3min
>
> > > >> > On Nov 9, 10:18 pm, Joseph Stano  wrote:
>
> > > >> > > have you noticed if that solves the timeout issue?
>
> > > >> > > On Mon, Nov 9, 2009 at 5:04 AM, zhiw...@gmail.com 
> > > >> > >  wrote:
>
> > > >> > > > it seems only contextInitialized method can be executed, and
> > > >> > > > contextDestroyed never be executed. so i can not get the time my 
> > > >> > > > app
> > > >> > > > alive after it was actived.  i have use cron job to access a 
> > > >> > > > servlet
> > > >> > > > in my app every 10min to avoid app be inactive, if necessary i 
> > > >> > > > will
> > > >> > > > turn the time to 5min or less
>
> > > >> > > > On Nov 9, 11:40 am, "zhiw...@gmail.com"  
> > > >> > > > wrote:
> > > >> > > > > thanks , i will try it
>
> > > >> > > > > On Nov 9, 10:18 am, philburk  wrote:
>
> > > >> > > > > > > The logging/query idea is probably the best workaround, 
> > > >> > > > > > > but I don't
> > > >> > > > have
> > > >> > > > > > > such a client to do this querying.  If I did, I'd just 
> > > >> > > > > > > host my app on
> > > >> > > > it :)
>
> > > >> > > > > > You could schedule a cron job in GAE that tickled your app. 
> > > >> > > > > > If it ran
> > > >> > > > > > often enough it might keep it resident.
>
> > > >> > > > > >http://code.google.com/appengine/docs/java/config/cron.html-Hidequoted
> > > >> > > > > > text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: Entity design tips for global Membership data

2009-11-11 Thread James H

Ok, so if we have a single entity named Membership and a property
could be their email domain suffix like
Membership.domainSuffix=.com, .net, .uk, etc right?  And querying on
this property would auto-create an Index on domainSuffix.  How would
this alone help GAE to distribute the data such that .uk member data
is likely to be located on servers in the UK and so on?

"distributing CRUD operations for you"...what is actually distributed
here Ikai?  Do you mean the "processing" is distributed (ie the use of
app servers) or the data partitions are distributed near their
originating Users within google infrastructure.

Virtually every google app has this same problem to solve and if there
is a Best Practice offered then as a whole the entire google
infrastructure will benefit from efficient implementations of this
most common requirement.  Please advise.

On Nov 10, 5:41 pm, "Ikai L (Google)"  wrote:
> James,
>
> The way I would probably do this would be to create an enum in the scope of
> the Membership class representing a region and store it as an indexed
> property. The App Engine data store will take care of distributing the CRUD
> operations of related data for you. You probably won't get much bang for
> your buck by creating different entities. By maintaining a single Membership
> entity, you'll be able to more easily reuse related class. At its most low
> level, the App Engine datastore is simply a distributed, type agnostic
> key-value store. App Engine recognizes entities by creating an index for all
> of your application's Entities, and indexes are created for each property by
> default. I would recommend creating a Data Access layer and doing the
> segmentation there.
>
> On Tue, Nov 10, 2009 at 1:48 PM, James H  wrote:
>
> > Is there a best practice entity design for storing Membership data
> > that targets a global market?  Ideally, the Membership data is
> > partitioned geographically since a Membership in the U.S. is
> > independent of one in the U.K. and elsewhere, for example.  The motive
> > is that operations (searches, inserts, updates, deletes) on U.S. data
> > need NOT involve data from the U.K. and elsewhere.  Can GAE
> > transparently provide this based on the design of a single Membership
> > Entity or do you have to create separate Entities for each region in
> > your design such as MembershipUS, MembershipUK, etc?
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Entity design tips for global Membership data

2009-11-10 Thread James H

Is there a best practice entity design for storing Membership data
that targets a global market?  Ideally, the Membership data is
partitioned geographically since a Membership in the U.S. is
independent of one in the U.K. and elsewhere, for example.  The motive
is that operations (searches, inserts, updates, deletes) on U.S. data
need NOT involve data from the U.K. and elsewhere.  Can GAE
transparently provide this based on the design of a single Membership
Entity or do you have to create separate Entities for each region in
your design such as MembershipUS, MembershipUK, etc?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: permissions in multipart file upload

2009-11-10 Thread James H

Some have used GAEVFS as a replacement for direct access to local
files.  Just search threads for the details.

On Nov 9, 7:38 am, Esteban Masoero  wrote:
> Have a look at this 
> section:http://code.google.com/intl/en/appengine/docs/java/runtime.html#The_S...
>
> black_13 escribió:
>
>
>
> > when i try to upload a file i get
> > The server is running athttp://localhost:8080/
> > java.security.AccessControlException: access denied
> > (java.io.FilePermission C:\Users\black_13\AppData\Local\Temp
> > \upload_853a964_124d3e0d1f9__8000_.tmp write)
> > what is going on here?
> > black_13- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: why my app on GAE first access is so slow

2009-11-10 Thread James H

How would a single cron task really help in an environment where
multitudes of app servers are involved based on demand, geography,
etc?  So, how will the task that just ran help someone in U.S. and
simultaneously help someone in Russia on the same app?  I assume they
are potentially running on different app servers.

On Nov 10, 1:51 am, m seleron  wrote:
> Thank you for useful information.
>
> Though various situations are thought
> I think that a detailed analysis might be necessary to decrease the CPU TIME.
>
> thunks
>
> 2009/11/10 zhiw...@gmail.com :
>
>
>
>
>
> > now i set the schedule time to 3min, it seems work, every time i
> > access my app, i can hardly feel slow. my cron job access a servlet
> > that do nothing and just for active my app. set the schedule time to
> > 1min is better i think,although it will take some cpu time.
>
> > On Nov 9, 11:31 pm, m seleron  wrote:
> >> I'm sorry very much.
>
> >> It examined.
> >> ServletContextListener#contextDestoryed was not called.
> >> It was necessary to examine it accurately.
>
> >> Nichole.
> >> Thank you for advice.
>
> >> Does not the page access speed become early?
>
> >> When you access that I think access speed is open in since the second
> >> times always
> >> because by the thing that keeps being accessed with cron
>
> >> If the display speed is still slow, the cause might be different.
>
> >> thanks,
>
> >> On Nov 9, 11:30 pm, "zhiw...@gmail.com"  wrote:
>
> >> > i set the time to 5min , but i can still find the contextInitialized
> >> > info, seems gae's time-out is very short, now i test set it to 3min
>
> >> > On Nov 9, 10:18 pm, Joseph Stano  wrote:
>
> >> > > have you noticed if that solves the timeout issue?
>
> >> > > On Mon, Nov 9, 2009 at 5:04 AM, zhiw...@gmail.com  
> >> > > wrote:
>
> >> > > > it seems only contextInitialized method can be executed, and
> >> > > > contextDestroyed never be executed. so i can not get the time my app
> >> > > > alive after it was actived.  i have use cron job to access a servlet
> >> > > > in my app every 10min to avoid app be inactive, if necessary i will
> >> > > > turn the time to 5min or less
>
> >> > > > On Nov 9, 11:40 am, "zhiw...@gmail.com"  wrote:
> >> > > > > thanks , i will try it
>
> >> > > > > On Nov 9, 10:18 am, philburk  wrote:
>
> >> > > > > > > The logging/query idea is probably the best workaround, but I 
> >> > > > > > > don't
> >> > > > have
> >> > > > > > > such a client to do this querying.  If I did, I'd just host my 
> >> > > > > > > app on
> >> > > > it :)
>
> >> > > > > > You could schedule a cron job in GAE that tickled your app. If 
> >> > > > > > it ran
> >> > > > > > often enough it might keep it resident.
>
> >> > > > > >http://code.google.com/appengine/docs/java/config/cron.html- Hide 
> >> > > > > >quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: Master/Detail relations and redundant data handling

2009-11-09 Thread James H

Yep, that defaultFetchGroup worked nicely!  I sent you an email, let
me know if it did not arrive.

On Nov 9, 2:38 pm, bryce cottam  wrote:
> hey James,
> I usually do a defaultFetchGroup="true" on my embedded classes ('cause
> I always want them), but this makes it so that the embedded class is
> always loaded.  This generally isn't a problem because embedded values
> are contained in your entities record in the data store.  However,
> there is another approach that you can use to conditionally load your
> embedded (or any other) fields, the @FetchGroup annotation
>
> @FetchGroups({
>     @FetchGroup(name="Member.dataAuditFetchGroup",
> member...@persistent(name="dataAudit")})})
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Member {
>    ...
>   �...@persistent
>   �...@embedded
>    private DataAudit dataAudit;
>
> }
>
> thus, in a query you could use this fetch group whenever doing a query
> where you knew you wanted your embedded field pre-loaded:
> Query q = pm.newQuery(Member.class);
> q.getFetchPlan().addGroup("Member.dataAuditFetchGroup");
> List result = (List) q.execute();
>
> this will go fetch all the Member records, and before giving them back
> to you, it will populate the dataAudit field.
> The name of the FetchGroup is arbitrary, I think it must be unique,
> but it doesn't have to have the field you are referring to in the
> name.  You can also specify multiple fields in the FetchGroup.
> I think this is a really nice feature of JDO over JPA.
>
> hope that helps!!
> -bryce
>
>
>
> On Mon, Nov 9, 2009 at 1:29 PM, James H  wrote:
>
> > Bryce, I tried another use of your "embedded class" related to Audit
> > fields on an Entity.  For consistency in approach to Auditing entity
> > data, typically you would add the following 4 fields to each entity in
> > your design: createBy, createdDate, updatedBy, and updatedDate.  I
> > thought I'd place these 4 fields in an embedded class to be used by
> > every entity as a Best Practice to manage these 4 fields.  But, I
> > noticed when I tried this on the first entity kind it left the embed
> > null after a standard Query.  The code looks like this:
>
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > public class Member {
> >   �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >    private Key memberId;
> >   �...@persistent
> >    private Key referringMemberId;
> >   �...@persistent
> >    private String memberType;
> >    ...
> >   �...@persistent
> >   �...@embedded
> >    private DataAudit dataAudit;
> > }
>
> > @PersistenceCapable(embeddedOnly="true")
> > public class DataAudit {
> >   �...@persistent
> >    private Key createMemberId;
> >   �...@persistent
> >    private Date createDate;
> >   �...@persistent
> >    private Key updateMemberId;
> >   �...@persistent
> >    private Date updateDate;
>
> >    public DataAudit() throws Exception {
> >        createMemberId = null;
> >        createDate = null;
> >        updateMemberId = null;
> >        updateDate = null;
> >    }
>
> >    // getters/setters
> > }
>
> > Sample query logic for all members:
>
> > List list = pm.newQuery(Member.class).execute();
>
> > So each Member in the list is valid, except member.dataAudit is null
> > and I assume the query engine would populate dataAudit along with its
> > fields from the query automatically...as in the case with the embeds
> > from your examples.  Any ideas?
>
> > On Nov 5, 1:40 pm, bryce cottam  wrote:
> >> here's a really good talk about how objects are mapped into the
> >> BigTable datastore and how relationships are actually represented in
> >> the 
> >> system:http://sites.google.com/site/io/under-the-covers-of-the-google-app-en...
> >> this sort of highlites how relationships actually work in BigTable
> >> (which is quite different than they work in an RDB).
>
> >> here is another one from Max Ross where he advocates denormalization
> >> for query 
> >> optimization:http://code.google.com/events/io/2009/sessions/SofterSideofSchemas.html
> >> he kind of goes into how the BigTable datastore is simply schema-less.
> >>  Very interesting stuff.
>
> >> hope that helps.
> >> -bryce
>
> >> On Thu, Nov 5, 2009 at 12:34 PM, Rusty Wright  
> >> wrote:
>
> >> > Good points.  In my case, so far, the 

[appengine-java] Re: Master/Detail relations and redundant data handling

2009-11-09 Thread James H
mized code duplication and boilerplate code blocks (like
> >> constructors that manually copy fields from getters to setters etc.)
>
> >> The solution I've been working with is the ligthweight FK style "copy"
> >> of the real instance of an object, and some simple reflection to map
> >> fields from the real object to the lightweight FK "copy".
>
> >> As far as detachable="true|false" my main concern with that right now
> >> is how the GWT RPC serializer handles detachable entities (i.e. it
> >> doesn't handle them well).  There are certainly advantages to
> >> detaching an object, however, if the updates to the object are
> >> happening on the server, then there is no need to detach the object.
>
> >> On Thu, Nov 5, 2009 at 1:09 AM, Rusty Wright  
> >> wrote:
> >>> I think this is an important point.  The light bulb went off over my head 
> >>> after watching this video.  This is what he calls a property list.  For 
> >>> me it was also a good example of how to think about denormalizing, which 
> >>> comes up repeatedly.
>
> >>> So instead of the usual OO way of thinking of a department etc. 
> >>> aggregating people, turn it on its head and look at it as a person has a 
> >>> property, which is their department, and in this example, they can be in 
> >>> multiple departments so it's a list of departments, a property list.  As 
> >>> you point out, the queries for this are slick.  And it sounds like you 
> >>> don't even need the list of people in the department; it's redundant.
>
> >>> I'm still puzzled about what to do when a property value changes; for 
> >>> example, suppose the department named the Ministry of Propaganda changes 
> >>> its name to the Ministry of Disinformation.  Does the property list on 
> >>> Person contain a list of Department objects, or a list of Department Key 
> >>> objects?  I'm thinking the former, Department objects.  If we have the 
> >>> Department class configured with detachable="false", each time you fetch 
> >>> a Department object (matching on its name let's say), you get a new 
> >>> unparented Department object, which you add to the Person's department 
> >>> list, whereupon it becomes parented by Person.  The fetched Department 
> >>> object is essentially a clone.  (That's assuming I understand how it 
> >>> works when you have detachable="false"; it's sort of like the singleton 
> >>> pattern.)  As part of fetching the cloned Department object, the 
> >>> Department class has a masterKey field, type Key, which you set to the 
> >>> Key of the Department in the table, the one it was cloned from.  So
> > whe
> >>> n the Department's name changes, the query to get all its cloned 
> >>> Departments could be simple and quick.  But now I'm fuzzy on how you 
> >>> change the master Department's name; since it's detachable="false" we 
> >>> can't fetch it and update it and save it back, so I guess we have to 
> >>> replace it in the master table and then replace all of its clones in all 
> >>> Person lists?
>
> >>> bryce cottam wrote:
> >>>> ah, gottcha, well there is actually a really good google i/o talk on
> >>>> using list/collections and how to optimize them. I generally am using
> >>>> "owned" lists for smaller collections,and un-owned ones are
> >>>> represented by the child object containing an FK type class as a
> >>>> "backwards pointer" to the parent.  If I want to get all the children
> >>>> for a given parent, I can query "select from Child where parent.id =
> >>>> :myParentId".  Of course, the Child.parent field needs to be embedded
> >>>> in order to query off it in this manner.  So, in your case I'd imagine
> >>>> a Person would be in a handful of Institutions, but an Institution
> >>>> could have tons and tons of Person instances in it.  So I'd think
> >>>> you'd want to keep the relationship defined in the Person.institutions
> >>>> collection, and anytime you need to query "who's in InstitutionX?" you
> >>>> can do the query against the Person data class.  There is a rather
> >>>> slick way to do this in JDO:
>
> >>>> String filter = "insti

[appengine-java] Re: AppEngine Java stability concerns

2009-11-09 Thread James H

Jerome,

I am concerned about uptime and throughput too.  Are there any GAE
sites that boast large volume yet?  It would be reassuring to see
stats on such sites that prove the price/performance viability of
GAE.  How much traffic are you seeing and at what price and
performance?

On Nov 4, 2:21 pm, Rusty Wright  wrote:
> Could you have an automated message (monthly, weekly, whatever) that's posted 
> to the GAE groups that informs people about this downtime notify group?
>
>
>
> Max Ross (Google) wrote:
> > Hi Jerome,
>
> > There is planned maintenance going on right now.  I'd strongly encourage
> > you to subscribe to the App Engine Downtime Notify group where you can
> > learn about these things in advance:
>
> >http://groups.google.com/group/google-appengine-downtime-notify
>
> > Thanks,
> > Max
>
> > On Tue, Nov 3, 2009 at 6:18 PM, Jerome  > > wrote:
>
> >     Hello,
>
> >     Our app has been running on AppEngine Java for 2 months. We are now
> >     ramping up on traffic and have enabled the billing feature. We are
> >     seeing on a daily basis short (1-2 minutes) outages. Most of the time,
> >     this is on the datastore, but these short outages sometimes affect
> >     other areas as well, like for instance serving static content.
>
> >     Today, we are seeing a data store in anomaly. This has been going on
> >     for over an our now:
> >     Uncaught exception from servlet
> >     com.google.apphosting.api.ApiProxy$CapabilityDisabledException: The
> >     API call datastore_v3.Put() is temporarily unavailable.
> >     We are completely dead in the water...
>
> >     My 2 questions are:
> >     - how/where can we report short outages that are usually not reflected
> >     on the AppEngine system status?
> >     - what is the AppEngine team plan to ensure a reliable service
>
> >     Jerome- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Implementation of Distributed Transaction API

2009-11-05 Thread James H

I lost track of where the code project for the API defined in the
whitepaper by Wilkerson, Armbrust, and others regarding distributed
transactions.  I have the whitepaper site:

http://danielwilkerson.com/dist-trans-gae.html

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



[appengine-java] Re: Master/Detail relations and redundant data handling

2009-11-04 Thread James H

Rusty, Thanks for the code sample!  How do you decide when to use key
type of "Key" vs "String"?

On Nov 4, 1:45 pm, James H  wrote:
> Datanucleus, both suggestions worked but I like the "embeddedOnly"
> best in order to avoid a dummy key on every FK class!
>
> Bryce, I no longer get the error above...I just added
> embeddedOnly="true" to the PersistanceCapable tag in BookFk class.
> You're right, I could use the collection technique on the FKs but I
> wonder the pros/cons of such collections on what could be very large
> collections.  For example, say Baylor with 25,000 members?  Guess its
> a matter of using "owned" for small Sets versus "unowned" for large
> Sets of data.  Regardless, your FK pattern will save a whole lot of
> code management!!!
>
> Any further feedback welcome...I'll continue testing!
>
> On Nov 4, 12:12 pm, datanucleus  wrote:
>
>
>
> > > Needs a PK either way. Pick a field, any field.
>
> > Or just set "embeddedOnly" as true ... if you really never want to
> > persist one of those in its own right- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: Master/Detail relations and redundant data handling

2009-11-04 Thread James H

Datanucleus, both suggestions worked but I like the "embeddedOnly"
best in order to avoid a dummy key on every FK class!

Bryce, I no longer get the error above...I just added
embeddedOnly="true" to the PersistanceCapable tag in BookFk class.
You're right, I could use the collection technique on the FKs but I
wonder the pros/cons of such collections on what could be very large
collections.  For example, say Baylor with 25,000 members?  Guess its
a matter of using "owned" for small Sets versus "unowned" for large
Sets of data.  Regardless, your FK pattern will save a whole lot of
code management!!!

Any further feedback welcome...I'll continue testing!

On Nov 4, 12:12 pm, datanucleus  wrote:
> > Needs a PK either way. Pick a field, any field.
>
> Or just set "embeddedOnly" as true ... if you really never want to
> persist one of those in its own right
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Master/Detail relations and redundant data handling

2009-11-04 Thread James H

BookFk is an embedded class intended to be used by entities like
Chapter and others.  It is NOT intended to be a standalone entity or
have a Primary Key.  So, when I try your fix I get the following
compile error:

SEVERE: Class struts2.example4.BookFk has application-identity and no
objectid-class specified yet has 0 primary key fields. Unable to use
SingleFieldIdentity.

This pattern was submitted by Bryce as a way of better handling
redundant data related to FK fields such as Chapter.book in this case.

On Nov 4, 10:59 am, datanucleus  wrote:
> Why is BookFK trying to use Datastore Identity ? (as the message says)
>
> "identityType=IdentityType.APPLICATION" would be recommended
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Master/Detail relations and redundant data handling

2009-11-04 Thread James H
 getChapterTitle() { return chapterTitle; }
public void setChapterTitle(String val) { chapterTitle = val; }

public Integer getNumPages() { return numPages; }
public void setNumPages(Integer val) { numPages = val; }
}

@PersistenceCapable(detachable="true")
public class BookFk {
@Persistent
private Key bookId;
@Persistent
private String bookTitle;
@Persistent
private String isbn;

public BookFk(Book book) {
bookId = book.getBookId();
bookTitle = book.getBookTitle();
isbn = book.getIsbn();
}

public Key getBookId() { return bookId; }
public void setBookId(Key val) { bookId = val; }

public String getBookTitle() { return bookTitle; }
public void setBookTitle(String val) { bookTitle = val; }

public String getIsbn() { return isbn; }
public void setIsbn(String val) { isbn = val; }
}

 snippets from JSP driver
...
private Book addBook(PersistenceManager pm, String title, String
isbn) throws Exception {
Book book = new Book(title, isbn);
return pm.makePersistent(book);
}
private Chapter addChapter(PersistenceManager pm, String title,
Integer numPages, Book book) throws Exception {
Chapter chapter = new Chapter(title, numPages, book);
book.getChapters().add(chapter);
//return pm.makePersistent(chapter);
return null;
}
...
Book newBook = addBook(pm, "Gone with the wind", "123");
...
addChapter(pm, "chapter 1 - rhett", new Integer(40), newBook);

NOTE: The book gets added ok, but then the chapter Add fails.  I've
also tried them in separate transactions with same error.  I'll test
and search this error further, Thanks.

On Nov 4, 1:02 am, bryce cottam  wrote:
> Hi James,
> sorry for the delay,
>
> My design is currently similar to what you proposed.  However, in your
> example, I'd probably make 2 classes: PersonFK and InstitutionFK.:
> public class PersonFK {
>      private Key id;
>      private String firstName;
>      private String lastName;
>      private String city;
>
> }
>
> public class InstitutionFK {
>      private Key id;
>      private String name;
>      private String city;
>
> }
>
> Then in Person you would have:
>
> public class Person {
>     private List institutions;
>     
>
> }
>
> and in Institutions you would have:
> public class Institution {
>     private List persons;
>     
>
> }
>
> (I'm leaving out the annotations for brevity).
>
> each of these member fields (institutions and persons) are "owned" by
> their containing instance of Person and Institutions.  Thus, the
> relationship is defined by who owns it (i.e we don't need the
> Institution's id, name, city etc. on the persons collection because we
> already know what Institution the PersonFK's are linked to)
> So, yes, anytime you want to do something like update the Person.city
> field, you'd want to get all PersonFK instances with your person-Id,
> then update each instance with the "new" city value.  Of course, this
> only matters if you plan on querying Institutions based off of the
> "city" field of a Person.  That generally would imply multiple
> transactions, however there is the Wilkerson distributed transaction
> model, which makes "global" transactions on GAE possible.  So, if your
> writes really do need to be transactional, then you can do an "all or
> nothing" operation on multiple entity groups with this approach.
>
> here is a video from Google I/O about distributed transactions on the 
> GAE:http://www.youtube.com/watch?v=IOtBlzsx0m8
>
>
>
> On Tue, Nov 3, 2009 at 1:50 PM, James H  wrote:
>
> > Consider this test case.  A Person belongs to 1 or more Institutions
> > so there's 2 ways you would want to query this.  Query #1: Given a
> > particular Person then which Institutions does he belong to?  Query
> > #2:  Given a particular Institution then which Persons are members?
>
> > Assume entity Person and its associated child relations will form its
> > own entity group and, likewise, entity Institution will form its own
> > entity group related to its children.  In order to accommodate large
> > amounts of Person and Institution data, I submit that you would need
> > "owned" relations of each.
>
> > Therefore, you would need entity PersonInstitutions as an owned child
> > relation with Person for Query #1.  Similarly, you would need entity
> > InstitutionPersons as an owned child relation with Institution for
> > Query #2.
>
> > Also, each of these 2 child 

[appengine-java] Re: Master/Detail relations and redundant data handling

2009-11-03 Thread James H

Consider this test case.  A Person belongs to 1 or more Institutions
so there's 2 ways you would want to query this.  Query #1: Given a
particular Person then which Institutions does he belong to?  Query
#2:  Given a particular Institution then which Persons are members?

Assume entity Person and its associated child relations will form its
own entity group and, likewise, entity Institution will form its own
entity group related to its children.  In order to accommodate large
amounts of Person and Institution data, I submit that you would need
"owned" relations of each.

Therefore, you would need entity PersonInstitutions as an owned child
relation with Person for Query #1.  Similarly, you would need entity
InstitutionPersons as an owned child relation with Institution for
Query #2.

Also, each of these 2 child entities would contain both a PersonFK and
a InstitutionFK with appropriate redundant fields ancillary to the
query requirement of the app.  Again, the embedded FK class avoids
extra queries that would kill search list performance, etc.  For
example with Query #2, give me all persons at Baylor that have first
name James would only need the entity InstitutionPersons.

So, we accept the fact the design requires redundant data in the
embedded FK class but at least from a source code perspective we only
have FK class to manage.

Is it correct that we would need both "owned" relations or not?  Say
you had Persons and Institutions from around the world.  I can't
imagine satisfying the above 2 queries without both "owned"
relations.  Of course, this means updates to both relations are across
2 entity groups and separate transactions.  Another fact we have to
accept in the design right?

On Nov 3, 2:22 pm, James H  wrote:
> Ok Bryce...I'm back.  Going to test with your ideas now.  In my case,
> I tend to avoid generic column names like "id" in favor of "bookId"
> and "chapterId" so I should not have any naming conflicts (at least
> rarely).  Also, my FK embedded classes should not have any collections
> though I have a feeling they may come up as I get further into it.
>
> I'll just test with Book and owned relation Chapter as you have it
> here.  How do we tell JDO whether a relation is "owned" vs "unowned"
> by the way?  Because I would like to have a child object of each for
> the testing.  Thanks!
>
> On Oct 9, 12:06 pm, bryce cottam  wrote:
>
>
>
> > FYI, this video was hugely helpful for me, and this information helps
> > me decide how to structure my data model to run best on the
> > app-engine, it's a Google I/O session on how the app-engine big table
> > implementation works:http://www.youtube.com/watch?v=tx5gdoNpcZM
>
> > On Fri, Oct 9, 2009 at 10:46 AM, James H  wrote:
>
> > > Ylmz, thats how I see it too.  Any significant data model will be
> > > riddled with FKs and since GAE datastore does not support Joins you
> > > have NO choice but to denormalize your data to meet the needs of your
> > > app queries.  The Cottam Pattern above allows best management of
> > > source to accomplish this denormalization.
>
> > > I assume the simple example you are referring to either only stores
> > > the Keys in the physical table (which would be insufficient for app
> > > queries) or stores the whole record (which would be massive overkill).
>
> > > Does that make any sense?
>
> > > On Oct 8, 4:46 am, bryce cottam  wrote:
> > >> yes, I think the point that we are making is that we are trying to
> > >> managed "un-owned" relationships  :)
> > >> You are describing owned relationships, which I use as well, but in
> > >> many cases, I really want un-owned relationships.  For a variety of
> > >> reasons really, one of which is that the children I have in my
> > >> collection get get rather big, and there is a cap on the number of
> > >> writes that can happen on an entity group.  So, in come cases it's
> > >> better to model the relationships as foreign keys.
>
> > >> The problem comes in when you try to manage your data.  It's a pretty
> > >> common suggestion from the app-engine team to denormalize, we're just
> > >> trying to come up with a way to denormalize and minimize code
> > >> duplication etc.  Denormalizing will let you query better/faster etc.
> > >> but can create headaches when trying to update a single field which is
> > >> mirrored on several other entities.
>
> > >> For instance, you could have an Employee that works for several
> > >> departments in a company.  It's the same Employee, so it

[appengine-java] Re: Master/Detail relations and redundant data handling

2009-11-03 Thread James H

Ok Bryce...I'm back.  Going to test with your ideas now.  In my case,
I tend to avoid generic column names like "id" in favor of "bookId"
and "chapterId" so I should not have any naming conflicts (at least
rarely).  Also, my FK embedded classes should not have any collections
though I have a feeling they may come up as I get further into it.

I'll just test with Book and owned relation Chapter as you have it
here.  How do we tell JDO whether a relation is "owned" vs "unowned"
by the way?  Because I would like to have a child object of each for
the testing.  Thanks!

On Oct 9, 12:06 pm, bryce cottam  wrote:
> FYI, this video was hugely helpful for me, and this information helps
> me decide how to structure my data model to run best on the
> app-engine, it's a Google I/O session on how the app-engine big table
> implementation works:http://www.youtube.com/watch?v=tx5gdoNpcZM
>
>
>
> On Fri, Oct 9, 2009 at 10:46 AM, James H  wrote:
>
> > Ylmz, thats how I see it too.  Any significant data model will be
> > riddled with FKs and since GAE datastore does not support Joins you
> > have NO choice but to denormalize your data to meet the needs of your
> > app queries.  The Cottam Pattern above allows best management of
> > source to accomplish this denormalization.
>
> > I assume the simple example you are referring to either only stores
> > the Keys in the physical table (which would be insufficient for app
> > queries) or stores the whole record (which would be massive overkill).
>
> > Does that make any sense?
>
> > On Oct 8, 4:46 am, bryce cottam  wrote:
> >> yes, I think the point that we are making is that we are trying to
> >> managed "un-owned" relationships  :)
> >> You are describing owned relationships, which I use as well, but in
> >> many cases, I really want un-owned relationships.  For a variety of
> >> reasons really, one of which is that the children I have in my
> >> collection get get rather big, and there is a cap on the number of
> >> writes that can happen on an entity group.  So, in come cases it's
> >> better to model the relationships as foreign keys.
>
> >> The problem comes in when you try to manage your data.  It's a pretty
> >> common suggestion from the app-engine team to denormalize, we're just
> >> trying to come up with a way to denormalize and minimize code
> >> duplication etc.  Denormalizing will let you query better/faster etc.
> >> but can create headaches when trying to update a single field which is
> >> mirrored on several other entities.
>
> >> For instance, you could have an Employee that works for several
> >> departments in a company.  It's the same Employee, so it should be a
> >> single record.  So, in this case you'd have a Company, Division and
> >> Employee.  A Company "owns" it's Divisions and it also "owns" it's
> >> Employees, yet a Division "owns" it's Employees as well.  So, where
> >> does the collection of Employees live?  On the Company, or the
> >> Division?  If it's the Division, then you can't share employees with
> >> other divisions (unless you duplicate the Employee record).  If the
> >> Company owns the Employee, then you have to make some way for the
> >> Division to know who's in it.  You could do this by putting a
> >> collection of Division Key objects on an Employee record, or a
> >> collection of Employee Keys on a Division record.  Yet, this doesn't
> >> allow for simple querying, like "select all employees that work in a
> >> division located in New York and has less than 20 people in it".  Or,
> >> "select all divisions who have an employee named Fred".
>
> >> you can do queries like this if you denormalize the data though  :)
>
> >> On Thu, Oct 8, 2009 at 3:35 AM, ylmz  wrote:
>
> >> > may I suggest different kind of desing
> >> >http://code.google.com/appengine/docs/java/datastore/relationships.html,
> >> > in this document it suggests to use collection types to design one to
> >> > many relation ships.
> >> > and it works pretty well actually. when you use a collection type. app
> >> > engine does not really use the original colection type you used.
> >> > instead
> >> > it uses its own replacement. so if you want to add a new employee to
> >> > the company you just add a new one to the list. it automatically added
> >> > to datastore.
> >>

[appengine-java] Re: ClassCastException blues

2009-09-18 Thread James H

Jayson, the include in my JSP looks like this:

jsp:include page="homeLeft.jsp" flush="true"

I assume the Google plugin for Eclipse is handling this in a
compatible manner between the test environment provided by the plugin
versus production.  So, I'm not sure what to change by your comment on
"include".  I did miss the try/catch there...I'll try that next.
Thanks, J

On Sep 18, 12:41 pm, Jayson Falkner  wrote:
> You could catch this exception to find out more about it; however, I
> think you just  need to use the normal Servlet RequestDispatcher
> instead of Apache's specific implementation. e.g.
>
> request.getRequestDispatcher().include(request, response);
>
> Note that the JSP/Servlet spec doesn't require Apache. Meaning you
> should stick to the spec's classes and interfaces if you expect your
> code to work between possibly different containers.
>
> Hope it helps,
>
> Jayson
>
>
>
> On Thu, Sep 17, 2009 at 10:09 PM, James H  wrote:
>
> > This cast exception is NOT obvious.  Here's the production stack
> > snippet:
>
> > /homeIndex.jsp
> > java.lang.ClassCastException: java.lang.ClassCastException cannot be
> > cast to javax.servlet.ServletException
> >        at org.apache.jasper.runtime.PageContextImpl.handlePageException
> > (PageContextImpl.java:754)
> >        at org.apache.jsp.homeIndex_jsp._jspService(homeIndex_jsp.java:67)
> >        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
> > ...
>
> > And here's the homeIndex_jsp.java (from my local runtime test
> > environment).  Line 67 is the last one listed here:
>
> > ...
> >      out.write("\t\t\t\t\n");
> >      out.write("\t\t\t\t\t\n");
> >      org.apache.jasper.runtime.JspRuntimeLibrary.include(request,
> > response, "homeLeft.jsp", out, true);
> >      out.write("\n");
> > ...
>
> > Any ideas on how a class cast exception could occur above?  Naturally,
> > this runs fine in my test environment but NOT in production!
>
> > Thanks, J- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] ClassCastException blues

2009-09-17 Thread James H

This cast exception is NOT obvious.  Here's the production stack
snippet:

/homeIndex.jsp
java.lang.ClassCastException: java.lang.ClassCastException cannot be
cast to javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:754)
at org.apache.jsp.homeIndex_jsp._jspService(homeIndex_jsp.java:67)
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
...

And here's the homeIndex_jsp.java (from my local runtime test
environment).  Line 67 is the last one listed here:

...
  out.write("\t\t\t\t\n");
  out.write("\t\t\t\t\t\n");
  org.apache.jasper.runtime.JspRuntimeLibrary.include(request,
response, "homeLeft.jsp", out, true);
  out.write("\n");
...

Any ideas on how a class cast exception could occur above?  Naturally,
this runs fine in my test environment but NOT in production!

Thanks, J
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: Email w/Attachments, as Html, etc

2009-09-10 Thread James H

Ok, based on the docs here the standard JavaMail supports attachments
and html but I can not seem to find the "optional body" mentioned:

http://code.google.com/appengine/docs/java/mail/overview.html

Can someone paste a snippet of their code to use the html body
properly?

J

On Sep 10, 12:20 pm, James H  wrote:
> Is GAE email limited to content type Text only or is there a way to
> send Html too?  Also, can you send attachments?  I noticed all these
> features in Apache Commons Email lib.  Has anyone used this lib with
> GAE?
>
> Thanks, J
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Email w/Attachments, as Html, etc

2009-09-10 Thread James H

Is GAE email limited to content type Text only or is there a way to
send Html too?  Also, can you send attachments?  I noticed all these
features in Apache Commons Email lib.  Has anyone used this lib with
GAE?

Thanks, J
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: java developers and hot deployment

2009-09-08 Thread James H

Yep, you nailed it...in under 4 minutes!  Thanks, it was driving me
nuts!

On Sep 8, 3:28 pm, Rajeev Dayal  wrote:
> What version of the JDK are you using? There is a known issue with JDK
> 1.6.0_14 that causes breakpoints to be skipped. If you're using this JDK,
> either downgrade to JDK 1.6.0_13, or upgrade to JDK 1.6.0_16.
>
>
>
> On Tue, Sep 8, 2009 at 4:24 PM, James H  wrote:
>
> > What is going on with Debugging anyway?  I had been running fine with
> > 1.2.2 GAE plugin an Eclipse 3.3, and was able to debug nicely except
> > for signature changes, additions.  Then the 1.2.5 upgarde blew my
> > environment up so I decided to load Eclipse 3.5 Galileo and the latest
> > GAE plugin.  But, debugging didn't work out-of-the-box.  I had to add -
> > Xdebug to the builtin launch provided by the GAE plugin.  Though now,
> > the debugging is sporatic.  It will stop at a breakpoint only once,
> > etc...  This is NOT tolerable...I must be missing something, surely
> > its intended to work as well under Eclipse 3.5 as it did under Eclipse
> > 3.3?
>
> > J
>
> > On Sep 7, 8:59 am, Nicolas Melendez  wrote:
> > > hi all!
> > > If you are tired of running the sever again every time you make a
> > > change in your code, please vote this issue to have "server hot
> > > deployment" which is an   important  and time-saving feature. that
> > > would make java developers really happy :)
>
> > >http://code.google.com/p/googleappengine/issues/detail?id=1787- Hide 
> > >quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: java developers and hot deployment

2009-09-08 Thread James H

What is going on with Debugging anyway?  I had been running fine with
1.2.2 GAE plugin an Eclipse 3.3, and was able to debug nicely except
for signature changes, additions.  Then the 1.2.5 upgarde blew my
environment up so I decided to load Eclipse 3.5 Galileo and the latest
GAE plugin.  But, debugging didn't work out-of-the-box.  I had to add -
Xdebug to the builtin launch provided by the GAE plugin.  Though now,
the debugging is sporatic.  It will stop at a breakpoint only once,
etc...  This is NOT tolerable...I must be missing something, surely
its intended to work as well under Eclipse 3.5 as it did under Eclipse
3.3?

J

On Sep 7, 8:59 am, Nicolas Melendez  wrote:
> hi all!
> If you are tired of running the sever again every time you make a
> change in your code, please vote this issue to have "server hot
> deployment" which is an   important  and time-saving feature. that
> would make java developers really happy :)
>
> http://code.google.com/p/googleappengine/issues/detail?id=1787
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Eclipse 3.3 plugin missing from update site

2009-09-08 Thread James H

Please disregard this issue...I've decided to install Eclipse Galileo
instead of trying to figure out what is wrong with this older version
and the GAE update.

On Sep 7, 9:44 am, Anne van der Bom  wrote:
> James,
>
> My situation is a bit different from yours. I did not upgrade. I
> installed the GWT SDK and Eclipse Plugin a week ago. Then ran into
> some
> problems and tried to uninstall the Google GWT features (all 3) to see
> if that would change the situation. When I tried to re-install them
> today, I noticed the missing plugin.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Eclipse 3.3 plugin missing from update site

2009-09-07 Thread James H

Can you check to see if you had similar issues as I had - search for
"Upgrade issue with Google SDK 1.2.5 Options"?  I didn't realize the
site was missing anything, but obviously noticed the SDK could NOT
activate in my Eclipse 3.3.  I may just load the latest Eclipse and be
done with it, unless we can get some resolution here...hate when
issues like this interrupt development time...

On Sep 7, 8:52 am, Anne van der Bom  wrote:
> When I try to install the Eclipse 3.3 plugin from update 
> sitehttp://dl.google.com/eclipse/plugin/3.3I only see 2 features: Google
> App Engine Java SDK 1.2.5 and Google Web Toolkit SDK. There is
> supposed to be a 3rd feature: Google plugin for Eclipse.
>
> I checked the 3.4 update site, and that one contains all 3 features.
>
> Can anybody tell me what happened to the Eclipse 3.3 plugin? Is there
> perhaps an alternative update site that I can try?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Master/Detail relations and redundant data handling

2009-09-07 Thread James H

Right, denormalization is promoted by the Max Ross video as in your
2nd case so from a software design perspective can the "copy fields"
in Employee be contained in their own class and referenced from
Employee in a fashion that allows JDO to still work such as:

class CompanyFK {
  // copy of property fiels from Company
  @Persistent private String companyName;
  @Persistent private String businessArea;

  @ManyToOne
  private Company company;
}

class Employee {
  @Persistent String name;
  @Persistent String address;

  CompanyFK compnayFK
}

This way all entities that include a FK to Company would use CompanyFK
and denormalized relations such as this would be managable (ie rather
than copy/paste of fields across many Entities).  Does JDO allow this
level of control?

On Sep 7, 4:44 am, leszek  wrote:
> I'm not sure if your taking of the problem is correct. To my mind it
> runs:
>
> You have Company and Employee. Company has many Employees and Employee
> is working for one company. "Normalized" version looks like:
>
> class Company {
>
>   �...@persistent private String companyName;
>   �...@persistent private String businessArea;
> ...
>
> }
>
> class Employee {
>
>   @Persistent private String name;
>   @Persistent private String address;
>   
>   @ManyToOne
>   private Company company;
>
> }
>
> If you want to get all Employess working for a company you should
> execute:
>   "SELECT * FROM Employee e WHERE e.company.companyName = :nameParam"
>
> or if you want all Emloyees working for all IT companies you execute:
>   "SELECT * FROM Employee e WHERE e.company.businessArea = 'IT' "
> ...
> But this query will not work in Google App Engine.
>
> The solution is to resolve this query programmaticaly by running
> several queries and filter it in memory or to "denormalize" this
> scheme by moving some fields from Company to Employee
>
> Something like:
>
> class Epmloyee {
>   @Persistent String name;
>   @Persistent String address;
>
>   // copy of property fiels from Company
>   @Persistent private String companyName;
>   @Persistent private String businessArea;
>
>   @ManyToOne
>   private Company company;
>
> }
>
> and run
>   "SELECT Object(Employee) FROM Employee e WHERE e.companyName
> = :nameParam"
>
> The first solution allows keeping "normalized" version but the cost is
> less effective query, the second requires to break strictly normalized
> pattern but the query is much more effective (I think that it can be
> 10 or more times more effective). Also the second solution requires
> more time while writing and updating.
> But it is up to you what is more important, it is classical dilemma:
> more "reads" or more "writes".
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Upgrade issue with Google SDK 1.2.5

2009-09-07 Thread James H

Actually, Google does NOT display as an option under Window-
>Preferences currently!  Its like the plugin does NOT exist at all,
yet the plugin is physically there under Eclipse/plugins.  I noticed
alot of these errors in the Eclipse log:

!ENTRY org.eclipse.debug.core 4 5020 2009-09-06 10:17:28.020
!MESSAGE Launch configuration type id
"com.google.gdt.eclipse.suite.webapp" does not exist.
Possible causes:
Missing specification of a launch type (missing plug-in)
Incorrect launch configuration XML




On Sep 7, 1:09 am, Sekhar  wrote:
> Had the same problem, just remapping the SDK fixed it. This is under
> WIndow->Preferences->Google->App Engine.
>
> On Sep 6, 8:35 am, James H  wrote:
>
>
>
> > I used the Eclipse Soft Updates menu on Sep 4th to apply SDK 1.2.5
> > after noticing Red errors in the local runtime log telling me to do
> > so.  Actually, first I noticed my production app was failing to
> > retrieve data so I figured I needed to first upgrade as instructed by
> > the log message and then see if there were still any data issues.
>
> > I had been running SDK 1.2.2 since July without problems locally or in
> > production.  The install of the upgrade ran without errors.  Here is
> > the Eclipse install history:
>
> > Jul 12, 2009 1:24:28 PM file:/C:/homeGoogle/programs/eclipse/ site-
> > install success
>
> > Jul 12, 2009 1:49:03 PM
> > Date / Time Target Action Status
> > Jul 12, 2009 1:48:12 PM
> > com.google.gdt.eclipse.suite.e33.feature_1.0.1.v200905131156 feature-
> > install success
> > Jul 12, 2009 1:48:26 PM
> > com.google.gdt.eclipse.suite.e33.feature_1.0.1.v200905131156 feature-
> > enable success
> > Jul 12, 2009 1:48:26 PM
> > com.google.gwt.eclipse.sdkbundle.e33.feature_1.6.4.v200904062254
> > feature-install success
> > Jul 12, 2009 1:49:03 PM
> > com.google.gwt.eclipse.sdkbundle.e33.feature_1.6.4.v200904062254
> > feature-enable success
>
> > Jul 12, 2009 1:50:20 PM
> > Date / Time Target Action Status
> > Jul 12, 2009 1:50:06 PM
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.1.v200905131156
> > feature-install success
> > Jul 12, 2009 1:50:20 PM
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.1.v200905131156
> > feature-enable success
>
> > Jul 24, 2009 10:01:27 PM
> > Date / Time Target Action Status
> > Jul 24, 2009 10:01:01 PM
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.2.v200907131018
> > feature-install success
> > Jul 24, 2009 10:01:27 PM
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.2.v200907131018
> > feature-enable success
> > Jul 24, 2009 10:01:27 PM
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.1.v200905131156
> > feature-disable success
>
> > Sep 4, 2009 6:27:25 AM
> > Date / Time Target Action Status
> > Sep 4, 2009 6:26:51 AM
> > com.google.gdt.eclipse.suite.e33.feature_1.1.0.v200907291650 feature-
> > install success
> > Sep 4, 2009 6:27:12 AM
> > com.google.gdt.eclipse.suite.e33.feature_1.1.0.v200907291650 feature-
> > enable success
> > Sep 4, 2009 6:27:12 AM
> > com.google.gdt.eclipse.suite.e33.feature_1.0.1.v200905131156 feature-
> > disable success
> > Sep 4, 2009 6:27:12 AM
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.5.v200909021033
> > feature-install success
> > Sep 4, 2009 6:27:25 AM
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.5.v200909021033
> > feature-enable success
> > Sep 4, 2009 6:27:25 AM
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.2.v200907131018
> > feature-disable success
>
> > Sep 5, 2009 11:13:51 AM
> > Date / Time Target Action Status
> > Sep 5, 2009 11:12:38 AM
> > com.google.gwt.eclipse.sdkbundle.e33.feature_1.7.0.v200907131018
> > feature-install success
> > Sep 5, 2009 11:13:48 AM
> > com.google.gwt.eclipse.sdkbundle.e33.feature_1.7.0.v200907131018
> > feature-enable success
> > Sep 5, 2009 11:13:48 AM
> > com.google.gwt.eclipse.sdkbundle.e33.feature_1.6.4.v200904062254
> > feature-disable success
>
> > At this point my Eclipse behaves as though the Google SDK is NOT
> > installed.  For example, the Google Icons are NOT displayed in the
> > Toolbar, etc.  From the above install history, it appears the
> > following are enabled and the older version have been disabled:
>
> > com.google.gwt.eclipse.sdkbundle.e33.feature_1.7.0.v200907131018
> > com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.5.v200909021033
> > com.google.gdt.eclipse.suite.e33.feature_1.1.0.v200907291650
>
> > How do I get this SDK working again?- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Master/Detail relations and redundant data handling

2009-09-06 Thread James H

Based on the Max Ross I/O video on Persistence, I understand the best
practice regarding handling of Master/Detail relations is to place
redundant Master data in the Detail row.  Same would apply to any type
of relation (1-to-1, 1-to-many).

So for example if I have an entity Person relating as 1-to-many with
another entity Address, then instead of just a simple FK like
Address.personId I am supposed to also include redundant fields like
Address.lastName, Address.firstName and so on depending on how I
display/process on Address data in the app.  Therefore, when reading
Address data I would NOT necessarily have to perform another read to
the Master just to get LastName/FirstName, etc.

The problem is if I have 10 such relations with Person and JDO does
NOT allow me to declare an object we'll call PersonFK containing these
fields (personId, lastName, firstName, etc), then we quickly have a
code maintenance nightmare for our app since any significant app can
have 100's of FKs to manage and all these fields will NOT be coded in
an Object Oriented sense.

So in my example, if I have to add another redundant field for Person
FKs such as SSN or change behavior of any existing one of these
redundant fields for Person, then I have at least 10 touchpoints in
the app to deal with, where good OO design mandates I should only have
1 touchpoint.

Is this true or have I overlooked a feature in GAE JDO implementation
that is NOT mentioned in the GAE docs?

The closest concept indicated in the GAE docs are the Embedded Classes
which only apply to 1 Entity...so they are quite useless from an OO
perspective across many objects.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Upgrade issue with Google SDK 1.2.5

2009-09-06 Thread James H

I used the Eclipse Soft Updates menu on Sep 4th to apply SDK 1.2.5
after noticing Red errors in the local runtime log telling me to do
so.  Actually, first I noticed my production app was failing to
retrieve data so I figured I needed to first upgrade as instructed by
the log message and then see if there were still any data issues.

I had been running SDK 1.2.2 since July without problems locally or in
production.  The install of the upgrade ran without errors.  Here is
the Eclipse install history:

Jul 12, 2009 1:24:28 PM file:/C:/homeGoogle/programs/eclipse/ site-
install success

Jul 12, 2009 1:49:03 PM
Date / Time Target Action Status
Jul 12, 2009 1:48:12 PM
com.google.gdt.eclipse.suite.e33.feature_1.0.1.v200905131156 feature-
install success
Jul 12, 2009 1:48:26 PM
com.google.gdt.eclipse.suite.e33.feature_1.0.1.v200905131156 feature-
enable success
Jul 12, 2009 1:48:26 PM
com.google.gwt.eclipse.sdkbundle.e33.feature_1.6.4.v200904062254
feature-install success
Jul 12, 2009 1:49:03 PM
com.google.gwt.eclipse.sdkbundle.e33.feature_1.6.4.v200904062254
feature-enable success

Jul 12, 2009 1:50:20 PM
Date / Time Target Action Status
Jul 12, 2009 1:50:06 PM
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.1.v200905131156
feature-install success
Jul 12, 2009 1:50:20 PM
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.1.v200905131156
feature-enable success

Jul 24, 2009 10:01:27 PM
Date / Time Target Action Status
Jul 24, 2009 10:01:01 PM
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.2.v200907131018
feature-install success
Jul 24, 2009 10:01:27 PM
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.2.v200907131018
feature-enable success
Jul 24, 2009 10:01:27 PM
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.1.v200905131156
feature-disable success

Sep 4, 2009 6:27:25 AM
Date / Time Target Action Status
Sep 4, 2009 6:26:51 AM
com.google.gdt.eclipse.suite.e33.feature_1.1.0.v200907291650 feature-
install success
Sep 4, 2009 6:27:12 AM
com.google.gdt.eclipse.suite.e33.feature_1.1.0.v200907291650 feature-
enable success
Sep 4, 2009 6:27:12 AM
com.google.gdt.eclipse.suite.e33.feature_1.0.1.v200905131156 feature-
disable success
Sep 4, 2009 6:27:12 AM
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.5.v200909021033
feature-install success
Sep 4, 2009 6:27:25 AM
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.5.v200909021033
feature-enable success
Sep 4, 2009 6:27:25 AM
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.2.v200907131018
feature-disable success

Sep 5, 2009 11:13:51 AM
Date / Time Target Action Status
Sep 5, 2009 11:12:38 AM
com.google.gwt.eclipse.sdkbundle.e33.feature_1.7.0.v200907131018
feature-install success
Sep 5, 2009 11:13:48 AM
com.google.gwt.eclipse.sdkbundle.e33.feature_1.7.0.v200907131018
feature-enable success
Sep 5, 2009 11:13:48 AM
com.google.gwt.eclipse.sdkbundle.e33.feature_1.6.4.v200904062254
feature-disable success

At this point my Eclipse behaves as though the Google SDK is NOT
installed.  For example, the Google Icons are NOT displayed in the
Toolbar, etc.  From the above install history, it appears the
following are enabled and the older version have been disabled:

com.google.gwt.eclipse.sdkbundle.e33.feature_1.7.0.v200907131018
com.google.appengine.eclipse.sdkbundle.e33.feature_1.2.5.v200909021033
com.google.gdt.eclipse.suite.e33.feature_1.1.0.v200907291650

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



[appengine-java] Re: Best practice for Joins and JDO

2009-09-03 Thread James H

Actually, I'm only going primarily by what Max Ross talked about in
his JDO Persistence video at the I/O conference...

On Aug 15, 7:36 pm, objectuser  wrote:
> You're obviously beyond my understanding then.
>
> On Aug 15, 6:25 pm, James H  wrote:
>
>
>
> > Thanks, I've been thru those very docs and they are too basic and do
> > NOT contain most of the real world scenarios such as I'm speaking of.
> > For example, if you listen to the Ross I/O video on Persistence he
> > talks about the FK technique where you purposefully include additional
> > fields from your Master record in with the Foreign record so that you
> > do NOT have to query the Master when querying the Foreign rows...like
> > you say, there are NO joins.  The Audit fields I sited above are an
> > even more basic illustration of the case, every Entity needs them so
> > why cut/paste this field/code set across 100 Entity when you can let
> > OO do the work...
>
> > The closest concept the docs you sited references are the Embedded
> > Classes which only apply to 1 Entity...so they are quite useless from
> > a OO perspective.  Matter of fact, even this includes a naming hack to
> > serve its purpose of reuse.  My hunch is what I need is NOT supported
> > and if it was supported, this Embedded hack would be deprecated.
>
> > The next closest example from your link would be where the Employee
> > contains a field ContactInfo, but that does NOT apply here since it is
> > for the case where ContactInfo is a separate Entity.
>
> > I thought the concept would be obvious, but I will gladly post some
> > code to help illustrate my problem.  This question arose from design
> > talks, so the code is lagging behind a bit.
>
> > J
>
> > On Aug 15, 3:12 pm, objectuser  wrote:
>
> > > I really think you should read through the google documentation.  It's
> > > good stuff and can get you started with the concepts.  I go back to it
> > > over and over again because this stuff is very different for me.
> > > Here's the link to the datastore docs, but there is great stuff under
> > > the Articles section as well:
>
> > >http://code.google.com/appengine/docs/java/datastore/
>
> > > You can have keys pointing to other entities and that's certainly an
> > > important practice in GAE.  In your first example, Address can contain
> > > a key (or a collection of keys) to Person.  So that's available to you
> > > and you can query on that.  I don't really know what you're talking
> > > about with the PersonFK thing ...
>
> > > I'm also happy to talk more about your models.  But I'm not sure I get
> > > them. :)  Want to post a bit of code so everyone here can really get
> > > what you're trying to do?
>
> > > On Aug 15, 2:04 pm, James H  wrote:
>
> > > > Ok, replace "minimize" with "eliminate" in the 2nd sentence...but the
> > > > root of the problem is still the same.  Can this JDO implementation
> > > > handle 2 or more Entities each containing a field using the same FK
> > > > Object as in my hypothetical (it would contain the actual key plus
> > > > extra fields)?
>
> > > > I'd love to see an example of that, matter of fact that should be in
> > > > the standard set of examples...take for example Audit fields like
> > > > createdByUser, createdDate, modifiedByUser, and modifiedDate.  These
> > > > fields should be on every entity and if you can't create an object
> > > > like DataAudit and either have it as part of the parent class or at
> > > > least a field of type DataAudit that would persist properly then guess
> > > > what...we have increased time/labor involved in developing/maintaining
> > > > the app.  Same applies to this FK scenario.
>
> > > > If you know of an example, please shoot me a link!
>
> > > > On Aug 15, 12:00 pm, objectuser  wrote:
>
> > > > > Man, you're missing a lot.  Joins are in no way supported in GAE
> > > > > so ... yeah, you really do have to minimize them.
>
> > > > > There are a ton of good discussions in the group about alternatives.
>
> > > > > On Aug 15, 11:57 am, James H  wrote:
>
> > > > > > Am I missing something?  I hear the best practice regarding Joins is
> > > > > > to minimize them by placing redundant data with the FK.  So for
> > > > > > example if I have an entity Person relating as 1-to-man

[appengine-java] Re: Weird ArrayStoreException after new deployment to production

2009-08-20 Thread James H

Ah yes, I was looking for that very switch to disable Sessions and it
did help isolate the problem towards a field within my class being
pushed into the Session.  The field is java.text.SimpleDateFormat
which does implement Serializable so don't know why the system would
be able to serialize it, then NOT be able to deserialize it.  I think
for now I will tag it as Transient and re-init it before use.

On Aug 19, 10:17 am, Toby Reyelts  wrote:
> Unfortunately, I don't understand exactly why the problem is still occurring
> for you. The stacktrace you shared points directly to failure of
> deserialization of a session attribute:
>
>        
>        at java.io.ObjectInputStream.readObject0(Unknown Source)
>        at java.io.ObjectInputStream.readObject(Unknown Source)
> *       at com.google.apphosting.runtime.**jetty.SessionManager.**
> deserialize(SessionManager.java:358)
> *       at
> com.google.apphosting.runtime.jetty.SessionManager.loadSession(SessionManag­er.java:280)
>        
>
> Are you absolutely sure you're not putting something into the HttpSession?
> The two steps I would take are to:
>
> 1) disable http sessions in appengine-web.xml then
> 2) delete all http sessions saved in the datastore
>
> On Wed, Aug 19, 2009 at 10:45 AM, James H wrote:
>
>
>
>
>
> > Ok, I reviewed my use of Session attribute (I only use 1 called
> > userSession) and cleaned up a few things such as the serial UID, etc.
> > During production testing, I also Deleted the _ah_Session rows and I
> > notice the problem still occurred on the home page as before.  So, I
> > modified the app to NOT perform any session.put() calls.  And this
> > same exception is still occurring.
>
> > The behavior is as follows.  Launch a new browser and the home page
> > comes up, try to Refresh the home page and the exception gets thrown.
> > Is it possible the deploy is NOT refreshing ALL my code in
> > production?  Is there a way to force the deploy to do a truncate/load
> > rather than an incremental?  I hate to think there are some stale
> > classes out there being loaded somehow...
>
> > So, as before I do NOT see any relation at this point between this
> > error and my coding.  From the trace, the error is NOT occurring
> > within the scope of my code.  Any other ideas?
>
> > On Aug 18, 6:42 pm, Toby Reyelts  wrote:
> > > You probably have something stored in your session that's not
> > deserializing.
> > > If you clear your sessions, this problem should go away. In the next
> > > release, this problem should be fixed under most circumstances.
>
> > > On Tue, Aug 18, 2009 at 6:05 PM, James H 
> > wrote:
>
> > > > My app has been working well, but after this weekends changes my
> > > > deployment does NOT come online clean...though I can't related the
> > > > error to anything that has changed.  The stack trace is attempting to
> > > > load the JSP, so it doesn't appear the problem is related to running
> > > > the JSP.  Hence, execution has NOT reached my code!  Any ideas?
>
> > > > Naturally, all works fine during local testing.  So, this is only
> > > > failing in production.
>
> > > > EXCEPTION
> > > > javax.servlet.ServletException: java.lang.ArrayStoreException:
> > > > [Ljava.lang.String;
> > > >        at
> > com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
> > > > (AppVersionHandlerMap.java:239)
> > > >        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.serviceReques­­t
> > > > (JettyServletEngineAdapter.java:139)
> > > >        at com.google.apphosting.runtime.JavaRuntime.handleRequest
> > > > (JavaRuntime.java:235)
> > > >        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > > > $6.handleBlockingRequest(RuntimePb.java:4

[appengine-java] Re: session vs memcache

2009-08-19 Thread James H

Correct me if I'm wrong, but memcache is purely memory only whereas
Session is persisted to the datastore for the life of the session
which may involve multiple servers depending on routing of your
requests.  This would be typical Session behavior for Clustering.
Whereas memcache can be refreshed anytime during your session, the
actual Session data should survive for the full session.  Naturally,
memcache is faster access since NO datastore is involved.  Sounds
kinda obvious, I'm sure others add the not so obvious and enlighten
both of us further.

On Aug 19, 2:46 pm, repairman  wrote:
> hi I am writting a jsp application calling java classes to get data
> from the gae database such as product information.  I then save the
> information into the session.   so the question is what is the
> difference between saving the data into session vs memcache?   aren't
> they the same conceptually?     I guess memcache is common amongst all
> sessions, is that the only difference?  please give best practice.
>
> And also after I post to the forum does it automatically send me an
> email if my posting is updated?  or do I have to set some settings in
> the subscription?
>
> thanks 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-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: Weird ArrayStoreException after new deployment to production

2009-08-19 Thread James H

Ok, I reviewed my use of Session attribute (I only use 1 called
userSession) and cleaned up a few things such as the serial UID, etc.
During production testing, I also Deleted the _ah_Session rows and I
notice the problem still occurred on the home page as before.  So, I
modified the app to NOT perform any session.put() calls.  And this
same exception is still occurring.

The behavior is as follows.  Launch a new browser and the home page
comes up, try to Refresh the home page and the exception gets thrown.
Is it possible the deploy is NOT refreshing ALL my code in
production?  Is there a way to force the deploy to do a truncate/load
rather than an incremental?  I hate to think there are some stale
classes out there being loaded somehow...

So, as before I do NOT see any relation at this point between this
error and my coding.  From the trace, the error is NOT occurring
within the scope of my code.  Any other ideas?

On Aug 18, 6:42 pm, Toby Reyelts  wrote:
> You probably have something stored in your session that's not deserializing.
> If you clear your sessions, this problem should go away. In the next
> release, this problem should be fixed under most circumstances.
>
>
>
> On Tue, Aug 18, 2009 at 6:05 PM, James H  wrote:
>
> > My app has been working well, but after this weekends changes my
> > deployment does NOT come online clean...though I can't related the
> > error to anything that has changed.  The stack trace is attempting to
> > load the JSP, so it doesn't appear the problem is related to running
> > the JSP.  Hence, execution has NOT reached my code!  Any ideas?
>
> > Naturally, all works fine during local testing.  So, this is only
> > failing in production.
>
> > EXCEPTION
> > javax.servlet.ServletException: java.lang.ArrayStoreException:
> > [Ljava.lang.String;
> >        at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
> > (AppVersionHandlerMap.java:239)
> >        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.serviceReques­t
> > (JettyServletEngineAdapter.java:139)
> >        at com.google.apphosting.runtime.JavaRuntime.handleRequest
> > (JavaRuntime.java:235)
> >        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:4823)
> >        at com.google.apphosting.base.RuntimePb$EvaluationRuntime
> > $6.handleBlockingRequest(RuntimePb.java:4821)
> >        at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
> > (BlockingApplicationHandler.java:24)
> >        at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
> > 359)
> >        at com.google.net.rpc.impl.Server$2.run(Server.java:820)
> >        at com.google.tracing.LocalTraceSpanRunnable.run
> > (LocalTraceSpanRunnable.java:56)
> >        at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan
> > (LocalTraceSpanBuilder.java:516)
> >        at com.google.net.rpc.impl.Server.startRpc(Server.java:775)
> >        at com.google.net.rpc.impl.Server.processRequest(Server.java:348)
> >        at com.google.net.rpc.impl.ServerConnection.messageReceived
> > (ServerConnection.java:436)
> >        at com.google.net.rpc.impl.RpcConnection.parseMessages
> > (RpcConnection.java:319)
> >        at com.google.net.rpc.impl.RpcConnection.dataReceived
> > (RpcConnection.java:290)
> >        at com.google.net.async.Connection.handleReadEvent(Connection.java:
> > 428)
> >        at com.google.net.async.EventDispatcher.processNetworkEvents
> > (EventDispatcher.java:762)
> >        at com.google.net.async.EventDispatcher.internalLoop
> > (EventDispatcher.java:207)
> >        at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
> > 101)
> >        at com.google.net.rpc.RpcService.runUntilServerShutdown
> > (RpcService.java:251)
> >        at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run
> > (JavaRuntime.java:374)
> >        at java.lang.Thread.run(Unknown Source)
> > Caused by: java.lang.ArrayStoreException: [Ljava.lang.String;
>

[appengine-java] Weird ArrayStoreException after new deployment to production

2009-08-18 Thread James H

My app has been working well, but after this weekends changes my
deployment does NOT come online clean...though I can't related the
error to anything that has changed.  The stack trace is attempting to
load the JSP, so it doesn't appear the problem is related to running
the JSP.  Hence, execution has NOT reached my code!  Any ideas?

Naturally, all works fine during local testing.  So, this is only
failing in production.

EXCEPTION
javax.servlet.ServletException: java.lang.ArrayStoreException:
[Ljava.lang.String;
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
(AppVersionHandlerMap.java:239)
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:139)
at com.google.apphosting.runtime.JavaRuntime.handleRequest
(JavaRuntime.java:235)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:4823)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:4821)
at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
359)
at com.google.net.rpc.impl.Server$2.run(Server.java:820)
at com.google.tracing.LocalTraceSpanRunnable.run
(LocalTraceSpanRunnable.java:56)
at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan
(LocalTraceSpanBuilder.java:516)
at com.google.net.rpc.impl.Server.startRpc(Server.java:775)
at com.google.net.rpc.impl.Server.processRequest(Server.java:348)
at com.google.net.rpc.impl.ServerConnection.messageReceived
(ServerConnection.java:436)
at com.google.net.rpc.impl.RpcConnection.parseMessages
(RpcConnection.java:319)
at com.google.net.rpc.impl.RpcConnection.dataReceived
(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:
428)
at com.google.net.async.EventDispatcher.processNetworkEvents
(EventDispatcher.java:762)
at com.google.net.async.EventDispatcher.internalLoop
(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
101)
at com.google.net.rpc.RpcService.runUntilServerShutdown
(RpcService.java:251)
at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run
(JavaRuntime.java:374)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayStoreException: [Ljava.lang.String;
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.util.HashMap.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.i