[appengine-java] Re: Snapshots...

2011-09-27 Thread Didier Durand
Hi,

I do personally scan each entity type via an ad hoc request and store
each instance as entry in an xml file stored in the blobstore.

You can then externalize it via download from another machine.

Another possible way is to store you data on Amazon S3: you can then
also store them 1 by 1 if you wish so.

regards

didier

On Sep 27, 11:45 pm, Daniel Viveiros vivei...@ciandt.com wrote:
 Hi all,

 What's the best way to take snapshots of the GAE's database in a way it's
 possible to backup/restore it if needed?

 Thanks,
 Daniel V.

-- 
You received this message 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: How to detect the event of instantiating another instance of app

2011-09-13 Thread Didier Durand
Hi,

You could try (didn't do it myself) the load-on-startup param with a
value  0 in the servlet definition of a given servlet within
web.xml

This starts the servlet when the application is deployed in starting
container.

That should allow you to do what you want

regards

didier

On Sep 13, 11:29 pm, Art art...@gmail.com wrote:
 Dear group,

 I would like to know whether there is way to detect the event of
 instantiating another instance of app.
 I need to detect it to trigger clearing local cache what I like to put as a
 layer before memcache.
 Because it's the local cache, I like to simply clear it for sychronization
 reason when another instance of app is instantiated.

 Regards,
 Art

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Is memcached also lost when all instances are pulled off?

2011-09-09 Thread Didier Durand
Hi,

The survival of content of memcache is not garanteed by the specs of
GAE: it can disappear at any time.
Those specs say: However, when considering whether to store a value
solely in the memcache and not backed by other persistent storage, be
sure that your application behaves acceptably when the value is
suddenly not available. Values can expire from the memcache at any
time, and may be expired prior to the expiration deadline set for the
value. see 
http://code.google.com/appengine/docs/java/memcache/overview.html#When_to_Use_a_Memory_Cache

Consequently, it can disappear when no instance is present. As such,
it's a feature.

So, your apps should be ready to recreate it at any time.

regards

didier


On Sep 10, 5:04 am, Bendanpa benda...@gmail.com wrote:
 Hi,

 I got a issue with my app. I load a object into memcache. If i keep at least
 one instance alive then the memcache stay ok. I also noticed when all
 instances are killed then the memcache is also gone. Can someone confirm my
 observation.

 Hi Googlers, is this a bug or feature?

 Thanks,
 Bendanpa

-- 
You received this message 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: Delete Lots Of Data

2011-09-09 Thread Didier Durand
If you don't want to introduce MapReduce solely for this purpose, you
can write a queued task that loops through the data to delete it 
and that recreates a new instance of itself just before time limit (10
min) to continue the deletion.

regards

didier

On Sep 9, 8:37 pm, Marcelo Liberato mliber...@gmail.com wrote:
 You may use MapReduce programmatically or just use Datastore admin (which
 uses mapreduce behind the scenes).

 On Thu, Sep 8, 2011 at 12:30 PM, blitzer brian.blit...@gmail.com wrote:
  So I have ~ 35 million rows of data. I have seen that I need to get the
  data into a collection and then call deletePersistAll(). Is that the only
  way?

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



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



[appengine-java] Re: How to create excel file in servlet for google app engine application?

2011-09-05 Thread Didier Durand
Hi,

Another way to do it is to use the spreadsheet api of Google Docs and
send your users there (they can retrieve the web spreadsheet as a file
if needed)

See http://code.google.com/apis/spreadsheets/

regards

didier

On Sep 5, 7:57 pm, Marcelo Liberato mliber...@gmail.com wrote:
 You should try Apache POI:http://poi.apache.org/

 On Sep 5, 7:24 am, Sawan Darekar sawan.dare...@alphabricks.com
 wrote:

  i am developing cloud application which is hosted on google app engine and
  in this i want to *generate excel file* on click of button through servlet.

  i have done it on local machine but when i deploy my application on app
  engine it shows error HTTP Error 500 Internal server error

  i am using *jxl java api* for generating excel file

  code that i have used is here

  try
  {

    //i have used following content type but didn't worked.

    //response.setContentType(application/vnd.ms-excel);

    //response.setContentType(application/x-ms-excel);

    response.setContentType(application/CSV);

    WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream());

    WritableSheet s = w.createSheet(Demo, 0);

    Label label = new Label(0, 2, A label record);

    s.addCell(label);

    w.write();

    w.close();}

  catch (Exception e)
  {

        response.getOutputStream().println(Exception :+e);}

  finally
  {

  }

  --
  Thanks  Regards,
  Raj



-- 
You received this message 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: Advice for looping through 100K records and updating multiple entities on each iteration

2011-08-25 Thread Didier Durand
Hi,

Yes, for such a task you will have to go via the Task Queue: an
interactive task of this size would for sure reach the allowed limits.

The way it works is : read an entity, do the updates, check the
duration since start, if far from limit process another entity, if
close to limit, reschedule a new task with next entity to be processed
as starting point.

Via the task queue, you will gain another advantage: parallelism, you
can scan your data with more than 1 task and then complete the job
much faster. Be careful about contention on the datastore though! (to
avoid, you should split your key range in N chunks and affect a task
to each chunk)

regards

didier

On Aug 25, 7:31 am, Baz b...@thinkloop.com wrote:
 Hello,

 I have a non-user triggered process that queries the datastore for a dataset
 of about 100k records, then loops through each record to update two other
 entities in the datastore. What would be a good way to go about doing this?
 I'm concerned about timing out and/or consuming more resources than I need
 to. Task queue?

 Cheers.

-- 
You received this message 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: Correlative number

2011-07-23 Thread Didier Durand
Hi,

have a look at this: 
http://code.google.com/appengine/articles/sharding_counters.html

regards

didier

On Jul 22, 9:45 pm, katy ktu...@gmail.com wrote:
 Im trying to get a kind of auto increment number for an entity. I all
 ready create a counter class to take a track of the quantity of
 entities so i can use the counter to get a correlative number , but
 its not working the right way, so  wonder if anybody know how to
 implement these and if its posible to use a kind of mutex to block
 code.

 Thank, you.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Reading static XML file on App Engine

2011-07-19 Thread Didier Durand
Hi,

Did you properly set up auths for access to static content

See 
http://code.google.com/appengine/docs/java/config/appconfig.html#Static_Files_and_Resource_Files

regards

didier

On Jul 18, 9:37 pm, bb bayc...@gmail.com wrote:
 Hello,
 I have a static XML file in my App Engine app that uploads just fine and I
 am trying to read it for some rules based execution logic, but the below
 error is thrown at me:

 Caused by: java.security.AccessControlException: access denied
 (java.io.FilePermission /war/WEB-INF/StaticContent.xml read)
 at
 java.security.AccessControlContext.checkPermission(AccessControlContext.java:393)
 at java.security.AccessController.checkPermission(AccessController.java:553)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
 at
 com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166)
 at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
 at java.io.FileInputStream.init(FileInputStream.java:130)
 at java.io.FileInputStream.init(FileInputStream.java:96)

 I tried placing the file both directly in the war and in the war/WEB-INF
 directories, the problem persists. The code on the server that attempts to
 read the file is as simple as this:

 final FileInputStream fis = new
 FileInputStream(/war/WEB-INF/StaticContent.xml);

 According to this article, I am doing everything 
 correctly:http://code.google.com/appengine/kb/java.html#readfile

 Any help will be much appreciated.

-- 
You received this message 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: Reading static XML file on App Engine

2011-07-19 Thread Didier Durand


On Jul 19, 10:53 am, Simon Knott knott.si...@gmail.com wrote:
 Oops, read that link without any coffee!  It obviously states that you 
 *can*use the FileInputStream class - have you tried dropping the war bit off
 your filepath?

-- 
You received this message 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: Help...How to convert png to jpg? Every time got black/orange background...

2011-07-19 Thread Didier Durand
Hi,

Then, you should open an issue to get it fixed

regards

didier

On Jul 19, 11:24 pm, Zhenyu wingzer...@gmail.com wrote:
 Hi Didier,

 It is PNG.
 You can change any other PNG images to test.

 GAE can NOT handle transparent when convert PNG to JPEG.

 Regards,

 On Jul 18, 6:34 pm, Didier Durand durand.did...@gmail.com wrote:

  Hi,

  did you check oldImage.getFormat() to make sure that the initial PNG
  format is properly detected ?

  regards

  didier

  On Jul 18, 7:39 am, Zhenyu Wang wingzer...@gmail.com wrote:

   String iUrl = 
   http://upload.wikimedia.org/wikipedia/commons/5/5c/Torchlight_help.png;;
   URLFetchService fetchService = 
   URLFetchServiceFactory.getURLFetchService();
   HTTPResponse fetchResponse = fetchService.fetch(new URL(iUrl));

   byte[] oldImageData = fetchResponse.getContent();
   Image oldImage = ImagesServiceFactory.makeImage(oldImageData);

   ImagesService imagesService = ImagesServiceFactory.getImagesService();
   Transform resize = ImagesServiceFactory.makeRotate(0);
   OutputSettings os = new OutputSettings(ImagesService.OutputEncoding.JPEG);
   Image newImage = imagesService.applyTransform(resize, oldImage, os);
   byte[] newImageData = newImage.getImageData();

   res.setContentType(image/jpeg);
   res.getOutputStream().write(newImageData);



-- 
You received this message 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: does Google+ use GAE ?

2011-07-18 Thread Didier Durand
Hi,

J. Smarr, tech lead for G+,  says: Our backends are built mostly on
top of BigTable and Colossus/GFS in this short description of Google+
insfrastructure: 
http://www.quora.com/Can-someone-provide-some-information-about-Google+-infrastructure-architecture.

regards

didier

On Jul 19, 6:57 am, J.Ganesan j.gane...@datastoregwt.com wrote:
 I am curious to know the persistence engine used by Google +. Is it
 not Google App Engine ?

 J.Ganesan

-- 
You received this message 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: How to ensure two entities are updated WITHOUT using transactions?

2011-07-10 Thread Didier Durand
Hi,

Have a look at this to understand the issues:
http://blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine

regards

didier

On Jul 10, 11:09 pm, mscwd01 mscw...@gmail.com wrote:
 Hey

 I'm using JDO and need to update two entities both of which reside in
 their own entity group. As I cannot use a transaction, I'd like to
 determine how others achieve this. It is imperative that both entities
 are updated or none at all.

 Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: JDO: 1-N relationships

2011-06-24 Thread Didier Durand
Hi,

If you look at the recent recommandations of Google, the 1st best
practice is probably to move away from JDO and go to either low-level
API or some 3rd party package like Objectify (my choice) to give you
good long-term perspectives.

regards

didier

On Jun 24, 9:47 am, Martin Newstead skankmar...@hotmail.com wrote:
 I would like some help and advice on how to model my entities using
 JDO on GAE. My problem is this, I have a bunch of Users and each User
 may create zero or more Tracks. Users may exist without a Track but
 Tracks may not exist without a User who created them. Other attributes
 on the User and the Track may updated. I would like to be able to
 query the Tracks and retrieve some attributes from the User who
 created the Track. The attributes from the User may get updated. In
 SQL this would be

 select u.displayName, t.trackName from User u, Track t, where
 t.userId=u.userId

 I have some ideas and have tried various things but this isn't a post
 on why doesn't something work, more of what is the best practice to
 solve this problem.

 thanks M

-- 
You received this message 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: GAE heartbeat, notifications, parsing dashboard

2011-06-23 Thread Didier Durand
Hi Toby,

The (new) capabilities API should help:
http://code.google.com/appengine/docs/java/capabilities/overview.html

regards

didier

On Jun 23, 8:39 am, Toby toby.ro...@gmail.com wrote:
 Hi,
 I do frequently experience some problems with my app. Errors going up
 or an unusual traffic load or whatsoever. I often find these kind of
 issues by checking the dashboard from time to time.
 I would like some automatic notification that gives me e.g. an email
 alert when some threashold is exeeded. I also run multiple instances
 and it would be good to have one view that combines the status of all
 of them.
 It is probably easy to parse the html and build an app that does what
 I want. But before starting I wonder what you think and if there is a
 better way to do. E.g. is there an API to the dashboard?
 Cheers,
 Toby

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: GAE heartbeat, notifications, parsing dashboard

2011-06-23 Thread Didier Durand
Hi Toby,

Does http://code.google.com/appengine/docs/java/tools/appstats.html
help more ?
regards

didier

On Jun 23, 1:57 pm, Toby toby.ro...@gmail.com wrote:
 Hello Didier,

 thanks for the reply. The capabilites API gives info about general GAE
 infrastructure problems. What I want to monitor ist the health of the
 application itself. The dashboard gives most of the vital data needed
 and I just want to have a scheduled job that keeps checking them to
 alert me by mail if a severe problem occurs.
 So I am looking more or less for an API to retrieve the information
 displayed on the dashboard (load, quota, requests with the most errors
 etc.).

 Cheers,
 Toby

 On Jun 23, 12:15 pm, Didier Durand durand.did...@gmail.com wrote:

  Hi Toby,

  The (new) capabilities API should 
  help:http://code.google.com/appengine/docs/java/capabilities/overview.html

  regards

  didier

  On Jun 23, 8:39 am, Toby toby.ro...@gmail.com wrote:

   Hi,
   I do frequently experience some problems with my app. Errors going up
   or an unusual traffic load or whatsoever. I often find these kind of
   issues by checking the dashboard from time to time.
   I would like some automatic notification that gives me e.g. an email
   alert when some threashold is exeeded. I also run multiple instances
   and it would be good to have one view that combines the status of all
   of them.
   It is probably easy to parse the html and build an app that does what
   I want. But before starting I wonder what you think and if there is a
   better way to do. E.g. is there an API to the dashboard?
   Cheers,
   Toby



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: How to download indexes from the data store ?

2011-06-23 Thread Didier Durand
Hi,

Why would you do such a thing: if you don't want the indexes anymore,
you deleted them. When you need them again in the future, you just
rebuild them: the entities present in your datastore will redefine the
new index entries.

Indexes are anyway not accessible as such but if they were, it would
be dangerous to download and upload them again: they could be
inconsistent with the entities in your datastore if they had changed
inbetween.

regards

didier

On Jun 23, 1:45 pm, Santosh kumar kopp@gmail.com wrote:
 Hi,

 I want to vacuum the unused indexes from the data store.
 But before vacuum i want to download the existing indexes from the data
 store ?

 Is their any way to download the indexes from the data store ?

 Any suggestions are appreciated :)

 --
 Thanks  Regards
 *Santosh kumar . k***

