[appengine-java] Re: how to query TaskQueue for count of running/pending tasks?

2011-01-23 Thread Didier Durand
Hi,

it seems that you're right: I also see no other way and did the same
as you (with same issue)

Nothing about this in the official roadmap either.

didier

On Jan 22, 8:19 pm, "armh...@gmail.com"  wrote:
> Is it possible to programmatically query the Task Queue API to see how
> many tasks are currently executing/pending?
>
> I don't see any way to do this in the API, and so I resorted to
> creating objects in the Datastore to represent queued tasks. When run,
> the tasks then remove their corresponding entry from the Datastore.
>
> As you can imagine, it's easy for this to get out of sync. I'd
> actually be pretty happy just to be able to get a simple count of
> tasks in the queue for a given queue name.
>
> 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: cron job to pull a file into the blobstore

2011-01-23 Thread Didier Durand
PS to my last post: to make things simpler, "Programatic Blob creation
in Blobstore" is on the official gae roadmap but no date for release

See http://code.google.com/appengine/docs/roadmap.html

didier

On Jan 23, 8:55 am, Didier Durand  wrote:
> Hi,
>
> Yes, you can launch URL fetch to get your file and then store it.
>
> 1 limit though: the 10 min processing (the processing limit of a
> file). You have to be able to do your get in that amount of time minus
> a bit (to give some time to do the store itself)
>
> If your file is not that big, you should rather use the Blob type (< 1
> Mbyte) that can go directly into the datastore rather than a blob
> stored into the blobstore because it's basically prohibited to write
> to the blobstore from your application.
>
> If you really need the blobstore, you have to use the trick explained
> here (2nd 
> post):http://groups.google.com/group/google-appengine-java/browse_thread/th...
>
> If you really need the blobstore, can't you push from the server where
> you csv file resides rather than pull from gae ?
>
> hope it helps
>
> didier
>
> On Jan 22, 8:42 pm, Toby  wrote:
>
> > Hi,
> > On a daily basis I need to import a data feed which sits in a CSV file
> > on a server. I wonder if there is some way to use a cron to launch a
> > urlfetch and save that file to the blobstore.
> > Is this possible?
>
> > Thanks
> > Tobi
>
>

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



Re: [appengine-java] What was your Slim3 Datastore API experience like?

2011-01-23 Thread Yasuo Higa
Hi systemsplanet,

> - Having to run the Annotation pre-processor as part of the IDE (will
> that work with maven-command line?)

Yes.
See http://sites.google.com/site/slim3appengine/maven

> - Global transaction performance. The Slim3 site shows much faster
> times than I'm seeing
>   http://sites.google.com/site/slim3appengine/

The performance depends on app engine condition.

> - What happens when a global transaction fails? Can it be detected
> when it occurs so the user can be notified?

If a global transaction fails before commit, it will be rolled back.
If a global transaction fails after commit, it will be rolled forward
by task queue.

> - Is it using undocumented Google APIs?
>
No.

Yasuo Higa

-- 
You received this message 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] Cannot access text fields, when uploading Blobs

2011-01-23 Thread Dimedrol
Hello, All!

I'm trying to upload some pictures (as Blobs) to the datastore.
Picture (
and


So, the problem is: I cannot access these my text fields (pictureTitle
and pictureDescription) in any way.
I tried well known suggestion like:
**
FileItemIterator iterator = upload.getItemIterator(request);
while (iterator.hasNext()) {
FileItemStream item = iterator.next();
InputStream inputStream = item.openStream();
**

And simple access like: (String) request.getAttribute("pictureTitle").

No luck.

I see via FireBug, that these my 2 field are sended to this generated
upload URL (blobstoreService.createUploadUrl("/myservlet")).

But after that - they disappeared.

Even, when I use a piece of code from 
http://code.google.com/appengine/docs/java/blobstore/overview.html
"Complete Sample App" section, when we redirect request - nothing
helps.
I cannot access my text parameters.

Please, what I am doing wrong?

-- 
You received this message 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 query TaskQueue for count of running/pending tasks?

2011-01-23 Thread armh...@gmail.com
Hi Didier,

I'm told (unofficially) that this is in fact planned for the future:

http://stackoverflow.com/questions/4770011/google-app-engine-java-taskqueue-api-how-to-query-number-of-running-pending-ta/4771423#4771423

It would be nice to hear something official though.

Regards,
George

On Jan 23, 3:02 am, Didier Durand  wrote:
> Hi,
>
> it seems that you're right: I also see no other way and did the same
> as you (with same issue)
>
> Nothing about this in the official roadmap either.
>
> didier
>
> On Jan 22, 8:19 pm, "armh...@gmail.com"  wrote:
>
>
>
>
>
>
>
> > Is it possible to programmatically query the Task Queue API to see how
> > many tasks are currently executing/pending?
>
> > I don't see any way to do this in the API, and so I resorted to
> > creating objects in the Datastore to represent queued tasks. When run,
> > the tasks then remove their corresponding entry from the Datastore.
>
> > As you can imagine, it's easy for this to get out of sync. I'd
> > actually be pretty happy just to be able to get a simple count of
> > tasks in the queue for a given queue name.
>
> > 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] Is it guaranteed that App Engine retries a task until it succeeds.

2011-01-23 Thread ss.require
Could google developers clarify the next:
1)Documentation says:
If a task fails to execute (by returning any HTTP status code outside
of the range 200-299), App Engine retries until it succeeds.

