[appengine-java] Re: Index control in the low-level datastore API

2009-08-22 Thread Vince Bonfanti
Look at the Entity.setUnindexedProperty() method. On Fri, Aug 21, 2009 at 7:51 PM, David Givend...@cowlark.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I don't seem to see any APIs in DatastoreService or Entity that allow me to do anything with indices. In particular, I want

[appengine-java] Re: How to query multivalued properties in low-level Datastore API?

2009-08-25 Thread Vince Bonfanti
Yes, adding multiple filters (with any FilterOperator) does an AND operation. Vince On Tue, Aug 25, 2009 at 10:51 AM, ted stockwellemorn...@gmail.com wrote: Thanks much. One more question... If I want to select recipes that have both hamburger and olives should I just add two filters???  

[appengine-java] Re: Service logic conflicts with transaction policy for entity groups

2009-08-26 Thread Vince Bonfanti
I thought it did, but I may not have fully understood the question. Using distributed locks would allow him to implement atomicity (synchronization) of transactions in his application code without modifying his data model, something like this: exclusiveLock.lock(); try { //

[appengine-java] Re: Service logic conflicts with transaction policy for entity groups

2009-08-26 Thread Vince Bonfanti
entity B fails. Good stuff! On Aug 26, 11:51 am, Vince Bonfanti vbonfa...@gmail.com wrote: I thought it did, but I may not have fully understood the question. Using distributed locks would allow him to implement atomicity (synchronization) of transactions in his application code without

[appengine-java] Java memcache increment with initial value

2009-09-04 Thread Vince Bonfanti
I notice that the Python memcache API supports an increment with initial value operation: http://code.google.com/appengine/docs/python/memcache/clientclass.html#Client_incr Are there any plans to support this on Java? In the Python implementation, is this simply done as three memcache

[appengine-java] new stack traces after upgrading to SDK 1.2.5

2009-09-04 Thread Vince Bonfanti
After upgrading to SDK 1.2.5, I've noticed a set of stack traces that show up in both the development environment and on the production server. These only appear if the logging level is set to INFO, and they show up as INFO logs on the production server. I'm pretty sure these are new in SDK 1.2.5

[appengine-java] Re: new stack traces after upgrading to SDK 1.2.5

2009-09-04 Thread Vince Bonfanti
That's fine. :) I just wanted to make sure someone was aware of this, since it appeared to be something new introduced with the latest SDK. On Fri, Sep 4, 2009 at 4:14 PM, Toby Reyeltsto...@google.com wrote: It's a message that you can safely ignore. There is a reason it's logged at INFO. :)

[appengine-java] QueueFactory.getQueue( String )

2009-09-04 Thread Vince Bonfanti
My first question on task queues... I'd like to design my application to use a named (configured) queue if it exists, but to drop back to using the default queue if the named queue isn't configured. I'd like to do something like this: Queue q = QueueFactory.getQueue( myQueue ); if ( q

[appengine-java] Re: Bulk writes to datastore

2009-09-05 Thread Vince Bonfanti
Your two quick notes seem to be contradictory. In order to use transactions, don't all of the entities have to be in the same entity group? Vince On Fri, Sep 4, 2009 at 8:24 PM, Jason (Google)apija...@google.com wrote: Batch puts are supported, yes, and as of yesterday's release, calling

[appengine-java] Re: QueueFactory.getQueue( String )

2009-09-05 Thread Vince Bonfanti
I found the answer to this: the Queue.add() method throws IllegalArgumentException if the specified queue isn't configured (BTW, the message in the IllegalArgumentException is The specified queue is unknown : but doesn't actually include the queue name in the message string). This isn't as nice

[appengine-java] support for task queues in development environment?

2009-09-06 Thread Vince Bonfanti
Task queues are working properly when I deploy my app to Google's servers, but never get executed in my development environment (Eclipse Galileo). There are no errors, no logs, no indication of what's going wrong. Queue.add() returns successfully, but my tasks never get executed. I'm running the

[appengine-java] Re: support for task queues in development environment?