-- 
You received this message 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: Is App Engine having problems? Cant load specific kind of Entity

2011-06-22 Thread Didier Durand
Hi,

Don't you have some datastore entities that are used in every request
or so? Let's say a global counter of requests or sthg equivalent.

That entity would be updated in every request, hence the contentions
as you trafic raises.

regards

ddoer

On Jun 22, 11:59 pm, mscwd01 mscw...@gmail.com wrote:
 Okay I just got a single log entry pop up that may offer some insight
 to the problem. It reads:

 Too much contention on these datastore entities. please try again.

 I have noticed a slight increase to the number of requests received
 today (so far 40k), could it be some unforeseen issue that occurs only
 when I get a spike in traffic?

 On Jun 22, 10:52 pm, mscwd01 mscw...@gmail.com wrote:

  Hey

  I just noticed my app stopped working correctly so I opened the logs
  and went back as far as I could (about an hour) and I noticed my app
  wasn't able to load a specific kind of entity. Going by my current CPU
  usage it seems like the issue has been ongoing for several hours.

  Whilst trying to think of a solution to the problem (and trying to
  fathom why the problem would arise not having modified the app at
  all), I rechecked the logs and found the app had fixed itself and the
  specific entity kind was successfully being loaded.

  I have three kinds of entity used by my app and two out of three
  loaded fine.

  Has anyone else seen this happen to their apps? It's rather
  disconcerting not knowing why a problem arises and then magically
  fixes itself!



-- 
You received this message 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: null parent in bidirectional JPA OneToMany relation

2011-06-20 Thread Didier Durand
Hi,

If switching storing api is your way to go, also give a try to
Objectify.

regards

didier

On Jun 21, 3:24 am, J.Ganesan j.gane...@datastoregwt.com wrote:
 DataStoreGwt provides an alternative to JPA itself. Please see whether
 it suits your project.

 J.Ganesanwww.DataStoreGwt.com

 On Jun 19, 6:55 pm, Paolo temph...@googlemail.com wrote:

   Nobody?



-- 
You received this message 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: two accounts

2011-06-17 Thread Didier Durand
Hi,

you have a couple of things to do:

a) load your code in the new domain
b) transfer data from the datastore of appspot.com to datastore of
your new domaine
c) set a redirect from pages in appspot.com to your new domain.

When you see no more trafic on appspot.com acccount, you can then
close it.

To my knowledge,that's what you have to do to be able to do it alone
on your own side.

Now, maybe googlers can do it more directly (a simple rename) but I
don't know of the use of such procedure for regular gae developpers.

regards

didier

On Jun 18, 1:10 am, Steve steve.flenni...@gmail.com wrote:
 I created a Google App Engine application and deployed it at appspot.com.
 Then I decided to buy a domain name through Google Apps and use that with
 the site.  I cannot figure out how to use the new domain with the site.  I
 think my problem is that I now have two Google accounts, the original one
 with my appspot application and a new one with my new domain.  Any ideas on
 how to fix this?

-- 
You received this message 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: Newbie question: how to create the memcache across several instances

2011-06-15 Thread Didier Durand
Hi,

Memcache on GAE is based on JSR-107: see http://jcp.org/en/jsr/detail?id=107

The purpose of jsr 107 is Specifies API and semantics for temporary,
in memory caching of Java objects, including object creation, shared
access, spooling, invalidation, and consistency across JVMs

So, memcache is by construction shared across instances

regards

didier

On Jun 15, 8:13 pm, Inderjeet Singh inder...@gmail.com wrote:
 Hi Folks,

 Pardon the somewhat basic question, I did try going through various online
 guides but never really got the answer to this one.
 I am running app-engine with 3 instances. I share data across these
 instances using Memcache. What is the right way to instantiate it such that
 all three appengine instances end up writing to the same cache?

 Here is the code that I used:
  public static synchronized K, V MapK, V createMemcache(
       String cacheName, ReadableDuration inactivityTimeout, @Nullable
 CacheListener cacheListener) {
     try {
       CacheManager cacheMgr = CacheManager.getInstance();
       Cache cache = cacheMgr.getCache(cacheName);
       if (cache == null) {
         CacheFactory cacheFactory = cacheMgr.getCacheFactory();
         ImmutableMapString,Long env =
           ImmutableMap.of(GCacheFactory.EXPIRATION_DELTA_MILLIS,
 inactivityTimeout.getMillis());
         cache = cacheFactory.createCache(env);
         if (cacheListener != null) {
           cache.addListener(cacheListener);
         }
         cacheMgr.registerCache(cacheName, cache);
       }
       return cache;
     } catch (CacheException e) {
     }

 Any comments? Will this create the shared Memcache as I want it?

 Thanks
 Inder

-- 
You received this message 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: How to design an in-memory cache?

2011-06-14 Thread Didier Durand
Hi,

Why don't you just update() with the appropriate setPolicy() or delete
your items in the memcache when no longer needed ?

See  and 
http://code.google.com/appengine/docs/java/memcache/usingjcache.html#Configuring_the_Set_Policy
and 
http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/memcache/MemcacheService.html

regards

didier

On Jun 14, 5:25 pm, tempy fay...@gmail.com wrote:
 Hello all,
 I'm wondering if its possible to design a cache using data in static
 variables.  I have certain pieces of small and unchanging data, such
 as a banner for the top of the site whose contents might only change
 every couple of days.  This is perfect for storing in a static
 variable and falling back onto the memcache as necessary.  The one
 thing I don't know how to do is to clear that cache.  If I want to
 update that data, I can clear the memcache, but there's no way that I
 can think of to clear static data cache, other than to wait until a
 particular instance goes down, and who knows when that will happen.
 Any ideas?  Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Appengine whitelist: can all Interfaces be used?

2011-06-13 Thread Didier Durand
Hi,

Shape is not in the white list: all the classes part of it are
detailed here http://code.google.com/appengine/docs/java/jrewhitelist.html

regards

didier

On Jun 13, 4:27 am, Dieter Krachtus dieter.krach...@googlemail.com
wrote:
 Hi,

 I am relatively new to Java appengine but I can imagine why one needs
 something like a whitelist. Still I am wondering if (and if not, why)
 all Interfaces are in the whitelist?

 Just one 
 example:http://download.oracle.com/javase/1.4.2/docs/api/java/awt/Shape.html

 Cheers,
 Dieter

-- 
You received this message 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: Problem. How should i change the parent object of the child object ?

2011-06-13 Thread Didier Durand
Hi,

As the message says: you can't touch objects in more than 1 group in a
single transaction.

If it suits your needs you can put all the children of a Parent in a
single entity group defined by the Parent instance: see
http://code.google.com/appengine/docs/java/datastore/entities.html#Entity_Groups_and_Ancestor_Paths
for all details

regards

didier

On Jun 13, 12:36 pm, behappy kairatbm...@gmail.com wrote:
 Hello  everybody !
 I've got a problem,  can anyone help me please ?

 I have to persistent classes   Parent and Child. They look  like
 this :

 Parent {
 Key key;
 
 ListChild childs 
 

 }

 Child {

 Key key;
 
 Parent parent.
 .
 public void setParent(Parent parent){
 this.parent = parent;

 }
 }

 The code is:
 .
 transaction.begin();
 Parent new_parent = pm.getObjectById(new_parent_id);
 child.set(new_parent);
 pm.makePersistent(child);
 transaction.commit();
 ...

 After executing that code i've got a problem:

 can't operate on multiple entity groups in a single transaction.

 can't operate on multiple entity groups in a single transaction. found
 both Element {
      [java]   type: Category
      [java]   id: 2
      [java] }
      [java]  and Element {
      [java]   type: Category
      [java]   id: 4
      [java] }
      [java]     at
 com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
 36)
      [java]     at com.google.appengine.api.datastore.DatastoreApiHelper
 $1.convertException(DatastoreApiHelper.java:98)
      [java]     at
 com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:
 69)
      [java]     at com.google.appengine.api.datastore.FutureHelper
 $CumulativeAggregateFuture.get(FutureHelper.java:136)
      [java]     at com.google.appengine.api.datastore.FutureHelper
 $TxnAwareFuture.get(FutureHelper.java:213)
      [java]     at
 com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:
 67)
      [java]     at
 com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:
 71)
      [java]     at
 com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:
 58)
      [java]     at
 com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServiceImpl.java:
 55)
      [java]     at
 org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.get(RuntimeExceptionWrappingDatastoreService.java:
 64)
      [java]     at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePersistenceHandler.java:
 96)
      [java]     at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.get(DatastorePersistenceHandler.java:
 106)
      [java]     at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject(DatastorePersistenceHandler.java:
 478)
      [java]     at
 org.datanucleus.state.JDOStateManagerImpl.validate(JDOStateManagerImpl.java:
 4263)
      [java]     at
 org.datanucleus.ObjectManagerImpl.findObject(ObjectManagerImpl.java:
 2444)
      [java]     at
 org.datanucleus.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:
 1671)
      [java]     at
 org.datanucleus.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:
 1767)
      [java]     at
 org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager.getObjectById(DatastoreJDOPersistenceManager.java:
 73)
      [java]     at almatymaps.dao.CategoryDAO.getById(CategoryDAO.java:
 34)
      [java]     at
 almatymaps.servlets.UpdateMarker.doPost(UpdateMarker.java:67)
  ...

 Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: How do I migrate old data (change schema) in a deployed Java app?

2011-06-10 Thread Didier Durand
The data viewer is accessible from the management console in your
account: you can see what's in your datastore in all details.

regards

didier

On Jun 10, 5:12 am, Nathan Stiles stiles.nat...@gmail.com wrote:
 What is this DataViewer?  How do I use this?  Eclipse?

-- 
You received this message 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: How to completely delete the code for an application?

2011-06-05 Thread Didier Durand
Hi,

Check in the version management of the console how many versions of
your app still known by gae. More than 1 ?
regards

didier


On Jun 5, 10:07 am, Desarrollo VDK Guatemala devd...@gmail.com
wrote:
 Yep, I'm using a totally new version

-- 
You received this message 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: newbie question: redirect users (GWT 2.3.0)

2011-06-05 Thread Didier Durand
Hi,

yes, that should do the job.

regards

didier

On Jun 3, 8:13 am, meiaestro jmalbre...@gmx.de wrote:
 Hi!

 Thanks a lot for the helpful hints! Now let me see if I got it right. In my
 case I only have the entry point starting page.  Within this class I have
 three methods building three different UIs: register(), login(),
 startpage().

 Now I do the if in on onModuleLoad():

 if (sessionvalidation().equals(true)){
 startpage()}

 else {
 login();

 }

 On the login page you usually have a link for registration. How do I catch
 that? With the RequestBuilder?

 Thanks 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: Problem deleting an entity which has a dependent Set Entity

2011-06-05 Thread Didier Durand
Hi,

As a workaround, why don't you delete each entity in the set in a loop
by yourself before deleting the entity which the set is part of ?

regards

didier

On Jun 6, 1:48 am, mscwd01 mscw...@gmail.com wrote:
 Hey,

 I have a parent entity which has a Set of child entities, as
 follows:

 class Parent {

 @Persistent @Element(dependent = true)
 private SetChild children;

 }

 When I delete the Parent entity I get the following exception:

 javax.jdo.JDOUserException: Cannot read fields from a deleted object
 FailedObject:com.google.appengine.api.datastore.Key:Parent(1000345345456567676)/
 Child(2)

 It seems JDO deletes the Parent entity before the Child objects in
 the dependent Set property, which causes the above exception to appear
 when the Child entities in the Set are themselves deleted. Does anyone
 know how to solve this issue?

 FYI when I delete the parent entity I use pm.deletePersistent() within
 a transaction.

 Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: How to add task to pushQueue and when task will execute

2011-06-02 Thread Didier Durand
Hi,

Did you specifically read
http://code.google.com/appengine/docs/java/tools/localunittesting.html#Writing_Task_Queue_Tests
for local tests

Via the provided sample, you can access the scheduling params of your
task

regards


didier

On Jun 2, 2:04 pm, ramesh chiluverirame...@gmail.com wrote:
 Hi All,

 I am new to Google App Engine. I was trying to add task to queue.

 Its adding task to queue but task never gets executed.

 To add task to queue, i did following steps.

 1) created queue.xml as...

    queue-entries
   queue
     namereadwebsitequeue/name
     rate20/s/rate
     max-concurrent-requests1/max-concurrent-requests
   /queue
 /queue-entries

 2) created one servlet by extending HTTPServlet. (URL pattern in
 web.xml for this servlet is
     /testtask)
     inside doGet(),i written following code

       Queue q = QueueFactory.getQueue(readwebsitequeue);
       q.add(TaskOptions.Builder.withUrl(/test).param(key, 123));

 3) created one more servlet by extending HTTPServlet (URL pattern in
 web.xml for this servlet is
     /task)

     inside doGet(),i written my business logic say some sending
 emails.

 Now, when i execute my first servlet with url /testtask, it is adding
 task to queue . But when task(i.e test) will execute automatically?

 I am running it locally. I am able to see tasks 
 inhttp://localhost:/_ah/admin/taskqueue

 I am unable to understood document provided by google app engine.

 Please help me with example.

 Thanks
 Ramesh

-- 
You received this message 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: RuntimeException: Couldn't find MR with job ID: ... ??

2011-06-02 Thread Didier Durand
Hi,

Did you check the source code at
http://appengine-mapreduce.googlecode.com/svn/trunk/java/src/com/google/appengine/tools/mapreduce/AppEngineJobContext.java

the comments at the point where exception is thron may help you
understand why you get it

regards

didier

