Hi Robert, I got put the service on with all my fortunes.
I just did that

        String query = "select from " + FortunesDAO.class.getName();
        fortunes = (List<FortunesDAO>) pm.newQuery(query).execute();
if fortunes.size() == 0
add to DB
else
"Live is good!"
:-D

That is not the best pratice requesting all the fortunes each time the app
run, so with the DB OK, I just remove the verification. :D

I still dont made a client to access the service, but you can access here
http://fortunesweb.appspot.com/fortunesweb?id=1
:-D

Just one thing more..what will happen if someone give me a DOS atack? Google
just turn the service off when my quota become full?
Can someone give me a tip about a way to avoid a massive access to the
service? Add a key?
Thanks for the help!

2011/4/10 Robert Kluin <[email protected]>

> Hi Júlio,
>  As I understand, you are trying to run an initial data import when
> you first deploy your application.  I would suggest you write an
> 'admin page' to load the data.  Then you can login and load the data
> after deploying your app.  Alternatively you could use the bulkloader
> tool (I believe it is in the Python section of the docs) to load data
> into your app.
>
>
>
> Robert
>
>
>
>
>
>
> 2011/4/9 Júlio Cesar Bueno Cotta <[email protected]>:
> > Hello there,
> > I am new on App Engine and need some help and I am sorry if I am asking
> > silly things.
> > I read some tutorial in the App Engine site, but I still have some
> > questions, I also had try to threads over the group, but none what I
> found
> > help me and of course I had search on Google.
> > Let me try explain..
> > I want do create a simple webservice to return a fortune.I think...When I
> > send the project to App Engine the application need to populate the DB of
> > fortunes.
> > I am following the link to get data to the data base. I think I can write
> a
> > query to add data to, right? But where call the method to populate?
> > I would like to know if is there  some class that I can extend and
> override
> > methods that is call from my application when it is being installed on
> App
> > Engine?
> > Something like:
> > Class Inst extend Install{
> >
> >       @Override
> >       public void onInstall(){
> >             //populate DB
> >
> >       }
> >
> >       @Override
> >       public void OnRemove(){
> >             // Remove DB
> >       }
> > }
> >
> > I also would like to know if the webservice can be public, I mean..the
> > client application don't need to login on a Google Account.
> > Thanks in advance and sorry for my poor English, I am from Brasil.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> > http://groups.google.com/group/google-appengine?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>


-- 
Júlio Cesar Bueno Cotta
Bacharel em Ciência da Computação pela UFV
Mestrando em Ciência da Computação pela UFABC

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to