2009-09-07 Thread Vince Bonfanti
Perfect! At least for initial debugging, that's actually better than having the tasks execute automatically--it makes it easier to see what's going on with multiple tasks being queued. Thanks. On Sun, Sep 6, 2009 at 7:05 PM, Max Rossmaxr+appeng...@google.com wrote: Hi Vince, In order to get

[appengine-java] Re: QueueFactory.getQueue( String )

2009-09-08 Thread Vince Bonfanti
in getting some feedback on these. Vince On Tue, Sep 8, 2009 at 4:11 PM, Jason (Google)apija...@google.com wrote: Hi Vince. I think this sounds reasonable. Please open a new issue. - Jason On Sat, Sep 5, 2009 at 11:48 AM, Vince Bonfanti vbonfa...@gmail.com wrote: I found the answer

[appengine-java] Re: support for task queues in development environment?

2009-09-08 Thread Vince Bonfanti
, Vince Bonfanti vbonfa...@gmail.com wrote: Perfect! At least for initial debugging, that's actually better than having the tasks execute automatically--it makes it easier to see what's going on with multiple tasks being queued. Thanks. On Sun, Sep 6, 2009 at 7:05 PM, Max Rossmaxr+appeng

[appengine-java] Re: What's the Java equivalent of appcfg.py?

2009-09-14 Thread Vince Bonfanti
The GaeVFS (Google App Engine Virtual File System) project implements a distributed, writable file system for Google App Engine: http://code.google.com/p/gaevfs/ The current release (0.3) supports an API based on Apache Commons VFS (http://commons.apache.org/vfs/). The latest code in

[appengine-java] Re: Creating static files from a servlet

2009-09-16 Thread Vince Bonfanti
Are there any details available for this feature other than this one-liner? Thanks. On Wed, Sep 16, 2009 at 1:50 PM, Don Schwarz schwa...@google.com wrote: The Service for storing and serving large files item on the Roadmap will give you what you want when it launches:

[appengine-java] Re: Writing to a local file system using gaevfs