On Jun 2, 7:00 pm, Santosh kumar kopp@gmail.com wrote:
 Hi,

 Using mapper i am trying to allocate id's to the entities which are already
 in the name space. And i am using appengine-java-sdk-1.5.0.
 But when i run the mapper its throwing the exception. And i could not find
 what is the reason and also unable to stop the mapper ? what is this
 exception ?
 Is their any way to debug and find the reason behind this exception ?

    1. W2011-06-02 09:09:40.559

    /admin/mapreduce/mapperCallback
    java.lang.RuntimeException: Couldn't find MR with job ID:
 job_1307030934805_0001
         at 
 com.google.appengine.tools.mapreduce.AppEngineJobContext.getConfigurationFromRequest(AppEngineJobContext.java:157)
         at 
 com.google.appengine.tools.mapreduce.AppEngineJobContext.init(AppEngineJobContext.java:110)
         at 
 com.google.appengine.tools.mapreduce.MapReduceServlet.handleMapperWorker(MapReduceServlet.java:576)
         at 
 com.google.appengine.tools.mapreduce.MapReduceServlet.doPost(MapReduceServlet.java:174)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at 
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
         at 
 com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66)
         at 
 com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
         at 
 com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 com.veersoft.filter.ResetUserMessagesAndErrorsFilter.doFilter(ResetUserMessagesAndErrorsFilter.java:28)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
         at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
         at 
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
         at 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
         at 
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
         at 
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
         at 
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
         at 
 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
         at 
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at 
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
         at 
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
         at 
 com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at 
 com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
         at 
 com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:260)
         at 
 com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9669)
         at 
 com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:439)
         at 
 com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
         at 
 com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
         at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
         at 
 com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
         at 
 com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
         at 
 com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
         at 
 

[appengine-java] Re: newbie question: redirect users (GWT 2.3.0)

2011-06-02 Thread Didier Durand
Hi,

the beauty (or the horror...) of Java apps with GWT is that you can
stay alway in the same page: so, you don't need multiple urls with
redirects between them by any mean.

You can just programmatically decide in the java code of your unique
servlet which content you decide to put on the page.

In you case, a simple cascade of java ifs would do it: you decide via
those what you user will do next and then you give the right content
back to gwt call.

Other tricks (redirects, etc.) should be reserved to case where you
client is less powerful than the gwt architecture

regards

didier

On Jun 2, 7:14 pm, meiaestro jmalbre...@gmx.de wrote:
 Hi experts,

 I'v build a web application with three entry points so far:

 registration
 login
 start page

 As you can imagine I want to (or have to)  be able to dynamically redirect a
 user - depending on his authentication/session validation, etc. -  to the
 correct entry point, regardless which URL he choose. Example: user chooses
 start page.html but is not yet logged in nor does he have a valid session
 id. So I want to redirect him to login.html automatically.

 Now the question: what is the best way to redirect a user from one entry
 point to the next? Is it a simple Window.open() or is it a
 GWT.setModuleBaseURL().

 Second Question:
 Usually the index.html (or htmls/php/etc) is the first page a webserver is
 searching for, so people are used to it. Can I somehow map a virtual
 index.html to my entry point within the app server or should I use a simple
 header redirect?

 Thanks a lot!

-- 
You received this message 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: Checking if I understand transactions correctly

2011-05-31 Thread Didier Durand
Hi,

entity group is not useful at rollback but rather limits you to which
updates you can do: all the entities you touch in a single transaction
must be in the same entity group.

So, designing your groups properly is a key design issue in GAE to
avoid unnecessary complexity when you later need to update at once
entities that you created before in various groups.

regards

didier

On May 30, 7:57 am, Jacob jacob.rho...@gmail.com wrote:
 I am writing some code that needs to do a rollback on a secondary
 object/table should the transaction fail, I believe this can be done
 via entity groups, however I am not sure if this is how it would be
 implemented. I have written some sample code to check if what I would
 be doing is correct?

 Would the following code ensure the Account object is never updated
 if the insert of the TransactionRecord object fails.

         public void addTransaction(String account, Double value, String
 description, Date date) throws EntityNotFoundException {
                 DatastoreService datastore =
 DatastoreServiceFactory.getDatastoreService();

                 int retries = 3;
                 while (true) {
                         Transaction txn = datastore.beginTransaction();
                         try {

                                 // Update the bank balance
                                 Key key = KeyFactory.createKey(Account, 
 account);
                                 Entity e = datastore.get(key);
                                 Double balance = (Double) 
 e.getProperty(balance);
                                 balance += value;
                                 e.setProperty(balance, value);
                                 datastore.put(e);

                                 // Record transaction details
                                 Entity d = new Entity(TransactionRecord, 
 key);
                                 d.setProperty(account_key, key);
                                 d.setProperty(date, date);
                                 d.setProperty(value, value);
                                 d.setProperty(description, description);

                                 txn.commit();
                                 break;
                         } catch (ConcurrentModificationException e) {
                                 if (retries == 0)
                                         throw e;
                                 --retries;
                         } finally {
                                 if (txn.isActive())
                                         txn.rollback();
                         }
                 }

         }

 Thanks for any feedback!

-- 
You received this message 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: Using URLFetchService / URL

2011-05-20 Thread Didier Durand
Hi,

It seems that the character at index 58 in your request is wrong

Did you check this char in your url ? (I assume that you do a http get
and not a http post)
What is this char ?

regards

didier

On May 20, 12:24 am, yousefgh fe...@yousefgh.com wrote:
 Could it be the length? because it is working fine on a stand alone
 java application!

 yousef

 On May 19, 2:44 am, yousefgh yousef.ghand...@gmail.com wrote:

  I'm using URL Fetch Java 
  APIhttp://code.google.com/appengine/docs/java/urlfetch/overview.html#Fet...
  to get information from graph.facebook.com, however, i keep getting
  the error:

  java.lang.IllegalArgumentException
          at java.net.URI.create(URI.java:842)

  ...

  Caused by: java.net.URISyntaxException: Illegal character in query at
  index 58:https://graph.facebook.com/me?access_token=...

  Any idea?



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: any way to find all the namespaces used ?

2011-05-16 Thread Didier Durand
Hi,

to my knowledge, app engine doesn't store used namespaces, it just
uses the corresponding string as prefix to separate data  structure.

If you want to remember all used namespaces, it's something that you
have to handle by yourself: you create your system namespace then
define an entity for describing namepaces( name, creation date, by
whom, etc.) in this system namespaces and store those entities when
you create a new user namespace.

I.e. when you set a namepace, you check if not already exist and if
not store in your system namespace

regards

didier

On May 16, 12:43 pm, Prashant antsh...@gmail.com wrote:
 hi,

 is there any way to find out what namespaces i have used in my app ??

 thanks
 Prashant

-- 
You received this message 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: how to transfer request to a different servlet ?

2011-05-15 Thread Didier Durand
HI,

From the description of your needs, it seems that the Java inheritance
mechanism is all what you need.

Yours servlets should all inherit from HomeServlet, in their doGet()
method, they will just call super.doGet() at the beginning and then
execute their own thing.

regards

didier

