MemcacheServiceException in GAEApplicationServlet

Hi all.
I’ve made a basic vaadin app which is an extension of the tutorial app (my app keep track of wine instead of contacts…)
For each wine the user can upload an image, I used the code suggested
here
. I don’t know when exactly (or why) my problem occurs but it’s definitely has something to do with image size and storing of vaadin application context. My best way to reproduce it is simply to upload a number of pictures (I guess any filetype would do) and at some point the my dev-server goes berzerk. First I get an exception and after an infinite loop starts, calling transactionStart on my TransactionListener over and over again (see the attached stacktrace). Any leads on how I should do to avoid this is appreciated! Don’t hesitate to ask for more info.

br
Svante
11310.txt (6.28 KB)

Hi,

It seems like your images are kept in the session (in memory), and it has grown too large to store in the memcache… Could this be the case? If so, the trick would be not to keep the image data in memory…

Best Regards,
Marc

Most certainly! Then the question is how to achieve that? I display the image upload panel as a sub-window. I don’t store any references to previously uploaded images if the user chooses to upload another file.

And still, even if I somehow put too much data in the ApplicationContext it should probably not cause the loop to occur.

br
Svante

I think and hope that my problem was that I created a new StreamResource for every attempt to upload a file, even though I didn’t store the reference in my app it was still registered with the application and stored in the session. If someone can confirm that this is the case I would be more than happy.

br
Svante

Nope, unfortenately I was wrong when I thought I’d solved the problem. The exception mentioned earlier com.google.apphosting.api.ApiProxy$RequestTooLargeException: The request to API call memcache.Set() was too large can get thrown even before my implementation of public void uploadSucceeded(Upload.SucceededEvent event) has returned (obviously not in the same thread). My last approach was to persist the image (and only keep the key in the session) in the uploadSucceeded method. If someone has a suggestion for solving this I will be forever thankful!

br
Svante

Problem solved! My problem was that I read to much data from db at user login (since GAE doesn’t support lazy loading) wich caused my problem later on. My bad.:*)