2009-09-24 Thread Vince Bonfanti
Yes, GaeVFS (http://code.google.com/p/gaevfs/) provides access to the local file system so that you can use a single API for accessing both local and virtual files. However, local files are read-only; and, you cannot create a virtual file with the same path and name as a local file. Vince On

[appengine-java] Re: Photo and Video services

2009-10-22 Thread Vince Bonfanti
Hi Diana, I've created GaeVFS to solve this problem: http://code.google.com/p/gaevfs/ You can view a demonstration here: http://gaevfs.appspot.com/ Note that the current released version (0.3) will only upload about 2.0MB before timing out; the latest code in SVN will support the

[appengine-java] Re: Photo and Video services

2009-10-22 Thread Vince Bonfanti
entered a path like /gaevfs/mypic or /gaevfs/images/mypic, then selected a local small photo.  On submitting the form, received the 500 error...perhaps the photo had spaces in the name? On Oct 22, 3:10 pm, Vince Bonfanti vbonfa...@gmail.com wrote: You were unable to upload a small photo on my

[appengine-java] Re: Photo and Video services

2009-10-23 Thread Vince Bonfanti
No, not yet. It's on the TODO list (see line 171 of the GaeVfsServlet source code). If you--or anyone else--wants to add this I'll be happy to accept a patch. Vince On Fri, Oct 23, 2009 at 11:42 AM, Diana Cruise diana.l.cru...@gmail.com wrote: In terms of performance does gaevfs accmmodate

[appengine-java] Re: extracting zip files on GAE

2009-10-23 Thread Vince Bonfanti
I assume you're using GaeVFS (http://code.google.com/p/gaevfs/)? Basically, you need to create a java.util.ZipInputStream instance to read the zip file. GaeVFS implements a file system API based on Apache Commons VFS (http://commons.apache.org/vfs/). To open an InputStream for a file using

[appengine-java] trouble with SDK 1.2.6

2009-10-23 Thread Vince Bonfanti
I'm having no luck with SDK 1.2.6 within Eclipse 3.5.1 (Windows). Yes, I've added the -javaagent VM argument to my debug configuration. However, if I try to do almost anything at all within my ServletContextListener.contextInitialized() method I get this: 2009-10-23 17:48:59.192::INFO: Logging

[appengine-java] SDK does not upload files that start with .

2009-10-23 Thread Vince Bonfanti
The SDK (1.2.5) does not upload file with names that start with . such as .h2.server.properties. I assume this is because such files are considered hidden on Linux/UNIX; but, I'm running on Windows, so this must be something in the SDK itself and not caused by the file system. Is this

[appengine-java] Re: trouble with SDK 1.2.6

2009-10-23 Thread Vince Bonfanti
to figure out how to configure things properly to support junit testing... Thanks. Vince 2009/10/23 Miguel Méndez mmen...@google.com: I'm going to check and see if I can reproduce this using your project. On Fri, Oct 23, 2009 at 2:06 PM, Vince Bonfanti vbonfa...@gmail.com wrote: I'm having no luck

[appengine-java] Re: trouble with SDK 1.2.6

2009-10-23 Thread Vince Bonfanti
, 2009 at 3:01 PM, Vince Bonfanti vbonfa...@gmail.com wrote: I just figured out the problem. I had added appengine-api-stubs.jar and appengine-local-runtime.jar to my project build path to support junit testing. Upgrading to the 1.2.6 versions only changed the error message, but removing them from

[appengine-java] Re: Eclipse Plugin Update for App Engine SDK 1.2.7?

2009-10-23 Thread Vince Bonfanti
I think the 1.2.7 update is only for Python. The latest Java SDK is 1.2.6. On Fri, Oct 23, 2009 at 12:02 PM, hildenl louis.hil...@gmail.com wrote: Has anyone been able to update to 1.2.7 from Eclipse?  I've got the http://dl.google.com/eclipse/plugin/3.5 configured as a software site and its

[appengine-java] Re: any plans for deferred.defer in Java?

2009-10-31 Thread Vince Bonfanti
This looked like an interesting problem, and I already had most of the pieces in place, so here's my first attempt, which is implemented in a single class (also attached, along with some test files):

[appengine-java] Re: SimpleDS: an alternative for Datastore persistence

2009-11-02 Thread Vince Bonfanti
You might be interested in my CachingDatastoreService class: http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlanta/appengine/datastore/CachingDatastoreService.java It has the following features: - Implements the com.google.appengine.api.datastore.DatastoreService, so it's

[appengine-java] Re: SimpleDS: an alternative for Datastore persistence

2009-11-03 Thread Vince Bonfanti
Great! Since someone else is now using this besides me, I've added more comments. Also, I've added some testcases and fixed an issue when invoking put() with entities that contain partial keys. If your entities don't have complete keys when invoking put(), you should go get the latest code. Let

[appengine-java] Re: task queue limit 30 sec?

2009-11-03 Thread Vince Bonfanti
Here's one I got a few days ago. It looks like it timed-out while just queuing up a task: Uncaught exception from servlet com.google.apphosting.api.DeadlineExceededException: This request (8b0dab1ffe61eb3f) started at 2009/10/31 16:30:47.041 UTC and was still executing at 2009/10/31 16:31:16.438

[appengine-java] Re: any plans for deferred.defer in Java?

2009-11-05 Thread Vince Bonfanti
I just committed an update to this to remove the static DatastoreService instance. Vince On Sat, Oct 31, 2009 at 2:08 PM, Vince Bonfanti vbonfa...@gmail.com wrote: This looked like an interesting problem, and I already had most of the pieces in place, so here's my first attempt, which

[appengine-java] Re: any plans for deferred.defer in Java?

2009-11-10 Thread Vince Bonfanti
I'm not sure about adding a TemporaryTaskFailure (TransientTaskFailure?) exception, but regardless of whether we do or not, it seems that the Deferrable.doTask method should be declared to throw Exception. Otherwise, implementations will be restricted to throwing only RuntimeException (or

[appengine-java] Re: any plans for deferred.defer in Java?

2009-11-10 Thread Vince Bonfanti
of TransientFailureException. - Added comments. Let me know if you have additional feedback. Vince On Sun, Nov 8, 2009 at 3:34 PM, Nick Johnson (Google) nick.john...@google.com wrote: Hi Vince, On Sun, Nov 8, 2009 at 7:58 PM, Vince Bonfanti vbonfa...@gmail.com wrote: Hi Nick, Thanks

Re: [appengine-java] Using class objects as keys in tasks for TaskQueue

2009-11-15 Thread Vince Bonfanti
You can pass an object to a task by first serializing it to a byte array, setting the byte array as the task payload, and then deserializing it when your task runs. The following code demonstrates how to do this:

[appengine-java] memcache memory leak on dev server

2009-11-24 Thread Vince Bonfanti
There appears to be a memory leak with the memcache implementation on the dev server; I've opened a new issue for this: http://code.google.com/p/googleappengine/issues/detail?id=2428 I have some testcases that make heavy use of memcache that are failing due to this issue. Vince -- You

Re: [appengine-java] Re: any plans for deferred.defer in Java?

2009-11-25 Thread Vince Bonfanti
Hi Jeff, Thanks for the suggestions and the code. David Chandler sent me a patch to support user-specified queue names (almost exactly the same as your changes), and I've committed that patch to SVN. Regarding your other changes: - I've probably make the url-pattern init parameter optional and

Re: [appengine-java] Re: How to return a file from a servlet

2009-11-30 Thread Vince Bonfanti
Or, something similar, using the IOUtils class from Commons I/O ( http://commons.apache.org/io/): InputStream resourceAsStream = getServletContext().getResourceAsStream.(pathToImage); resp.setContentType(image/gif); IOUtils.copy(resourceAsStream,resp.getOutputStream); Vince On Mon, Nov 30,

Re: [appengine-java] Re: How to return a file from a servlet

2009-11-30 Thread Vince Bonfanti
I'm not absolutely sure it's required, but I think in practice you should always specify the content type. Note that you can get most common types via a lookup based on the file extension: String contentType = getServletContext().getMimeType( imagePath ); You can add additional mime types to

[appengine-java] task queue once-only semantics

2009-12-01 Thread Vince Bonfanti
I'm trying to solve the following problem using task queues: 1. Queue a task to perform some action N. 2. Until action N has been performed, don't allow any other tasks to be queued that also perform action N. 3. As soon as action N has been performed, immediately allow other tasks to be

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

2009-12-01 Thread Vince Bonfanti
on this in the issue tracker. Vince On Tue, Dec 1, 2009 at 11:39 AM, Vince Bonfanti vbonfa...@gmail.com wrote: I'm trying to solve the following problem using task queues: 1. Queue a task to perform some action N. 2. Until action N has been performed, don't allow any other tasks to be queued

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

2009-12-01 Thread Vince Bonfanti
transactions: #1 - mutex begin (create Entity), #2 - work for N, and #3 - mutex end (remove Entity). Anyhow assuming your logic to trigger a new Task N can incorporate the criteria for mutex exists, then what would keep this from working? On Dec 1, 2:37 pm, Vince Bonfanti vbonfa...@gmail.com wrote: BTW

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

2009-12-01 Thread Vince Bonfanti
. I guess I'll just open a feature request on this in the issue tracker. Vince On Tue, Dec 1, 2009 at 11:39 AM, Vince Bonfanti vbonfa...@gmail.com wrote: I'm trying to solve the following problem using task queues: 1. Queue a task to perform some action N. 2. Until

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

2009-12-02 Thread Vince Bonfanti
Yes, I received your patch and it's on my TODO list to review it and add it to the code. Unfortunately, I've been a bit backed up with other projects. I'm trying to get a new version of GaeVFS ready for release in the next few weeks and will try to include your patch. Vince On Wed, Dec 2, 2009

Re: [appengine-java] Re: AppEngine needs an AppStore

2009-12-02 Thread Vince Bonfanti
What we really, really need is something similar to Amazon DevPay: http://aws.amazon.com/devpay/ Vince On Tue, Dec 1, 2009 at 2:08 PM, Ikai L (Google) ika...@google.com wrote: I see what you mean. Say, an application marketplace where folks can download source code for applications and

Re: [appengine-java] 1.2.8 SDK Prerelease - help us verify!

2009-12-03 Thread Vince Bonfanti
I just started testing with the 1.2.8 prerelease, and I'm getting the following exception from Queue.add() in code that works in 1.2.6: java.lang.IllegalStateException: Current enviornment must have the server url available via the com.google.appengine.server_url_key attribute. This only happens

Re: [appengine-java] Why no GAE system property?

2009-12-03 Thread Vince Bonfanti
I agree. My workaround was to create a ServletEventListener and put this in the contextInitialized() method: System.setProperty( appengine.server, event.getServletContext().getServerInfo().contains( Development ) ? development : production ); Vince On Thu, Dec 3, 2009 at 1:15 PM, Jeff

Re: [appengine-java] 1.2.8 SDK Prerelease - help us verify!

2009-12-03 Thread Vince Bonfanti
AM, Vince Bonfanti vbonfa...@gmail.comwrote: I just started testing with the 1.2.8 prerelease, and I'm getting the following exception from Queue.add() in code that works in 1.2.6: java.lang.IllegalStateException: Current enviornment must have the server url available via

Re: [appengine-java] App Engine SDK 1.2.8 released including new Admin Console features

2009-12-04 Thread Vince Bonfanti
Is SDK 1.2.8 going to be added to the Eclipse update site? Vince On Thu, Dec 3, 2009 at 6:06 PM, App Engine Team appengine.nore...@gmail.com wrote: The App Engine team has been hard at work tackling our the issues on our tracker, tweaking APIs and closing bugs. In addition to a ton of bug

Re: [appengine-java] 1.2.8 SDK Prerelease - help us verify!

2009-12-04 Thread Vince Bonfanti
still finish running. Thanks, Max On Fri, Dec 4, 2009 at 7:06 AM, Vince Bonfanti vbonfa...@gmail.comwrote: Hi Max, Yes, it works. Thanks very much. Vince P.S. While step-debugging a task, I noticed that they seem to time-out very quickly--within about 5 seconds. Is this intentional

Re: [appengine-java] FinalizableReferenceQueue error

2009-12-05 Thread Vince Bonfanti
The exception is harmless. Add this to your logging.properties file to hide it: com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue.level=WARNING There was previous discussion of this (search for FinalizableReferenceQueue). Vince On Sat, Dec 5, 2009 at 1:00 PM,

Re: [appengine-java] Introducing App Engine SDK 1.3.0

2009-12-16 Thread Vince Bonfanti
I had the same issue, so instead I went to Help-Install New Software..., then selected the Google App Engine site from the Work with... menu; then it allowed me to select SDK 1.3.0. Vince On Wed, Dec 16, 2009 at 11:37 AM, Matt Farnell mfarn...@gmail.com wrote: Hi Jason, It could be just me

Re: [appengine-java] Re: any plans for deferred.defer in Java?

2010-01-01 Thread Vince Bonfanti
JVM. If there were more than web app, I'm not sure whether Guice ServletModules would work, but that's not an issue for now. /dmchttp://turbomanage.wordpress.com On Dec 2, 2:47 pm, Vince Bonfanti vbonfa...@gmail.com wrote: The behavior you're reporting is exactly the opposite

Re: [appengine-java] SQL to Datastore Query object

2010-01-06 Thread Vince Bonfanti
I've written such a translater that implements a subset of JDOQL: https://code.google.com/p/lowlevelquery/ https://code.google.com/p/lowlevelquery/There's really no documentation other than the source code, which is a single class:

Re: [appengine-java] how to send data in blobstore as mail attachment?

2010-01-06 Thread Vince Bonfanti
I haven't tried this, but...the BlobstoreService.serve() method takes a javax.servlet.http.HttpServletResponse instance as a parameter. My guess is that BlobstoreService.serve() simply invokes HttpServletResponse.getOutputStream() and then writes the data to the output stream. You could create