On May 15, 2:00 pm, Prashant antsh...@gmail.com wrote:
 hi,

 i want to use a common servlet (say MainServlet) to handle all the requests
 and based on url requested i want to transfer request to a different
 servlet. for example:
 if requested url iswww.mydomain.com/*i want to send request to HomeServlet
 and if requested url is test.mydomain.com/* i want to send request to
 TestServlet.

 is it possible to transfer request from one servlet to another servlet ?

 will calling new HomeServlet().doGet() from MainServlet be same as
 MainServlet (or any other servlet configured in web.xml) invocation by GAE ?

 any GAE specific solution to this ?

 thanks in advance :)

 --
 Prashant

-- 
You received this message 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: stderr: SystemId Unknown; Line #57; Column #31; Failed calling setMethod method

2011-05-14 Thread Didier Durand
Hi,

Look at
http://groups.google.com/group/google-appengine-java/browse_thread/thread/f6f40411a076aa30/1b0f2adb19ce0997?lnk=gstq=Failed+calling+setMethod+method+#1b0f2adb19ce0997

At the very bottom, you may have the answer to you question

regards

didier

On May 14, 11:25 am, Daniel vedm...@gmail.com wrote:
 My log is full of this weird stderr message

 [vedmack/1.350345457568997204].stderr: SystemId Unknown; Line #57;
 Column #31; Failed calling setMethod method

 Its an Info message...

 any ideas to what can cause this?

 Thanks ahead!

 Daniel,

-- 
You received this message 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: Help with local testing of Task Queue

2011-05-13 Thread Didier Durand
Hi,

Did you follow the guidelines of 
http://code.google.com/appengine/docs/java/tools/localunittesting.html
?

regards

didier

On Apr 25, 11:13 pm, Amar Z amarzumkhaw...@gmail.com wrote:
 Hi,

 I am developing a new application and need help utilizing task queues.

 Here is the problem: when I startup my application locally and insert tasks
 into the default task queue, they fail to be invoked with a 405 status code,
 with the following error message showing up in my log displayed in Eclipse.

    Web hook athttp://0.0.0.0:/tasks/kmlnotificationreturned status
 code 405.  Rescheduling...

 What do I need to do to get past the 405 errors?

 My initial concern is the 0.0.0.0 in the URL, which the google app engine
 chooses to use on its own. When I manually test an alternate URL using the
 loopback ip,http://127.0.0.1/tasks/kmlnotification, I can access the URL
 from the web browser with no error. So the /tasks/kmlnotification URL is
 accessible using 127.0.0.1 though not on the 0.0.0.0 IP address used by the
 app engine. Is 0.0.0.0 the appropriate IP address for web hook invocation?

 I am using the default queue and have no role restrictions in my
 configurations. My platform: Java 1.6/App Engine 1.4.3/Eclipse 3.6/Mac OS X
 10.6.6

 Thanks,
 Amar

-- 
You received this message 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: Can remote api be used inside a GAE java app.

2011-05-12 Thread Didier Durand
Hi,

Don't know if what you do is possible but why don't you just obtain
the data that you need from the other application via simple requests
to servlets delivering the needed data.

By using Java standard object serialization, you can achieve what you
need whatever the object class via a unique and single servlet.

This way you stick to gae normal practices at minimum effort.

regards

didier

On May 12, 8:30 pm, Ole Spielberg ole.spielb...@gmail.com wrote:
 Anyone ?

-- 
You received this message 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: imagesService.applyTransform cannot transform some PNG ? Why ?

2011-05-12 Thread Didier Durand
Hi,


Do you have the issue on your dev machine or on productive
infrastructure: I remember having issues with PNGs on my dev machine
but that would work ok on live machines

regards

didier

On May 12, 8:27 pm, Teng Shiu Huang small...@gmail.com wrote:
 I am evaluating imagesService.applyTransform() to transform images(from URL)
 to specific width/height.
 It's documented that PNG is supported. But it seems it doesn't understand
 some PNG file.
 for example 
 :http://destinyfab.appspot.com/resizer/resize?url=http://www.google.co...
 It works well , and can transform google's logo to 500x500.

 BUT , this PNG 
 :http://destinyfab.appspot.com/resizer/resize?url=http://upload.wikime...

 An error occurred , with this stacktrace :

 Caused by: java.lang.IllegalArgumentException: Unknown
         at 
 com.google.appengine.api.images.ImagesServiceImpl.convertApplicationException(ImagesServiceImpl.java:306)
         at 
 com.google.appengine.api.images.ImagesServiceImpl.applyTransform(ImagesServiceImpl.java:73)
         at 
 com.google.appengine.api.images.ImagesServiceImpl.applyTransform(ImagesServiceImpl.java:50)
         at 
 com.google.appengine.api.images.ImagesServiceImpl.applyTransform(ImagesServiceImpl.java:39)
         at controllers.Resizer.resize(Resizer.java:72)

 I tried some PNGs , and many transparent PNG cannot be transformed . Is this 
 GAE's limitation ?

 The code is very simple , just grab the url's content , transform to byte[].

         byte[] imageBytes = baos.toByteArray();
         Logger.info(imageBytes.length = %s  , imageBytes.length);

         ImagesService imagesService = ImagesServiceFactory.getImagesService();

         Image oldImage = ImagesServiceFactory.makeImage(imageBytes);
         Transform transform = ImagesServiceFactory.makeResize(w, h);        
         Image newImage = imagesService.applyTransform(transform, oldImage); 
 //error occurs
         byte[] newImageData = newImage.getImageData();

-- 
You received this message 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: App engine SDK jars in WEB-INF/lib. Why???

2011-05-11 Thread Didier Durand
Hi,

1 of the reasons is that all applications don't run all at the same
version on the gae productive infrastructure. So, google would have to
know which one you are using in order to put it for you in your war
when you upload it. It's probably simpler to handle if the developper
puts the jars at the correct level in his war by himself (1 less
database to manage / update / etc...) for Google.

It then most probably provide a more resilient infrastructure.

There are probably other reasons.

regards

didier

On May 9, 12:03 am, arjan tijms arjan.ti...@gmail.com wrote:
 Hello Guys,

 I've searched this group and didn't find the answer for the following
 question.

 Why should I bring appengine-api.jar with me to the GAE server? Isn't
 this weird? Creating a new Google Web Application Project in Eclipse
 automatically puts this jars and some 10 others in the WEB-INF/lib
 directory of my project. When I remove them, the google appengine
 validator produces warnings:

 Google App Engine Problem (10 items)
      The App Engine SDK JAR appengine-api-1.0-sdk-1.4.3.jar is missing
 in the WEB-INF/lib directory

 I mean it is not so hard to bring that jar with application, but it
 reduces my application startup time and it makes it hard to
 distinguish the jars I added myself and those which the project adds
 by default. And as I mentioned, it's just plain weird. The server is
 supposed to have the implementations of the classes in those jars
 already. Why on earth should they be bundled in my war???

-- 
You received this message 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: Ancestor query

2011-05-10 Thread Didier Durand
Hi,

this question should be posted in the Objectify group and not in this
one.

It works in A for B because A is a parent of B so you can search with
for B instances having an A instance as ancestor.

For the others, it doesn't work: an A is not ancestor of a C so it
can't work. It could work for Cs having Bs as ancestors but it may be
null if no existing C entity has the B you give as parent.
regards

didier

On May 10, 2:05 pm, pavb pavieillardba...@gmail.com wrote:
 Hi

 I am using objectify in my appengine application and I have problems
 with my ancestor queries
 My model is designed as follow:

 class A {
  public B getB() {
   return Ofy.getOfy().get().query(B.class).ancestor(this).get();
  }

  public C getC() {
   return Ofy.getOfy().get().query(C.class).ancestor(this).get();

 }
 }

 class B {
  @Parent
  private A a;

  public C getC() {
   return Ofy.getOfy().get().query(C.class).ancestor(this).get();
  }

 }

 class C {
  @Parent
  private B b;

 }

 Only the getB() method of the class A works and returns the entity B.
 All the others return null and I don't understand why?

 Could you help me please?

 Thanks

 PA

-- 
You received this message 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: bug with cron job?

2011-05-09 Thread Didier Durand
Hi,

You syntax seems correct: so you're right, probably a bug.

But, at least, you may check the date in your job and if not 1st of
month then you can just exit. So, it still get scheduled every day but
at least works only on the 1st.

regards

didier

On May 9, 7:52 pm, Vik vik@gmail.com wrote:
 someone kindly advise on  this plz.. i fail to understand why job is getting
 executed every day instead of once a month
 Thankx and Regards

 Vik
 Founderhttp://www.sakshum.orghttp://blog.sakshum.org





 On Thu, May 5, 2011 at 7:44 AM, Vik vik@gmail.com wrote:
  Hi

  A cron job in our system is set to email every first day of month. all of a
  sudden i am noticing that it is mailing everyday. Not sure why.

  Here is the cron file entry

   cron
      url/sendPocAvailablityReview/url
      descriptionSend availability review to POCs every month/description
      schedule1st day of month 23:59/schedule
      timezoneAsia/Calcutta/timezone
    /cron

  Thankx and Regards

  Vik
  Founder
 http://www.sakshum.org
 http://blog.sakshum.org



-- 
You received this message 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: URGENT--Exception in running first app

2011-05-08 Thread Didier Durand
Hi,

I checked: newSetFromMap() method appears in jre 6: see the javadoc of
jre 5.0 where it is not present at
http://cupi2.uniandes.edu.co/web/javadoc/j2se/1.5.0/docs/api/java/util/Collections.html

So, you must upgrade your jre to v6 for your code to work.

regards

didier

On May 7, 9:06 pm, blue brandonjl...@gmail.com wrote:
 Please don't put URGENT in the title of your post, people don't like
 responding to someone who thinks their problem is more important than
 another.

 The error says to upgrade your JRE so you should start by upgrading your JRE
 to 1.6 first.

-- 
You received this message 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: xml parsing on GAE servers acts weird

2011-05-06 Thread Didier Durand
Hi,

You have a ClassNotFoundException on a Xerces class according to your
dump: so you are not using the basic xml classes to parse your xml but
also xerces.

You should add the xerces jar in you lib directory

regards

didier

On May 5, 6:16 pm, Richie richiejr...@gmail.com wrote:
 Hey guys,

 I created an app where a user can upload an xml, I display the nodes
 in a GWT table then the user selects the nodes he/she wants to
 download. Sounds easy, works perfectly in hosted mode.

 I use only the base xml parsing, no 3rd party jars in the project
 (aside from commons-fileupload-1.2.1.jar, commons-io-1.3.2.jar,
 gxt-2.2.3-gwt22.jar).

 Here's the code I use for parsing the XML:

 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;

 ...

         public static Document getXml(InputStream stream) throws
 ParserConfigurationException, SAXException, IOException {

         DocumentBuilder parser =
 DocumentBuilderFactory.newInstance().newDocumentBuilder();
         // Parse xml data
         Document xml = parser.parse(stream);

         return xml;

     }

 It's working perfectly in hosted mode, but when I upload it to the
 appengine servers I get the following exception:

 javax.servlet.ServletException: java.lang.RuntimeException:
 java.lang.ClassNotFoundException:
 com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
         at
 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
 240)
         at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
 152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
 542)
         at org.mortbay.jetty.HttpConnection
 $RequestHandler.headerComplete(HttpConnection.java:923)
         at
 com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:
 76)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at
 com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
 135)
         at
 com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:
 260)
         at com.google.apphosting.base.RuntimePb$EvaluationRuntime
 $2.handleRequest(RuntimePb.java:9669)
         at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
 439)
         at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:
 573)
         at com.google.tracing.TraceContext$TraceContextRunnable
 $1.run(TraceContext.java:448)
         at com.google.tracing.TraceContext.runInContext(TraceContext.java:
 688)
         at com.google.tracing.TraceContext
 $AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:
 326)
         at com.google.tracing.TraceContext
 $AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:
 318)
         at com.google.tracing.TraceContext
 $TraceContextRunnable.run(TraceContext.java:446)
         at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
 1110)
         at java.util.concurrent.ThreadPoolExecutor
 $Worker.run(ThreadPoolExecutor.java:603)
         at java.lang.Thread.run(Thread.java:636)
 Caused by: java.lang.RuntimeException:
 java.lang.ClassNotFoundException:
 com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
         at
 com.google.apphosting.runtime.jetty.SessionManager.deserialize(SessionManager.java:
 421)
         at
 com.google.apphosting.runtime.jetty.SessionManager.createSessionFromEntity(SessionManager.java:
 382)
         at
 com.google.apphosting.runtime.jetty.SessionManager.loadSession(SessionManager.java:
 320)
         at
 com.google.apphosting.runtime.jetty.SessionManager.getSession(SessionManager.java:
 288)
         at
 org.mortbay.jetty.servlet.AbstractSessionManager.getHttpSession(AbstractSessionManager.java:
 237)
         at
 org.mortbay.jetty.servlet.SessionHandler.setRequestedId(SessionHandler.java:
 246)
         at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
 136)
         at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
 765)
         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
 418)
         at
 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:
 238)
         ... 19 more
 Caused by: java.lang.ClassNotFoundException:
 com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
         at
 com.google.apphosting.runtime.security.UserClassLoader.loadClass(UserClassLoader.java:
 445)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:264)
         at com.google.apphosting.runtime.jetty.SessionManager
 $DelegatingObjectInputStream.resolveClass(SessionManager.java:476)
         at 

[appengine-java] Re: Can an app request external webpages?

2011-05-05 Thread Didier Durand
Hi,

To get the page, do you use the specific URL Fetch service that is
part of the gae sdk ?

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

If not, may be the source of your issue.

regards

didier

On May 5, 1:22 pm, Luke Waldron therabidw...@gmail.com wrote:
 I have created a servlet which requests a webpage, parses the html and
 retrieves information from it.
 This works fine locally. However when I deploy the application it doesn't
 retrieve the webpage.
 Can anyone tell me what might be the problem?

-- 
You received this message 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: NoSuchMethodError totalMemory()

2011-05-03 Thread Didier Durand
Hi,

An answer from google is needed as Runtime still is in the whitelist:
http://code.google.com/appengine/docs/java/jrewhitelist.html

So, it should provide all the methods of the regular jre class.

regards

didier

On May 4, 4:40 am, emurmur emur...@conceptuamath.com wrote:
 My app started throwing exceptions right after the latest maintenance;
  apparently Runtime.getRuntime().totalMemory() is now actually removed from
 the server runtime?  Couldn't you just return zero?

 java.lang.NoSuchMethodError: 
 com.google.apphosting.runtime.security.shared.intercept.java.lang.Runtime_.totalMemory(Ljava/lang/Runtime;)J
         at 
 com.conceptualcalculations.util.MemoryUtils.formatMemoryLog(MemoryUtils.java:23)

-- 
You received this message 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: A question about google service dashboard

2011-05-02 Thread Didier Durand
Hi,

It may be only a partial response to your needs but at least you can
use AppStats (http://code.google.com/appengine/docs/java/tools/
appstats.html) to get a programmatic view of the health of your
application

regards

didier

On Apr 30, 8:02 am, uronn oukin...@gmail.com wrote:
 Hello,everyone. I am new to google app engine.
 I want to know the google service status from my code.
 As you know , We can go to  the site [http://www.google.com/
 appsstatus#hl=en] and view the result.
 But I would like to get status from my google app code.
 And which google api   should I  use for getting the google service
 status?
 please help me ,and  I am very appreciated .

-- 
You received this message 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: Are GAE servers multicore ?

2011-04-30 Thread Didier Durand
Hi,

You can't multithead directly in GAE: it's forbidden.

You rather gain parallelism via queued tasks.

You don't really care in the servers are multi-core or not: gae starts
more jvms automatically when needed.

regards

didier

On Apr 30, 6:14 pm, hadf hadrien.for...@gmail.com wrote:
 Hello,

 Are GAE servers multicore ? I mean, do we have gain of performance
 when using mutithreading ?

-- 
You received this message 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: Some details on how GAE actually works

2011-04-30 Thread Didier Durand
Hi Luca,

Would also advise you to read the book Programming Google App Engine
by Dan Sanderson (Google engineer) full of technical stuff that you
will not find elsewhere on the net.

regards

didier

On May 1, 12:26 am, Brandon Donnelson branflake2...@gmail.com wrote:
 http://labs.google.com/papers/bigtable.html- here is a good read

-- 
You received this message 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 Java Datastore API

2011-04-22 Thread Didier Durand
Hi Andy,

My suggestion - if you're reluctant to use a 3rd party package - is at
least to read their source code (they are open source) to see how they
proceed to achieve what you want, which is also what they do.

I read most of Objectify: not that long - approx 10K lines.

Definitely a must read before starting your project: you'll save tens
of hours and get directly to the best pratices.

regards

didier

On Apr 22, 7:01 am, Andy hksduhk...@gmail.com wrote:
 Thanks both of you.  I would like to know the best practice of system design
 when using low level api.  Like where should I store the property type
 information?  I could simply use a Map to store the schema for each entity
 but then a property sometimes has more than just the type but also
 formatting, default and all other attributes.  So wondering if anyone has
 successful example of using low level API?

 thanks 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: java.lang.IllegalArgumentException: query not found

2011-04-21 Thread Didier Durand
Hi,

You should also submit this in the Objectify group

regards

didier

On Apr 21, 5:30 pm, Simon Knott knott.si...@gmail.com wrote:
 Hi,

 What version of the SDK are you using?  The increase to the time allocated
 for backgrounds tasks only took place in v1.4 onwards.  Also, there was a
 bug in the development server pre version 1.4.3, which meant that the tasks
 didn't have a 10 minute timeout.

 Cheers,
 Simon

-- 
You received this message 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: How to make persistent fields from parent class

2011-04-21 Thread Didier Durand
Hi,

Did you try to bring the jar containing those annotations over to
Android and then make it an Android dex file,

If android sdk accepts to dex it, that may be good enough

Let us know if this works else I may have another less direct solution

regards

didier

On Apr 21, 4:39 pm, cghersi cristiano.ghe...@gmail.com wrote:
 Hi all,

 I've got an architectural issue frustrating me from several days. I'm
 quite new to GoogleAppEngine, so perhaps I'm not completely aware of
 all the possibilities of this framework.

 Let's say I've got this configuration: on GoogleAppEngine there is my
 backend, providing several APIs via servlets.
 Then I've got an Android client calling these API.
 I would like to share my Java beans between backend and Android,
 placing them in a library agnostic from GoogleAppEngine stuff (and
 possibily also from JDO).
 Then in the backend I would like to extend these communication beans
 in order to add the stuff for the persistence on Datastore (e.g.
 Datastore keys, other persistent fields not visible to the client,
 etc.).

 In this scenario I'm not able to set the correct annotation properties
 of my beans.

 E.g.
 //this is one of the communication beans
 public class CommUser {
  @Persistent
  string name;

 // other properties...

 }

 //this is a class in the backend
 @PersistentCapable
 public class DBUser extends CommUser {
 @PrimaryKey
 @Persistent
 Key id;

 //other stuff...

 }

 In this example, I would like to see all the CommUser fields marked as
 @Persistent (as e.g. name) to be added to the entities of type
 DBUser, but this is not the case :(
 The only way I'm able to use this model is to make CommUser
 @PersistentCapable and add the Key directly to CommUser (with some
 other customization regarding the inheritance policies), but in this
 case I cannot place CommUser in an external library.

 Is there a common pattern to face up this problem?

 Thank you very much!

 Bye
 cghersi

-- 
You received this message 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 Java Datastore API

2011-04-21 Thread Didier Durand
Hi Andy,

Why don't you try a 3rd party package with an intermediate level of
abstraction: they enforce types.

See Google recommandations at
http://code.google.com/appengine/docs/java/datastore/overview.html#Introducing_the_Java_Datastore

I personally use Objectify.

regards

didier

On Apr 22, 6:23 am, Andy hksduhk...@gmail.com wrote:
 Hi,

 I am trying to get away from JDO and now into Low Level API.  I find that
 the Low Level API is much more flexible except one thing.  I have a
 challenge on enforcing or checking data type for each entity property.  So
 if I don't want to hard code the data type or using reflection, how do I do
 that?  e.g. creationDate is a Date type when saving it as a property of an
 entity but where should I define it as a Date type so I don't have to cast
 every single type?

 Thanks,

 Andy

-- 
You received this message 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: can I use Google maps in my Google Appengine java Application

2011-04-19 Thread Didier Durand
Hi Ram,

The web is full of good tutorials for the subjects that you want to
learn: use google to find some.

Please, understand that this group is not a place for all what
concerns Jav dev: far too broad...

regards

didier

On Apr 19, 7:56 am, Ram ram...@gmail.com wrote:
 Please anybody reply...

-- 
You received this message 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: HTTP Post not working

2011-04-19 Thread Didier Durand
Hi,

Read this part of app engine doc: 
http://code.google.com/appengine/docs/java/urlfetch/overview.html

You will see that there are some restrictions in the URL service: port
numbers, etc...

Maybe you will into one of them with c2dm

regards

didier

On Apr 15, 1:37 pm, Thomas Riley tomrile...@gmail.com wrote:
 Hello, I'm using GAEJ as the back end for my Android application and have
 implemented Cloud to Device Messaging for Android (C2DM).

 I have everything working bar one bit of code. The Servlet that is executed
 in a TaskQueue refuses to execute correctly.

 The code includes a HTTP POST that is technically correct as the code was
 adapted from Google's Chome2Phone App Engine sample code. For some reason,
 app engine does not execute my code however it does not log that an error
 has occured and the logging I have configured to occur during the HTTP POST
 process is not displayed (however any logging before or after the attempt to
 POST is displayed).

 This is an extremely odd error that I can't figure out, has anyone
 else experienced a similar problem?

 Note: This is not an issue with C2DM or my Android device client as I have
 successfully tested this using CURL.

 If anyone has a suggestion, it will be greatly appreciated!

-- 
You received this message 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: Cheapest way to update a versioned object?

2011-04-19 Thread Didier Durand
Hi,

Be careful with the cron job: you may lose some of your updates if gae
has some trouble between some updates and the cron job. There is no
guarantee from Google on that point:

see Under rare circumstances, values may also disappear from the
cache prior to expiration for reasons other than memory pressure.
While memcache is resilient to server failures, memcache values are
not saved to disk, so a service failure may cause values to become
unavailable. at 
http://code.google.com/appengine/docs/java/memcache/overview.html#How_Cached_Data_Expires

Anyway, more simply if the cache is too loaded, some values are
discarded. So, here again you may lose values.

So, I would encourage either a direct write-through in addition to
cache write. You can do it via a synchronous / async I/O from the
transaction or via a task that you queue.

regards

didier
On Apr 19, 7:40 pm, blue brandonjl...@gmail.com wrote:
 Every action on my app will require the user to view and update their user
 object, but other users will have the opportunity to update other user
 objects as well.  So, my question is, what is the cheapest way to do this?

 The best way I have found to do this is:
 1) read user from memcache (or datastore if not
  there and put into memcache)
 2) modify user object
 3) get from memcache again and see if version has changed
 4) write to memcache with new version or throw error if version is different
 5) have a cron job write batches to the datastore if needed

 Most of the time a user will end up with 2 gets from memcache and 1 set to
 memcache.

 The other option I have tried was transactions, but that was way too
 expensive -- datastore writes on every request.
 I also tried sessions, but that was also very expensive -- datastore writes
 on every request.

 Does anyone have a better solution?

-- 
You received this message 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: Data being stored in a weird way

2011-04-19 Thread Didier Durand
Hi,

Are you using eclipse ?  if yes check under File  Properties  Text
File encoding that your file is UTF-8 encoding.

I would guess not.

So, change it to UTF-8 and your issue should get fixed.

regards

didier

On Apr 19, 6:32 pm, Luca Matteis lmatt...@gmail.com wrote:
 I posted a question on StackOverflow about my data being stored with
 weird chars, and it only happens live, which is very strange.

 Here's the 
 question:http://stackoverflow.com/questions/5707266/google-app-engine-data-bei...

 Am I missing something?

-- 
You received this message 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: How to log user generated traffic per user

2011-04-18 Thread Didier Durand
Hi,

You should have your own implementation of the class Servlet

Then, you should derive all your own servlets from this child of
Servlet

So, when a call a made to your central server is made, this child of
Servlet will be instantied and you can get which url was called, the
input parameters, the answer given by this servlet and the size of
input and input.

regards

didier

On Apr 18, 10:19 am, mJay ms...@hdm-stuttgart.de wrote:
 Hello,
 I'm new at google app engine and I try to find a solution for a problem. I
 was searching the past days on the web but didn’t find anything that suits.

 Do anybody know a possibility to log traffic that is generated by a user
 (logged in with its google-account) when using an app on appspot?

 Included should be all the traffic which is generated by viewing pages and
 up- or downloading something (documents or whatever).

 Google is already logging that traffic because they want to have money for
 the generated traffic. So I was asking myself if it’s possible to use that
 statistics. Or is there an other method to log user generated traffic per
 user?

 Anybody an idea?

 Thanks a lot!

-- 
You received this message 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: can I use Google maps in my Google Appengine java Application

2011-04-18 Thread Didier Durand
Hi,

yes, you can.

If you use Google Webtoolkit, the simplest way is to use the Java api
for GWT at http://code.google.com/p/gwt-google-apis/

else, you have to generate your html via java to respect the google
maps api requirements: script line, etc.

regards

didier

On Apr 18, 8:44 am, Ram ram...@gmail.com wrote:
 I am new Google AppEngineI start developing Java Application using
 Servlet and Jsp and Eclipse helios

 can I use Google maps in my ApplicationHow to do thisplz help me

-- 
You received this message 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: Mem cache

2011-04-14 Thread Didier Durand
Hi,

If you don't use memcache, it means that you do your reads from
datastore, so you incur the delay of accessing a remote datastore
server and then the delay of its disk access time.

Memcache is direct access memory so much faster!

You see most of the benefits if you can use memcache for piece of data
that you very frequently use throughout your application.

regards

didier

On Apr 14, 8:26 am, Meet Mehta foreveravaila...@gmail.com wrote:
 what are the performance statistics of using mem cache and not using it

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: How to model object with lots of small properties

2011-04-10 Thread Didier Durand
Hi,

You should use an enum class for the properties (so that you can
extend later on) and store them as proposed above in a Set

regards

didier

On Apr 10, 8:29 am, Ravi Sharma ping2r...@gmail.com wrote:
 May be you can do womething like this

 class HouseProperty{
 Key id;
 String Name;}

 in above class you can create your all properties like
 hasAirCond,hasInternet etc. One property
 per Row.
 and in House you can have somethin glike this
 class House{
 SetKey properties;

 }

 and if some house has airCond, then add one key to this collection
 house.properties.add(Key corresponding to airCon);

 if some house has two or more then
 house.properties.add(Key corresponding to airCon);
 house. properties.add(Key corresponding to hasInternet );
 house. properties.add(Key corresponding to some other feature.);

 If you do like this, you dont need to worry about increasing the table
 columns later as you will be doing in your current solution. If new
 prooperty of a house comes just add another row and your solution will keep
 working.

 Thanks,
 Ravi.

 On Sun, Apr 10, 2011 at 7:22 AM, Thomas Wiradikusuma wiradikus...@gmail.com

  wrote:
  Hi guys,

  I want to model an object with lots of small properties, e.g.:

  House {
   boolean hasAirCond, boolean hasInternet, boolean nearSchool, etc;
  }

  Is this naive way the best way to model it? Is there any better GAE-
  way to do this?

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



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



[appengine-java] Re: How can I make the session to be held open as long as the user got its browser opened?

2011-04-10 Thread Didier Durand
Hi,

You should clarify what you mean by an open session: do you mean the
http one defined by the cookie, the security one after login, etc ?

regards

didier

On Apr 10, 9:35 am, Max thebb...@gmail.com wrote:
 have you tried to use memcache or simply store session into datastore?

-- 
You received this message 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: Datastore - best way to insert/update a record

2011-04-08 Thread Didier Durand
Hi,

I guess that you just have to
  - select how you access the Datastore (JDO/JPA or low-level API
or 3rd party package like Objectify)
  - make an annotated entity Counter with the 2 fields above
  - code the algo as you say above
  - you may want to put this code in a task rather than do it
directly: if datastore is not available or any other problem in
execution, gae will do the retries of your write automatically.

regards

didier

On Apr 8, 9:22 pm, Peter ptr...@gmail.com wrote:
 Folks,

 In my GAE datastore, the Users table contains two fields - email addr and
 counter. Each time a user accesses a specific object, I need to increment
 the counter. The logic is as follows:

 1. SELECT Email, Counter FROM Users Where Email = emailAddr
 2. If record not found, create one and set counter value to 1
 3. If record found, increment the counter value and save it back.

 I am wondering what is the best way to achieve this in Java.

 Thank you in advance for your help.

 Regards,
 Peter

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Unable to delete entities

2011-04-07 Thread Didier Durand
Hi,

You should try querying them all (so that you don't have to create an
invalid query) via a Java program and then check the value of the
property once the object is instantiated in order to issue a delete if
the prop value is wrong.

You may have to do this via chained queued tasks if your data is big.

regards

didier

On Apr 7, 8:53 pm, Ben bencarl...@gmail.com wrote:
 Hello,

 I have a strange problem in the app engine data viewer (admin tools).
 I have entities in my app that have an email property, but the value
 of email is ''... blank. This is apparently invalid, as when I browse
 all entities with the email property, I get an error.

 I then try to query: SELECT * FROM User WHERE email = '' and get the
 error: email must not be empty. I then try to query in reverse:
 SELECT * FROM User WHERE email != '' and I can browse the entities
 with no issues.

 How can I delete the entities with blank emails, when I cannot query
 on it being blank?

 I have a similar issue with URLs.

 Thanks!

 -Ben

 http://www.liink.ithttp://about.me/benjaminc

-- 
You received this message 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: Detecting orphaned blobs in the Blobstore

2011-04-07 Thread Didier Durand
Hi,

You get the key of your blob via BlobKey blobKey = blobs.get(myFile)
(see http://code.google.com/appengine/docs/java/blobstore/overview.html)

So, I would personally store all the myFile ids that I distributed
from the server side and in an asynchronous queue task would do to see
if the get() above responds with a Key. If yes, you decide with other
data if orphaned or not and delete appropriately.

regards

didier


On Apr 7, 8:46 pm, lorenoolive...@gmail.com
lorenoolive...@gmail.com wrote:
 Hi there.

 One of the features of my application requires the upload of image files
 along with other data in a form. That is, my entity is composed of both some
 fileds (text, currency, dates, etc) and an image file.

 As far as I could see, to deal with the blob store service is a two phase
 process. In my case, I submit a form with both the image and the remaining
 data, this post is handled by the blob store service, which stores the image
 and redirects the request back to my application, with the blob key and the
 remaining data of the form. But, what happens if, by some reason, the
 remaining of the post data cannot be persisted by my application? In cases
 like that, how can I cope with orphaned blobs in the blob store? I took a
 look at the BlobstoreService API, but could not find any method that lists
 all the keys of persisted blobs.

 Actually, I have some ideas for detecting and deleting such orphan blobs,
 but I'm afraid I can be missing something obvious since I'm still starting
 with GAE.

 Any advice in this sense?

 Loreno

-- 
You received this message 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: Sending/Receving data to/from my application

2011-04-05 Thread Didier Durand
Hi,

You can simply post (http POST request) and get (http GET request)
from your client which can then be a very simple batch java program.
You do those http requests on the url of your servlet.

That's the simples way I know.

regards

didier

On Apr 5, 3:18 pm, jake189 binhmin...@gmail.com wrote:
 Hi,

 I programmed my simple application and located it in google's server. And
 now, I want to send variables from my client (locates on my computer) to
 this application, then it performs and send back results to my client.
 Sending and receiving dont use JSP, can I do it? Because with large mount of
 data, cant use Web client to input all of them.
 If can, how to program (which methods?)? Thanks to support :)

-- 
You received this message 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 multithreaded access/update to entity

2011-04-03 Thread Didier Durand
Hi,

Having a version (or even better a timestamp) for last update is also
what I use to maintain integrity of my data.

To manage it simply,
a) I use a hierarchy of object all inheriting from a DsObject so that
I to manage this version only in one place
b) I use the @PrePersist annotation (from Objectify) to make it as
transparent as possible

regards

didier

On Apr 3, 2:10 pm, Peter Backx peter.ba...@gmail.com wrote:
 I have an application that accesses a user entity. This entity also contains
 a number of user specific settings that the user can update. Some of those
 settings are updated by different servlets in parallel (for instance
 uploading a profile picture to the blobstore)

 I'm having some serious issues keeping everything in sync. If I'm not
 careful, I can easily overwrite updates that have been done in another
 thread.

 I have the feeling this is a recurring issue for many GAE application, so
 I'm looking for some best practices of how to deal with it.

 In the relational world, often a version column is added. Before updating
 a row, the version number in the database is compared to the one in memory.
 I suppose I can implement something like that on GAE too, but I was
 wondering whether there are better/other options available in the NoSQL
 world.

 Regards,
 Peter

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Tips/Pitfalls for total newbies?

2011-04-01 Thread Didier Durand
Hi,

Also think about Google Web Toolkit for the UI: you will remain so
full-Java and you can do nice interface even if you are as bad as I am
in graphics / ui design ;-)

I agree with Simon: definitely forget JPA/JDO!  (I went with
Objectify)

Also study carefully the datastore, especially entity groups and
transactions: you will for sure face issues at some point because of
the coupling of the 2 notions. So, try to understand them at best at
the very beginning.

regards

didier

On Apr 1, 4:54 pm, Drew Spencer slugmand...@gmail.com wrote:
 Thanks Simon,

 I am going to work through the java example program and familiarise myself
 while I read all the docs.

 Thanks for the advice re: JDO. That's the kind of thing I was looking for.

 Also - is it best to stay away from GWT for now? I would assume I need to
 get my backend working nicely before I think about that.

 Cheers,

 Drew

-- 
You received this message 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: Tips/Pitfalls for total newbies?

2011-04-01 Thread Didier Durand
Forgot:

-about the docs: use the api based on File class for your files in the
blobstore. Just announced yesterday.

- Also, have a look to tasks: that's the way to generate parallelism
in your application if you want to do stuff simultaneously (quick
handling of big data, etc...)

Good luck for your app!

didier

On Apr 1, 5:30 pm, Didier Durand durand.did...@gmail.com wrote:
 Hi,

 Also think about Google Web Toolkit for the UI: you will remain so
 full-Java and you can do nice interface even if you are as bad as I am
 in graphics / ui design ;-)

 I agree with Simon: definitely forget JPA/JDO!  (I went with
 Objectify)

 Also study carefully the datastore, especially entity groups and
 transactions: you will for sure face issues at some point because of
 the coupling of the 2 notions. So, try to understand them at best at
 the very beginning.

 regards

 didier

 On Apr 1, 4:54 pm, Drew Spencer slugmand...@gmail.com wrote:

  Thanks Simon,

  I am going to work through the java example program and familiarise myself
  while I read all the docs.

  Thanks for the advice re: JDO. That's the kind of thing I was looking for.

  Also - is it best to stay away from GWT for now? I would assume I need to
  get my backend working nicely before I think about that.

  Cheers,

  Drew



-- 
You received this message 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: Uploading New Data into App Engine Java App

2011-04-01 Thread Didier Durand
Hi,

The simplest way is to write a servlet on GAE.

When your own server is done with the calculation, it posts (http
POST) the new data to this servlet who reads it and separate each line
as a new entity in the datastore.

The servlet can then do further processing (cleanup, updates, etc.) if
needed and launch a queued task (or several in parallel if you need
speed via parallelism) to do all what's remaining.

regards

didier

On Apr 1, 3:45 pm, Andrey andreykuzme...@gmail.com wrote:
 We need to periodically upload the new data into our Java App running on the
 App Engine. We are going to perform some calculations on our own server,
 after which the results of this calculation need to be uploaded into the App
 Engine app. The results are just a text file (each line is a separate string
 result). They will need to be taken into account immediately by the app
 running on the App Engine. This app uses the results to display them within
 the user interface.

 Could someone please recommend - what is the best way to:
 1) How to upload this kind of data programmatically into the Java App Engine
 app
 2) How to detect the new data has arrived from inside app engine, and reload
 it from the file - which tools in Java?

 I could not find the uploading data section under the Java part of the
 documentation

 Thank you

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: JPA/JDO vs low level API

2011-04-01 Thread Didier Durand
Hi,

You should also consider 3rd party packages like Objectify who works
at an intermediate level of abstraction.

The low-level api forces you to handle everything by yourself: the
Entity, its Properties, etc...

In JPA, JDO: you work much higher in abstraction: you define a Java
class as an Entity and then its properties become DS properties as you
annotate them.

As said: the big difference is abstraction level and resulting
guidance for JDO or flexibility for low-level: with low-level, you can
do much more things but you have to program much more carefully and
now what you do. With JDO/JPA, you get more comfort as you are guided
by the pojo structure. Also, JDO/JPA aligns you with Java
(inheritance, compiler checks for types, etc...).

I would really advise to start somewhere in the middle with a 3rd
party package as they are recommended now by Google more than JDO/JPA
and learn by using it at its own middle abstraction layer. When you
understand better, you will see if you really want / need to go up or
down in abstraction or stay where you are.

regards

didier

On Apr 1, 1:50 pm, SkYlEsS shou...@gmail.com wrote:
 I have a question :

 What are the differences between JPA/JDO and low level API (and
 Objectify) in practice ? I read everywhere the low level API provides
 more flexibility, but there are never samples code or evidences to
 demonstrate it. So I'm wondering in which cases exactly, the low level
 API is useful ?

 Thanks in advance

-- 
You received this message 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: How do I run my Junit test suite on the server?

2011-03-31 Thread Didier Durand

Hi,

Yes, you can run your tests on the GAE server itself and it's very
useful to dig out the last errors that the run on the dev server
didn't show. It saved me days.

For that, you have to write you own Junit TesRunner as as servlet: you
can start simply by using the TextRunner of Junit and then get more
sophisticated if you want to embed your tests in a nice UI like GWT.

Let me know if you need more info.

regards

didier

On Mar 31, 5:28 pm, Eliot Stock 1...@eliotstock.com wrote:
 Is there a standard way to do this or do I have to write a servlet or
 something? If I have to write something, how am I going to get the log
 output from the tests onto the UI or the logs in the dashboard?

 Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Are Java static initializers thread safe on GAE ?

2011-03-31 Thread Didier Durand
The consequence of what Simon says is that you have to be prepared to
have a separate init for each jvm and this can cause issue if your
application relies on the semantics of a single init (singleton,
etc..)

regards

didier

On Mar 31, 1:55 pm, Simon Knott knott.si...@gmail.com wrote:
 Static initializers will be thread-safe, but you've got to remember that
 that class may be loaded in multiple JVMs, depending on how many instances
 get spun up for your application.

-- 
You received this message 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: Appengine mapper - Question

2011-03-28 Thread Didier Durand
Hi,

I have successfully used ThreadLocal on GAE to define some variables
specific to a given transaction represented by its thread. I wanted
theses variables to be shared by various subservices in my
transaction. So, it's very close to what you tried to achieve.

Then, you should be ok using it.

regards

didier

On Mar 28, 11:14 am, Aswath Satrasala aswath.satras...@gmail.com
wrote:
 Hi,
 I am setting up Threadlocal variable the map function.  I am using this
 Threadlocal variable further along in the map function and elsewhere in the
 other business services that this map function is calling.
 Is it safe to do so?  Is the map function executed by only one thread until
 the end of the map function

 Thanks,
 -Aswathwww.AccountingGuru.in

-- 
You received this message 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 GWT component library compatible with GAE ?

2011-03-28 Thread Didier Durand
Hi,

Vaadin is also a possible good choice in addition to ext-gwt

regards

didier

On Mar 28, 1:04 pm, Thierry Lejealle thierry.lejea...@gmail.com
wrote:
 Hello,

 I find GWT standard components a bit dull. What would you recommand to
 extends GWT components and still remain compatible with App Engine ?
 Ideally a component library that works 100% in Java (no need to tinker the
 CSS or Javascript)
 Ideally something that hasn't a too restrictive licence...

 SmartGWT looks nice but doesn't seem to work well with GAE at the moment
 EXT GWT has a restrictive licence ; I don't know if it works with GAE ?

 Any other option ?

-- 
You received this message 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: Check Table Exists

2011-03-27 Thread Didier Durand
Hi,

Check the metadata queries: exactly what you need

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

regards

didier

On Mar 28, 4:53 am, Arjun Jain arjun.j...@gmail.com wrote:
 How to check table exists or not or how to display all table

-- 
You received this message 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: gae gwt - to serve compressed java script

2011-03-24 Thread Didier Durand
Hi,

It's depending on certain values in the header of the request: see
http://code.google.com/appengine/docs/java/runtime.html#Responses

regards

didier

On Mar 24, 11:46 am, pac parvez.chau...@gmail.com wrote:
 It looks that app engine is not serving compressed contents.
 Is there something I need to configure? though it says that it does
 that automatically

 http://code.google.com/appengine/kb/general.html#compression

 I have application written in gwt and java scripts are served
 uncompressed from app engine as per Page Speed plugin of Chrome and
 FireFox. It suggests to enable compression.

 From Page Speed:

 Compressing ./4.cache.js could save 336.2KiB (77% reduction).

 From Live HTTP Headers plugin of Firefox:

 ./4.cache.js

 GET ./4.cache.js HTTP/1.1
 Host: Website name
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:
 1.9.2.16) Gecko/20110319 Firefox/3.6.16 ( .NET CLR 3.5.30729)
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
 *;q=0.8
 Accept-Language: en-gb,en;q=0.5
 Accept-Encoding: gzip,deflate
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Keep-Alive: 115
 Proxy-Connection: keep-alive
 Referer: Website name
 If-None-Match: X3ERbg
 Cache-Control: max-age=0

 HTTP/1.1 200 OK
 Via: 1.1 SRV-IE-GATEWAY
 Connection: Keep-Alive
 Proxy-Connection: Keep-Alive
 Transfer-Encoding: chunked
 Age: 598
 Expires: Thu, 22 Mar 2012 11:44:33 GMT
 Date: Wed, 23 Mar 2011 11:44:33 GMT
 Content-Type: application/x-javascript
 Etag: X3ERbg
 Server: Google Frontend
 Cache-Control: public, max-age=31536000

 May be I am wrong, but I am guessing that if app engine is serving
 compressed contents then in its response it will say something like

 Content-Encoding: gzip

 May be I am missing something, any suggestions to fix it?

 Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Task Enqueue in a Transaction

2011-03-22 Thread Didier Durand
Hi,

For me, the answer is here:
http://code.google.com/appengine/docs/java/datastore/transactions.html#Isolation_and_Consistency

They say: Queries and gets inside a transaction are guaranteed to see
a single, consistent snapshot of the datastore as of the beginning of
the transaction. In particular, entities and index rows in the
transaction's entity group are fully updated so that queries return
the complete, correct set of result entities, without the false
positives or false negatives described in Transaction Isolation that
can occur in queries outside of transactions.

The task is part of the initial transaction so it sees the ds as of
the beginning of the transaction

regards

didier

On Mar 22, 9:12 pm, Tom Gibara tomgib...@gmail.com wrote:
 Thanks for the link, somehow I'd managed to miss that page of
 documentation entirely*; it's good to know, though it indicates other
 problems for the OP.

 I'm not clear on why eventually consistent gets aren't an option, ie.
 why all gets are indicated as being strongly consistent. Is this a
 direct consequence of replication algorithm used? There are various
 places in the code I'm currently developing where dirty gets are
 adequate and I'd be happy to see them faster.

 * As an aside, I do find the documentation on the datastore feels very
 scattered. I'd much prefer sections on the underlying app engine
 mechanics with less language specific guidance.

 Tom.

 On 22 March 2011 17:59, Jay Young jayyoung9...@gmail.com wrote:

  According to the docs, gets, puts, deletes, and ancestor queries are all
  strongly consistent:
 http://code.google.com/appengine/docs/java/datastore/hr/



-- 
You received this message 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: sharing the code base

2011-03-21 Thread Didier Durand
Hi,

The invitation you send from the GAE dashboard is not about source
code sharing but about giving the other person access to this
dashboard so that he can also see logs and administer app.

For code sharing, you have to use Github (if your project is open) or
go a hosted subversion service.

regards

didier

On Mar 21, 7:03 pm, fishdan fish...@gmail.com wrote:
 I have invited another developer to work with me on my google app engine
 project, and sent him the invitation.  Is there anyway for him to download
 the existing code from google apps so I don't have to send it to him?

-- 
You received this message 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: JUnit Test of Code that uses GAE/J URLFetchServiceFactory.getURLFetchService()

2011-03-18 Thread Didier Durand
Hi,

There is a difference:

a) the build path is what's needed to compile your source as you code
it
b) the classpath is what's needed to run the application

The local jars provide low-level service used by the jars facing the
user code and replace equivalent jars of the prod env.

So, you don't need those jars when you compile but they are required
locally when you run.

Hope this helps

regards

didier

On Mar 18, 6:40 am, James Andersen james.j.ander...@gmail.com wrote:
 Just for my own edification...  I was comparing the build path of my test
 project to my GAE project while trying to solve this... I didn't find these
 jars in either one.    When I launch my GAE project locally is works of
 course...    I'm using eclipse, does the Google Web Application launch
 configuration handle loading these jars for me before my project is actually
 loaded?  

 Sorry still getting used to GAE and have been in the .NET world for several
 years now...

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



[appengine-java] Re: can I perform a query in transaction without the pk-parent filler?

2011-03-18 Thread Didier Durand
Hi,

You don't need to explicitely use the parent filter in you query as
long as all entities effectively are in the same group.

The need for that is to isolate all entities potentially updated by a
transaction on a single store server, i.e the one hosting the entity
group.

regards

didier

On Mar 18, 10:25 pm, Tapir tapir@gmail.com wrote:
 I am sure that the return entities are all in one entiry group.
 Seems no errors on the dev server. But I don't know if it is ok on the
 production server.

-- 
You received this message 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: Local development server classpath - com.google.appengine.tools.KickStart

2011-03-18 Thread Didier Durand
Hi,

You will be ok if you add not only 1 single gae jar (appengine-tools-
api.jar) but all those (about 2) appearing in the GAE sdk library on
Eclipse when you create a new project + those needed to run locally.

The simplest way for you is to follow he hints given in
http://code.google.com/appengine/docs/java/tools/ant.html

regards

didier

On Mar 18, 8:55 pm, Benjamin Muschko benjamin.musc...@gmail.com
wrote:
 Hi,

 I have a question about the runtime classpath that is being used when
 starting up a local development server. It is required to set
 appengine-tools-api.jar in the classpath a parameter. My application
 directory web_app_dir does not include some of the libraries that
 are required at runtime (see below someother.jar); they sit in a
 different directory. I tried to add them using the -cp parameter but
 they don't seem to get evaluated. I get a
 java.lang.NoClassDefFoundError. This is the call I make:

 java -cp /home/ben/dev/tools/appengine-java-sdk-1.4.2/lib/appengine-
 tools-api.jar:/home/ben/dev/someother.jar
 com.google.appengine.tools.KickStart
 com.google.appengine.tools.development.DevAppServerMain web_app_dir

 Can somebody please shed some light on this? Are only the libraries
 used that sit in web_app_dir/WEB-INF/lib? Is there any way I can add
 additional libraries using an parameter?

 Thanks,

 Ben

-- 
You received this message 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: Design choices.

2011-03-17 Thread Didier Durand
Hi,

namespaces are not related to entity groups: entity group is a notion
to group entities for transactional purposes. The aim is to limit a
transaction to update of objects in a single group (i.e on the same
server) to get a higher reliability and good scalability.

The namespace is a just a prefix on your data to separate it
virtually per namespace: it has nothing to do with entity groups. Of
course, you can't define entity groups across namespaces as data in
one namespace doesn't know of data in another.

regards

didier

On Mar 17, 4:00 pm, Khanh Dao Minh khan...@gmail.com wrote:
 I think there is no problems with performance, but security vulnerabilities
 and data leak.
 Just give it a try :)

 Regards,
 KhanhDM.

-- 
You received this message 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: for the problem Applications are limited to 150000000 bytes of resource files

2011-03-16 Thread Didier Durand
Hi,

In order to achieve your goal is the quota limit cannot be changed,
may I suggest though that you still update your file to the datastore
to serve them back to your clients.

You would not serve them from datastore but upload them into memcache
(all at startup or 1 by 1 on 1st use) and serve them from this cache.
Extremely fast and efficient.

As an intermediate, you can also try something lighter than JDO/JPA:
either low-level api or 3rd party package like Objectify

regards

didier

On Mar 16, 10:24 am, Simon Knott knott.si...@gmail.com wrote:
 Hi,

 The restrictions around your deployed application can be seen 
 athttp://code.google.com/appengine/docs/java/runtime.html

 The maximum size of your deployed WAR has to be 150MB, as far as I'm aware
 it's not a quota which can be increased.

 Cheers,
 Simon

-- 
You received this message 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: for the problem Applications are limited to 150000000 bytes of resource files

2011-03-16 Thread Didier Durand
Hi,

the big difference between memcache and loading to memory as you say
is that the memcache is automatically replicated for you across the
jvm automatically started by gae.

You can load yourself in memory by (for example) using a singleton as
the anchor point for a data structure (probably a collection) keeping
links to all your resources as objects (type=blob for image as
example). In that case, your singleton will start empty in each new
jvm and will have to be loaded on 1st use.

The memcache is (to my knowledge) central memory: so it's as fast as
your own memory structure. It just takes additional code to be
accessed (i.e the google service) but in return offers the management
of automatic copies, etc...

regards

didier

On Mar 17, 3:20 am, Chun Guo sei.guoc...@gmail.com wrote:
 Thanks for your advice. But I want to know the difference between loading
 the records into the main memory and loading the records into the memory
 cache. An other question is, both of the two approaches will consume a lot
 of time, but the performance of the former is still questionable.
 Expecting your further directions. Thanks for your attention!
 Chun

 2011/3/16 Didier Durand durand.did...@gmail.com

  Hi,

  In order to achieve your goal is the quota limit cannot be changed,
  may I suggest though that you still update your file to the datastore
  to serve them back to your clients.

  You would not serve them from datastore but upload them into memcache
  (all at startup or 1 by 1 on 1st use) and serve them from this cache.
  Extremely fast and efficient.

  As an intermediate, you can also try something lighter than JDO/JPA:
  either low-level api or 3rd party package like Objectify

  regards

  didier

  On Mar 16, 10:24 am, Simon Knott knott.si...@gmail.com wrote:
   Hi,

   The restrictions around your deployed application can be seen athttp://
  code.google.com/appengine/docs/java/runtime.html

   The maximum size of your deployed WAR has to be 150MB, as far as I'm
  aware
   it's not a quota which can be increased.

   Cheers,
   Simon

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



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



[appengine-java] Re: running app engine application totally on local environment

2011-03-16 Thread Didier Durand
Hi,

About your second question, you'll be able to upload on the gae cloud.

What I would do: in you data access layer, I would put some
interceptor code that will record all changes in real time and push
them to the gae cloud as soon as you have a connection (you say that
internet access is shaky in that case).

So. you will have real time mirroring of your local data to the cloud.

The replication will happen wia the call of a servlet in the cloud
that will receive serialized version of the modified /created object
and put it in the datastore.

regards

didier

On Mar 16, 7:12 pm, romesh soni soni.rom...@gmail.com wrote:
 Hi Didier,

 Thanks for your time and suggestions. Though before posting, I searched on
 Google to find the answer but did not find any reference :(.
 I thought the dev server means app engine support for local machine.

 Okay, I will use jetty for running the google app engine application I am
 building.

 But what about the other question?
  2.) uploading data from development server to production server as there
   will be schedulers in local (aka development ) machines to push data to
   production server so that in case of system crash on local serves, my
   clients can switch to Production version.

 Thanks
 TL

 On Wed, Mar 16, 2011 at 10:33 AM, Ikai Lan (Google) ika...@google.comwrote:

  Thanks for answering, Didier (I notice you've answered this question
  several times in the past).

  I feel like I should add this to the FAQ ...

  Ikai Lan
  Developer Programs Engineer, Google App Engine
  Blog:http://googleappengine.blogspot.com
  Twitter:http://twitter.com/app_engine
  Reddit:http://www.reddit.com/r/appengine

  On Wed, Mar 16, 2011 at 10:13 AM, Didier Durand 
  durand.did...@gmail.comwrote:

  Hi, this question was already debated many times here: it is not a
  good idea to use the dev server of gae for production purposes as it
  is only a dev server as its name implies.

  It's limited in many functions, you have no guarantee on its long
  term, etc...

  Why don't you go to a standard servlet container (tomcat, jetty,
  etc..): it would be much safer for your purpose and as it is close to
  gae, you can have 2 versions in parallel or migrate back easily to gae
  in the future when needed / possible.

  regards

  didier

  On Mar 16, 5:07 pm, romesh soni soni.rom...@gmail.com wrote:
   Did any one  have answer of my questions? I am worried.

   Thanks
   Romesh

   On Tue, Mar 15, 2011 at 10:58 PM, romesh soni soni.rom...@gmail.com
  wrote:
Hi Group,

I am building an application where my clients will be running my app
  engine
application on their local environments (they can not use internet
  because
its not stable and available all the times).  So I have two questions:

1.) Is it possible to run an app engine application totally on local
  (aka
dev) server. If yes, how to start stop the server and deploy the
application. (I am used to of Tomcat)

2.) uploading data from development server to production server as
  there
will be schedulers in local (aka development ) machines to push data
  to
production server so that in case of system crash on local serves, my
clients can switch to Production version.

Thanks
TL

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

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



-- 
You received this message 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: suggestions on template engine for GAE-java

2011-03-15 Thread Didier Durand
Hi,

see
http://groups.google.com/group/google-appengine-java/browse_thread/thread/ef090c0e6ea4a6d6/649797c2b590f672?lnk=gstq=framework+ikai#649797c2b590f672

tons of suggestions

regards

didier

On Mar 15, 6:07 pm, Jay Young jayyoung9...@gmail.com wrote:
 http://code.google.com/closure/templates/

 Google doesn't push their Closure Tools very hard, but I've had a lot of
 success with their templating engine.  Take a look at the docs.  It's not
 Django/PHP/JSP style templating, so it does take a bit of re-learning.  That
 said, there are a lot of benefits to their approach.

-- 
You received this message 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: Jersey crash in Eclipse

2011-03-13 Thread Didier Durand
Hi,

Jersey is supposed to work officially on app engine: see
http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine

May the associated how-to will help you fix your issue:
http://tugdualgrall.blogspot.com/2010/02/create-and-deploy-jax-rs-rest-service.html

regards

didier

On Mar 12, 5:59 pm, Adam Musial-Bright
adam.musialbri...@googlemail.com wrote:
 Hi,

 I am using GAE 1.4.2 + Eclipse 3.6 with the Google Eclipse Plugin on a
 Mac with the newest Java update 1.6.0_24.

 When I start App (Jersey) in Eclipse it crashes after a moment. There
 is no obvious error. This is the log from the Eclipse terminal:

 2011-03-12 17:51:55.513 java[958:903] [Java CocoaComponent
 compatibility mode]: Enabled
 2011-03-12 17:51:55.516 java[958:903] [Java CocoaComponent
 compatibility mode]: Setting timeout for SWT to 0.10
 Mar 12, 2011 4:51:57 PM com.google.apphosting.utils.jetty.JettyLogger
 info
 INFO: Logging to JettyLogger(null) via
 com.google.apphosting.utils.jetty.JettyLogger
 Mar 12, 2011 4:51:57 PM
 com.google.apphosting.utils.config.AppEngineWebXmlReader
 readAppEngineWebXml
 INFO: Successfully processed /Users/adam/Git/stickiepad/war/WEB-INF/
 appengine-web.xml
 Mar 12, 2011 4:51:57 PM
 com.google.apphosting.utils.config.AbstractConfigXmlReader
 readConfigXml
 INFO: Successfully processed /Users/adam/Git/stickiepad/war/WEB-INF/
 web.xml
 Mar 12, 2011 5:51:58 PM
 com.google.appengine.tools.development.DevAppServerImpl start
 INFO: The server is running athttp://localhost:/

 The Eclipse log in the workspace directory do not contain any errors.
 Is there another log I should check?

 Thanks
 Adam

-- 
You received this message 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: Blob Store Service and GWT

2011-03-13 Thread Didier Durand
Hi,

please provide the stack trace of your exception

regards

didier

On Mar 14, 2:04 am, Miguel Angel De la Torre Martínez
mdelatorr...@gmail.com wrote:
 Hello

 I'm new to the Blobstore so please help.

 I'm trying to use a really standard GWT RPC like this:

     public String askForBlobStoreURL() {

  try {

  return BlobstoreServiceFactory.getBlobstoreService()

   .createUploadUrl(/complejidad/u);

  } catch (java.lang.IllegalArgumentException ex) {

  ex.printStackTrace();

  } catch (BlobstoreFailureException ex) {

  ex.printStackTrace();

  }

  return null;

 }

 It works OK in development mode but it crashes every time in the server at
 the App Engine.

 I have tried a lot of things but nothing seems to work.

 Again, please help...

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Datastore throwing exception while putting entity.

2011-03-12 Thread Didier Durand
Hi,

Are you using queued tasks ? This can of error may appear then.

It appears on the dev server when the Task Queue env in not correctly
started.

regards

didier

On Mar 12, 8:03 am, dalchand choudhary dc4...@gmail.com wrote:
 Hi,

 I am using App Engine Locally with eclipse and while operating put on
 datastore using IterableEntity object (datastrore.put(entityList)) I am
 getting this Exception.

 com.google.appengine.api.datastore.DatastoreFailureException: handle 16 not
 found
 at
 com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:53)
 at
 com.google.appengine.api.datastore.DatastoreApiHelper$1.convertException(DatastoreApiHelper.java:98)
 at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:69)
 at
 com.google.appengine.api.datastore.FutureHelper$CumulativeAggregateFuture.get(FutureHelper.java:136)
 at
 com.google.appengine.api.datastore.FutureHelper$TxnAwareFuture.get(FutureHelper.java:213)
 at
 com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:71)
 at
 com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:32)
 at
 com.google.appengine.api.datastore.DatastoreServiceImpl$2.runInternal(DatastoreServiceImpl.java:113)
 at
 com.google.appengine.api.datastore.DatastoreServiceImpl$2.runInternal(DatastoreServiceImpl.java:110)
 at
 com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:31)
 at
 com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:110)

 Please help.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Datastore throwing exception while putting entity.

2011-03-12 Thread Didier Durand
Another try: did you start the local ds like said in
http://code.google.com/appengine/docs/java/tools/localunittesting.html#Writing_Datastore_Tests
?

regards

didier

On Mar 12, 11:27 am, dalchand choudhary dc4...@gmail.com wrote:
 No I am only testing locally using eclipse debugger.

 On Sat, Mar 12, 2011 at 3:55 PM, Didier Durand durand.did...@gmail.comwrote:







  Hi,

  Are you using queued tasks ? This can of error may appear then.

  It appears on the dev server when the Task Queue env in not correctly
  started.

  regards

  didier

  On Mar 12, 8:03 am, dalchand choudhary dc4...@gmail.com wrote:
   Hi,

   I am using App Engine Locally with eclipse and while operating put on
   datastore using IterableEntity object (datastrore.put(entityList)) I am
   getting this Exception.

   com.google.appengine.api.datastore.DatastoreFailureException: handle 16
  not
   found
   at

  com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:53)
   at

  com.google.appengine.api.datastore.DatastoreApiHelper$1.convertException(DatastoreApiHelper.java:98)
   at
  com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:69)
   at

  com.google.appengine.api.datastore.FutureHelper$CumulativeAggregateFuture.get(FutureHelper.java:136)
   at

  com.google.appengine.api.datastore.FutureHelper$TxnAwareFuture.get(FutureHelper.java:213)
   at

  com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:71)
   at

  com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:32)
   at

  com.google.appengine.api.datastore.DatastoreServiceImpl$2.runInternal(DatastoreServiceImpl.java:113)
   at

  com.google.appengine.api.datastore.DatastoreServiceImpl$2.runInternal(DatastoreServiceImpl.java:110)
   at

  com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:31)
   at

  com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:110)

   Please help.

  --
  You received this message because you are subscribed to the Google Groups
  Google App Engine for Java group.
  To post to this group, send email to
  google-appengine-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.

 --
 Dal Chand Choudhary
 Research Engineer
 DataResolve Technologies Pvt. Ltd.
 Kolkata, India.

-- 
You received this message 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: Blobstore Java API - people can upload whatever they want with no control

2011-03-11 Thread Didier Durand
Hi,

You're right: you can't control WHAT (size, etc...) the users upload
but you can control IF they upload: the key after /upload is generated
by App Engine and has to be a valid one (not too old, not used yet,
etc,,) to be usable for an update.

If you generate such an upload for authentified users, it gets pretty
secure.

What else you be looking for ? If it size, or content or something
equivalent that means anyway that you have to get out of the browser
sandbox in your application (via java applet, etc..) in order to do
the additional controls you need: a regular web app can't access and
check local files because of the sandbox.

regards

didier

On Mar 11, 12:07 pm, Luca Matteis lmatt...@gmail.com wrote:
 I have started using the Bloblstore Java 
 API:http://code.google.com/appengine/docs/java/blobstore/overview.html

 It seems like the upload form goes to something like:

     form action=/_ah/upload/agRtaWx1chsLEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YTww

 This is part of appengine, it's not my code. This means I can't
 prevent uploads of a given type or uploads of a given length. They get
 loaded into my datastore under __BlobInfo__ no matter what.
 Isn't this sort of bad? I don't want to have my datastore be filled
 with things even though it's google storing the data. Bots would just
 use it to upload spam. I want the upload to happen only by some means
 of authentication.

 Any ideas?

-- 
You received this message 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: Blobstore Java API - people can upload whatever they want with no control

2011-03-11 Thread Didier Durand
Hi,

I don't exactly know what you mean by secure but having only the
logged in people be allowed to upload will already significantly
reduce spam.

And then, you can use captchas to make sure it's a human, etc.

regards

didier

On Mar 11, 1:58 pm, Luca Matteis lmatt...@gmail.com wrote:
 So you're saying I should only generate the upload key url if the
 user is authenticated?
 And that would make it secure? avoid spam and such?

 On Fri, Mar 11, 2011 at 12:32 PM, Didier Durand durand.did...@gmail.com 
 wrote:
  Hi,

  You're right: you can't control WHAT (size, etc...) the users upload
  but you can control IF they upload: the key after /upload is generated
  by App Engine and has to be a valid one (not too old, not used yet,
  etc,,) to be usable for an update.

  If you generate such an upload for authentified users, it gets pretty
  secure.

  What else you be looking for ? If it size, or content or something
  equivalent that means anyway that you have to get out of the browser
  sandbox in your application (via java applet, etc..) in order to do
  the additional controls you need: a regular web app can't access and
  check local files because of the sandbox.

  regards

  didier

  On Mar 11, 12:07 pm, Luca Matteis lmatt...@gmail.com wrote:
  I have started using the Bloblstore Java 
  API:http://code.google.com/appengine/docs/java/blobstore/overview.html

  It seems like the upload form goes to something like:

      form 
  action=/_ah/upload/agRtaWx1chsLEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YTww

  This is part of appengine, it's not my code. This means I can't
  prevent uploads of a given type or uploads of a given length. They get
  loaded into my datastore under __BlobInfo__ no matter what.
  Isn't this sort of bad? I don't want to have my datastore be filled
  with things even though it's google storing the data. Bots would just
  use it to upload spam. I want the upload to happen only by some means
  of authentication.

  Any ideas?

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



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Blobstore API vs Datastore API

2011-03-11 Thread Didier Durand
Hi Luca,

1 thing before going in the new code: by using the blobs in datastore,
the interactive time limit (30s) apply (it does not for the blobstore)

I.e., the upload must be finished in 30s after that request is
cancelled by gae.

It may be harder to achieve even if your image is  1Mb if the
bandwidth is low: mobile, etc..

regards

didier

On Mar 11, 11:21 pm, Jeff Knox lairdk...@gmail.com wrote:
 The datastore works well for storing images (assuming they are  1MB). So
 far I haven't had more than about 15 images in the database but I don't
 think that really matters in terms of speed. My images are 1000 pixels in
 their longest dimension.

 I am also using the image API to do some manipulations. Passing the data
 around has been very quick and relatively painless.

-- 
You received this message 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: Doubt about Datastore (Python/JDO/Low level api)

2011-03-10 Thread Didier Durand
Hi,

You should give a try to packages like Objectify (recommended by
Google also: they tend to push people away from JDO / JPA...)

It is simpler to learn than JDO and much more efficient in terms or
performance.

I abandonned JDO for Objectify many months ago and I am extremely
happy about that decision

So, give it a try

regards

didier

On Mar 10, 11:37 am, coder bitliner.wa...@gmail.com wrote:
 I was seeing this testhttp://gaejava.appspot.com/
 and i have seen that crud operations in python are faster than in jdo
 and that in low-level api is faster than in jdo.
 So, i am tempted to leave java implementation for my google app engine
 apps and to use python.

 Or is there a way to create apps that are as fast as apps created in
 python?

 What do you think about this?

-- 
You received this message 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: GregorianCalendar source packages

2011-03-10 Thread Didier Durand
Hello,

The jvm implementation of GAE is not complete either: see this list to
see which classes are usable or not.

http://code.google.com/appengine/docs/java/jrewhitelist.html

regards

didier

On Mar 10, 7:50 pm, Damien Dessagne damien.dessa...@gmail.com wrote:
 I ran into the same problem earlier today, and had to search for quite a
 long time to understand where the problem came from.
 The problem comes only from GWT and is not related to AppEngine (obviously,
 this topic shouldn't be in the GAE/J GoogleGroup, but anyway ... ^^).
 GWT emulates the JRE on the client-side, but not all classes are supported.
 Have a look at the GWT Documentation  Reference  JRE Emulation Reference
 section for more details on what is currently supported and what is not.

 At the moment, the java.util.Calendar classes aren't supported
 (http://code.google.com/intl/fr-FR/webtoolkit/doc/latest/RefJreEmulati...),
 but you can use the com.google.gwt.user.datepicker.client.CalendarUtil class
 to perform simple calculations though.

 Hope this helps.

-- 
You received this message 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: uploading 100k lines into the datastore is enough to max out the CPU time?

2011-03-08 Thread Didier Durand
 getGeoBoxL2() {
                  return geoBoxL2;
          }
          public void setGeoBoxL2(long geoBoxL2) {
                  this.geoBoxL2 = geoBoxL2;
          }
          public long getGeoBoxL3() {
                  return geoBoxL3;
          }
          public void setGeoBoxL3(long geoBoxL3) {
                  this.geoBoxL3 = geoBoxL3;
          }
          public long getGeoBoxL4() {
                  return geoBoxL4;
          }
          public void setGeoBoxL4(long geoBoxL4) {
                  this.geoBoxL4 = geoBoxL4;
          }
          public long getGeoBoxL5() {
                  return geoBoxL5;
          }
          public void setGeoBoxL5(long geoBoxL5) {
                  this.geoBoxL5 = geoBoxL5;
          }

  }

  On Mar 7, 10:23 am, Didier Durand durand.did...@gmail.com wrote: Hi,

   Could you please disclose the source code of your objects stored in
   the ds ?

   You maybe right or wrong depending on how they were defined.

   regards

   didier

   On Mar 7, 9:41 am, Cláudio Coelho ereb...@gmail.com wrote:

Hi
I'm quite new at GAE, so I'm probably saying something silly, but for 
what I
read on GAE Java and GWT Application Development, I was under the 
impression
that GAE would generate indexes automatically except for some variable 
types
(blobs, text, etc) and for when we explicitly asked it not to.
However, when I look at the datastore-indexes-auto.xml file, it is 
indeed
empty. Through debugging I have been able to isolate that it's the
bottleneck is pm.makeConsistent of each entity to insert. Wouldn't 
having
indexes make the inserting even slower (since these indexes have to be
updated/rebuilt)?

thanks

C.

On Mon, Mar 7, 2011 at 5:44 AM, Didier Durand 
durand.did...@gmail.comwrote:

 Hi,

 The first issue that comes to mind in missing indexes: so huge scans
 of all existing data when you upload an additional line.

 What are your indexes ?

 regards

 didier

 On Mar 6, 12:43 pm, Cláudio Coelho ereb...@gmail.com wrote:
  Hi,
  My application needs a db of the world cities. I have a file that 
  has
 about
  100k lines  and I want to use it to populate the datastore.
  My first attempt failed because I didn't use tasks, so I was only 
  able to
  upload a limited set of cities. It spent 2% of CPU total time on 
  the app
  engine.
  I then changed the approach to use tasks.
  I basically read the file once to determine how many lines does it 
  have
 and
  then invoke tasks to read batches of 15k lines (supplying a start 
  and end
  indexes).
  These invoked tasks (createCities(int start, int end)) read the file
 again,
  get a list of 15k lines and then process it.
  The whole process takes about 15 seconds on my machine, however, 
  when I
 do
  this in the app engine, it takes 15 minutes (or more) and maxes out 
  the
 6.5
  hours of CPU time! I know there are plenty of optimizations I 
  should do
 to
  this process, but that doesn't seem to justify the 6.5 hours, so I 
  must
 be
  doing something seriously wrong.

  Does anybody have any clue of what I'm doing wrong? (Code attached)

  Thanks!

  private void createCities() {
  try
  {
  int count = countCitiesToLoad();
  final int batchSize = 15000;
  for(int start=0;startcount;start+=batchSize)
  {
  int end=start+batchSize;
  Queue queue = QueueFactory.getQueue(dbQueue);
  TaskOptions topt = TaskOptions.Builder.withUrl(/dbservlet);
  topt.param(command, createCities);
  topt.param(start, +start);
  topt.param(end, +end);
  queue.add(topt);
  logInfo(Dispatched order to create cities +start+ to +end);
  Thread.sleep(500);}
  }catch(Exception e)

  {
  e.printStackTrace();
  logError(e.getLocalizedMessage());

  }
  }

  private void createCities(int start, int end)
  {
  try
  {
   logInfo(Reading cities +start+ to +end);
  BufferedReader br= new BufferedReader(new 
  FileReader(data/cities.csv));
  String line=br.readLine();
  int counter=0;
  PersistenceManager pm =

 ...

 read more »

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-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: Creating/Compiling new Java class at run time

2011-03-08 Thread Didier Durand
Hi,

Even if you solve the File I/O issue, I would guess that you may then
face security issue: Google has probably protected its instances
against execution of code not coming direcly from the war file...

Anyway, very interesting question: pls, let us konw how you progress.

regards

didier

On Mar 9, 5:43 am, Larry Cable larry.ca...@gmail.com wrote:
 On Mar 8, 8:35 pm, Larry Cable larry.ca...@gmail.com wrote:



  On Mar 7, 12:13 am, Rick Smith rick@gmail.com wrote:

   Hi all

   Can I create and compile a java class at run time on goolge
   appengine.
   Use case: I have given a UI to my application user that they can
   define their own business logic.Now what is going to be main challenge
   is that I need to make new deployment each time when some one need to
   modify its business logic. As an alternate I want to store source code
   in data base and compile it when required.

   Regards

   Rick

  As others have pointed out the file I/O issue precludes using a
  compiler 

  The best I can suggest is using BCEL to construct classes at
  runtime... But I have never tried this with GAE so I do not know if
  BCEL is whitelist safe.

 Just as a followup you need to take a look at the BCEL API to see if
 you can create in-memory class files ... Otherwise you will trip up
 over the File I/O issue 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: uploading 100k lines into the datastore is enough to max out the CPU time?

2011-03-07 Thread Didier Durand
Hi,

Could you please disclose the source code of your objects stored in
the ds ?

You maybe right or wrong depending on how they were defined.

regards

didier

On Mar 7, 9:41 am, Cláudio Coelho ereb...@gmail.com wrote:
 Hi
 I'm quite new at GAE, so I'm probably saying something silly, but for what I
 read on GAE Java and GWT Application Development, I was under the impression
 that GAE would generate indexes automatically except for some variable types
 (blobs, text, etc) and for when we explicitly asked it not to.
 However, when I look at the datastore-indexes-auto.xml file, it is indeed
 empty. Through debugging I have been able to isolate that it's the
 bottleneck is pm.makeConsistent of each entity to insert. Wouldn't having
 indexes make the inserting even slower (since these indexes have to be
 updated/rebuilt)?

 thanks

 C.

 On Mon, Mar 7, 2011 at 5:44 AM, Didier Durand durand.did...@gmail.comwrote:



  Hi,

  The first issue that comes to mind in missing indexes: so huge scans
  of all existing data when you upload an additional line.

  What are your indexes ?

  regards

  didier

  On Mar 6, 12:43 pm, Cláudio Coelho ereb...@gmail.com wrote:
   Hi,
   My application needs a db of the world cities. I have a file that has
  about
   100k lines  and I want to use it to populate the datastore.
   My first attempt failed because I didn't use tasks, so I was only able to
   upload a limited set of cities. It spent 2% of CPU total time on the app
   engine.
   I then changed the approach to use tasks.
   I basically read the file once to determine how many lines does it have
  and
   then invoke tasks to read batches of 15k lines (supplying a start and end
   indexes).
   These invoked tasks (createCities(int start, int end)) read the file
  again,
   get a list of 15k lines and then process it.
   The whole process takes about 15 seconds on my machine, however, when I
  do
   this in the app engine, it takes 15 minutes (or more) and maxes out the
  6.5
   hours of CPU time! I know there are plenty of optimizations I should do
  to
   this process, but that doesn't seem to justify the 6.5 hours, so I must
  be
   doing something seriously wrong.

   Does anybody have any clue of what I'm doing wrong? (Code attached)

   Thanks!

   private void createCities() {
   try
   {
   int count = countCitiesToLoad();
   final int batchSize = 15000;
   for(int start=0;startcount;start+=batchSize)
   {
   int end=start+batchSize;
   Queue queue = QueueFactory.getQueue(dbQueue);
   TaskOptions topt = TaskOptions.Builder.withUrl(/dbservlet);
   topt.param(command, createCities);
   topt.param(start, +start);
   topt.param(end, +end);
   queue.add(topt);
   logInfo(Dispatched order to create cities +start+ to +end);
   Thread.sleep(500);}
   }catch(Exception e)

   {
   e.printStackTrace();
   logError(e.getLocalizedMessage());

   }
   }

   private void createCities(int start, int end)
   {
   try
   {
    logInfo(Reading cities +start+ to +end);
   BufferedReader br= new BufferedReader(new FileReader(data/cities.csv));
   String line=br.readLine();
   int counter=0;
   PersistenceManager pm = PMF.get().getPersistenceManager();
   ArrayListString lines = new ArrayListString();
   while(line!=null || counterend)
   {
   if(counter=start  counter end)
   lines.add(line);
   counter++;
   line=br.readLine();}

   br.close();
   logInfo(Adding cities +start+ to +end);
   createCities(lines);
   logInfo(Done cities +start+ to +end);}

   catch(Exception e)
   {
   e.printStackTrace();
   logError(e.getLocalizedMessage());

   }
   }

   private void createCities(ArrayListString lines)
   {
   if(lines==null)
   return;
   PersistenceManager pm = PMF.get().getPersistenceManager();
   HashMapString, Country countryMap = loadCountryMap();
   try{
   for(String line : lines)
   if(line!=null)
   {
   String fields[]=line.split(,);
   if(fields.length7)
   logError(length error in line:+line);
   else
   {
   Location loc = new Location();
   loc.setName(fields[2]);
   loc.setLatitude(Double.parseDouble(fields[3]));
   loc.setLongitude(Double.parseDouble(fields[4]));
   loc.setPopulation(Integer.parseInt(fields[6]));
   {
   Country c = countryMap.get(fields[5]);
   if(c==null)
   logError(Failed to get country for:+line);
   else
   {
   loc.setCountryId(c.getCountryId());
   loc.setCountry(c.getName());
   pm.makePersistent(loc);}
   }
   }
   }
   } catch (Exception e) {

   e.printStackTrace();

   } finally {
   pm.close();
   }
   }

  --
  You received this message 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.

 --
 Cláudio Coelho

 Great spirits have often encountered violent opposition from

[appengine-java] Re: What is maximum number of entities I can update within the 30 sec time limit of App engine ?

2011-03-07 Thread Didier Durand
Hi,

I have a personal rule of thumb of 10 udpated entities / second [Ds is
made for heavy read throughput but is not so fast on writes]

The new High Replication datastore seems (not tried it personally...)
slower: 1 update per second is what is the max recommended. See
http://code.google.com/appengine/docs/python/datastore/hr/overview.html

N.B: my personal 10 updates/s works only if entities do not belong to
same entity group else throughput gets much lower.

So, for a big update, you have to use queued tasks:
- you should get 10 mins instead of 30s for interactive requests
- you can chain tasks when you reach the 10 min limit: the one
reaching 10 mins limit schedules another one just before the time
limit. Even better, you can go with several tasks in parallel and get
extremely fast (provided that the tasks don't conflict with other on
updates: your data architecture has to allow for it)

regards

didier

On Mar 7, 6:40 am, suersh babu sureshgbab...@gmail.com wrote:
 Hi,

 I like to known what is the maximum number of entities I can update within
 the 30 sec
 time limit of App engine.

 Let say If I have a kind called Employee which  has 2000 entities and each
 of this entity have
 10 Properties,  so if I need to update all of this 2000 entities of
 Employee,  what is the maximum
 entities that I can update  within 30 sec time limit.

 Any suggestion much appreciated.

 *Regards**

 Suresh Babu G*

 http://www.AccountingGuru.inhttp://www.accountingguru.in/

-- 
You received this message 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: compute intensive application

2011-03-07 Thread Didier Durand
My 2 cents:

- queues scale up very well: I tried them with no throttle (on bucket
size) and you easily get 12-15 jvm running your computations. To my
knowledge, queues are the best way to get parallelism on GAE.
but
- data access / contention may be the issue: don't you write anything
back ? That may become the issue after your big computations have run.
You may have write contentions then unless you use sharding.

We may provide more feedback but you have to disclose more on what you
want to achieve.

regards

didier

On Mar 7, 4:15 pm, Simon Knott knott.si...@gmail.com wrote:
 A few thoughts:

    - Are you taking into consideration loading requests?  These will cause
    pauses which can last a few seconds.
    - Have you enabled warm-up requests?
    - What do your logs say are causing the 5xx errors?
    - Have you looked at the logs for what may be causing the long pauses?  
    i.e. are they delays caused by communications between your test PC and the
    app, or entirely within the GAE app?
    - It's very easy to set up task queues to give you the same stats and
    give you a comparison - personally it sounds like task queues would be a
    good fit for your requirements, based on the slightly vague information!

-- 
You received this message 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.



  1   2   3   4   5   >