But It is not clear if it is guaranteed or not. E.g. GAE retries a
task for the 5 time and the task is failed again. But after GAE
doesn't retry a task for the 6 time and the task is undone
permanently. Can this use case happen? Does a developer generally have
to handle such use cases in the app or not?

2) From : 
http://code.google.com/intl/uk-UA/appengine/docs/java/taskqueue/overview.html#Tasks_Within_Transactions

Tasks added within a transaction are considered to be a part of it and
have the same level of isolation and consistency.

What does it mean: [have the same level of isolation and
consistency] ? When should I care of that in my app (an example)?

-- 
You received this message 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] Task Queue API Update

2011-01-23 Thread Doug


Good Afternoon All,

 I am working to convert from the Task Queue Labs API to the non-labs API 
version.  I am finding it slightly more difficult than I initially 
anticipated.  It appears that how I was adding tasks to the queue is not 
compatible with the non-labs API.  If I just update the imports to bring in 
the new API I get the error “The method url(String) is undefined for the 
type TaskOptions.Builder”.  I  have provide some example of my code below, 
if anyone else has converted can you give me some guidance on what I am 
doing wrong?

 

Current code, using the Labs API:
*import* *com.google.appengine.api.labs.taskqueue.Queue*;
*import* *com.google.appengine.api.labs.taskqueue.QueueFactory*;
*import* *com.google.appengine.api.labs.taskqueue.TaskOptions*;
*import* *com.google.appengine.api.labs.taskqueue.TaskOptions.Method*;
*import* *com.google.appengine.api.labs.taskqueue.TaskOptions.Builder*.*;

…

Queue add_queue = QueueFactory.getQueue("add");
…

for (int i = 1; i < Item_counter; i++) {

add_queue.add(TaskOptions.Builder.url("/add?item="+ItemURL[i]).method(Method.GET));
}

 

Code using the non-Labs API

import com.google.appengine.api.taskqueue.Queue;
import com.google.appengine.api.taskqueue.QueueFactory;
import com.google.appengine.api.taskqueue.TaskOptions;
import com.google.appengine.api.taskqueue.TaskOptions.Method;
import static com.google.appengine.api.taskqueue.TaskOptions.Builder.*;

 

TaskOptions TOdefault = 
com.google.appengine.api.taskqueue.TaskOptions.Builder.withDefaults();

…

for (int i = 1; i < Item_counter; i++) {

TaskOptions TO = new TaskOptions(TOdefault);
TO.url("/add");
TO.param("item", itemURL[i]);
TO.method(Method.GET);
add_queue.add(TO);
}


The new code compiles and will “run”, but I get all kinds of null pointer 
exceptions from the tasks when they try to run.  If I switch back to the 
labs API it works perfectly.  Can anyone help me understand what I need to 
do to either get my original code to work with the new API and/or what I did 
incorrectly with the updated code?


Thanks,
Doug

-- 
You received this message 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 query TaskQueue for count of running/pending tasks?

2011-01-23 Thread Doug

There was another thread on this same topic a few months back.  I am not 
able to find it right now, but I believe that I remember that someone was 
using URL Fetch to fetch 
"https://appengine.google.com/queues?&app_id=&version_id=xx"; and 
then parsing the page to determine the number of tasks on each queue.  I 
don't recall how they were handling authentication. 

Doug

-- 
You received this message 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: Amazon widget not showing on PC's

2011-01-23 Thread WillSpecht
I'm sorry, I guess this was a little off topic, but I am hosting this
on google app engine. So I thought maybe there was something about
cross site scripting that acted weird on app engine.  I later found
out that my problem was an ad blocker on the machine I was testing
on.  Guess I should have made it more clear that I was using app
engine.  Thanks for pointing this out with a useless message, and
allowing me to write another useless post to follow up on your initial
uselessness.

On Jan 21, 11:55 pm, jp  wrote:
> Dear WillSpecht, this forum is for people to discuss issues with
> Google App Engine for Java.  Please take your totally unrelated issue
> elsewhere.

-- 
You received this message 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] Can't fetch a dataset using primary key

2011-01-23 Thread herber . marc
Hi all,

I'm pretty new using GQL so hopefully someone can help me solving this easy 
(?) problem.

I store my Entities in the DB using datastore.put( Entity ) without using an 
ID. But if I look at the Datastore Viewer I see that these entities are 
stored with an unique id called *ID/Name*. Now I'm trying to load such an 
entity using this code:

SELECT * from DB WHERE ID/Name = 'id=1' <- Error
SELECT * from DB WHERE ID = 'id=1' <- empty resultset
SELECT * from DB WHERE Name = 'id=1' <- empty resultset
SELECT * from DB WHERE ID/Name = '1' <- Error
SELECT * from DB WHERE ID = '1' <- empty resultset
SELECT * from DB WHERE Name = '1' <- empty resultset

Can anybody tell me what to use to get this entry?

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] Is App Engine Down? Unable to access my website

2011-01-23 Thread Sumi


-- 
You received this message 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 Down? Unable to access my website

2011-01-23 Thread Sumi
Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error.

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



Re: [appengine-java] Re: Is App Engine Down? Unable to access my website

2011-01-23 Thread Khor Yong Hao
I am able to access just now.

On Mon, Jan 24, 2011 at 11:31 AM, Sumi  wrote:

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

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



Re: [appengine-java] Task Queue API Update

2011-01-23 Thread Fabrizio Accatino
Method names changed  :)

.url(...) --> withUrl(...)
.method(...) --> withMethod(...)


http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.Builder.html


Fabrizio



On Sun, Jan 23, 2011 at 7:14 PM, Doug  wrote:

> Good Afternoon All,
>
>  I am working to convert from the Task Queue Labs API to the non-labs API
> version.  I am finding it slightly more difficult than I initially
> anticipated.  It appears that how I was adding tasks to the queue is not
> compatible with the non-labs API.  If I just update the imports to bring
> in the new API I get the error “The method url(String) is undefined for the
> type TaskOptions.Builder”.  I  have provide some example of my code below,
> if anyone else has converted can you give me some guidance on what I am
> doing wrong?
>
>
>
> Current code, using the Labs API:
> *import* *com.google.appengine.api.labs.taskqueue.Queue*;
> *import* *com.google.appengine.api.labs.taskqueue.QueueFactory*;
> *import* *com.google.appengine.api.labs.taskqueue.TaskOptions*;
> *import* *com.google.appengine.api.labs.taskqueue.TaskOptions.Method*;
> *import* *com.google.appengine.api.labs.taskqueue.TaskOptions.Builder*.*;
>
> …
>
> Queue add_queue = QueueFactory.getQueue("add");
> …
>
> for (int i = 1; i < Item_counter; i++) {
>
>
> add_queue.add(TaskOptions.Builder.url("/add?item="+ItemURL[i]).method(Method.GET));
> }
>
>
>
> Code using the non-Labs API
>
> import com.google.appengine.api.taskqueue.Queue;
> import com.google.appengine.api.taskqueue.QueueFactory;
> import com.google.appengine.api.taskqueue.TaskOptions;
> import com.google.appengine.api.taskqueue.TaskOptions.Method;
> import static com.google.appengine.api.taskqueue.TaskOptions.Builder.*;
>
>
>
> TaskOptions TOdefault =
> com.google.appengine.api.taskqueue.TaskOptions.Builder.withDefaults();
>
> …
>
> for (int i = 1; i < Item_counter; i++) {
>
> TaskOptions TO = new TaskOptions(TOdefault);
> TO.url("/add");
> TO.param("item", itemURL[i]);
> TO.method(Method.GET);
> add_queue.add(TO);
> }
>
>
> The new code compiles and will “run”, but I get all kinds of null pointer
> exceptions from the tasks when they try to run.  If I switch back to the
> labs API it works perfectly.  Can anyone help me understand what I need to
> do to either get my original code to work with the new API and/or what I did
> incorrectly with the updated code?
>
>
> Thanks,
> Doug
>
>  --
> You received this message 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.