[appengine-java] Re: Tutorial for datastore with low-level api?

2009-10-22 Thread Yasuo Higa

Hi Richard,

On Thu, Oct 22, 2009 at 3:11 PM, Richard  wrote:
>
> Hi Yasuo,
>
>> The maximum number of entities in a batch put or batch delete is 500.
>> The maximum number of entities in a batch get is 1000.
>
> That's true, but in this case I'm assuming not all keys have entries
> so I'll only get back the entities that exist. They keys that have no
> associated entities will return nothing. So keys > entities, and
> hopefully keys could > 1000.  Put in e.g. 1500 keys, get out 50
> entities, providing me with a fast(er) IN search.
>
You cannot specify more than 1000 keys in a batch get.

If you specify more than 1000 keys in a batch get,
you will encounter the following exception:
java.lang.IllegalArgumentException: cannot get more than 1000 keys in
a single call

Hope this helps,

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] Re: Spring MVC + Sitemesh problem

2009-10-22 Thread wendy_eq
I have same issue In my App ,but not all link like this, some link is
working.

--~--~-~--~~~---~--~~
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/JPA Snippets That Work - Optimistic Locking With @Version

2009-10-22 Thread Patrizio Munzi




Hi Max,

I've just read your new post and I've got two questions.
1) should we discuss your new posts in this mailing list or in the blog?

Since you haven't answer my first question yet, :-P, I'm going to ask
my second question in both ways.

2) Before your new post the only way I knew for transaction isolation
was using the JDOCanRetryException (or at least we'll use it as soon as
the bug fix about it will be released), now we've got also this
JDOOptimisticVerificationException. Now, I can imagine the difference
between them but I'd like to know what's the best way to deal with both
of them. I mean, should we use both of them? Using the
JDOCanRetryException mechanism shouldn't be need of the
JDOOptimisticVerificationException.

We'd be very grateful if you could clarify this out.

Thanks

Max Ross wrote:
http://gae-java-persistence.blogspot.com/2009/10/optimistic-locking-with-version.html
  
  


-- 

Patrizio Munzi
Product Specialist
Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
tel: +39 06 4543 3540
fax: +39 06 4543 3587
mobile: +39 393 7195 164
mail: patrizio.mu...@eris4.com
web: http://www.eris4.com
skype: eris4_munzi



--~--~-~--~~~---~--~~
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 datastore cleanup

2009-10-22 Thread Nikolay Gorylenko
sent app ids via private mail
thanks for co-op!

On Wed, Oct 21, 2009 at 8:51 PM, Jason (Google)  wrote:

> Hi Nikolay. What are your application IDs?- Jason
>

--~--~-~--~~~---~--~~
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: AccessControlException (SerializablePermission enableSubclassImplementation) - Wicket on GAE

2009-10-22 Thread a.maza

I'll be happy to share the code as soon as it is running smoothly and
I got rid of the above mentioned AccessControlException.

Thus, I hope somebody could give me a hint what is causing the
exception.

Regards,
andr


On 21 Okt., 23:14, Esteban Masoero  wrote:
> a.maza:
>
> That's correct, I'm using HTTPSessionStore because of the filesystem
> writing restriction. However, I'm interested in the implementation you
> are trying to do, so if you decide to share it with the community when
> it's done, I'll be happy to give it a try ;). Moreover, we have a
> fileupload gae-like implementation that uses the datastore instead of
> the file system to store temporary recently uploaded files (shared by a
> developer in the wicket users list), so I'd be interested in merging our
> code and your code into some wicket-gae.jar extension, so everything its
> located at one place and can be reused by others.
>
> For the record, we haven't experienced any issues related to the
> back/foward button behavior (although I must tell that our app is still
> a small one and maybe that has something to do with it).
>
> Regards,
>
> Esteban
>
> a.maza escribió:
>
>
>
>
>
> > On 21 Okt., 20:26, Esteban Masoero  wrote:
>
> >> Hi there:
>
> >> We've been running a wicket app on gae since last month, but without the
> >> need of implement memcache-based implementation of Wicket's IPageStore.
> >> Why are you doing that? (our wicket version is 1.3.7)
>
> > Wicket is very powerful in maintaining application/session state. This
> > enables for example a nice usage of back/forward buttons. In a typical
> > scenario, this is backed by the DiskPageStore implementation. On GAE
> > you can't use the DiskPageStore since it relies on writing to the
> > filesystem. Thus, I assume that you use the HTTPSessionStore as
> > proposed in some blog entries (and not the SecondLevelCacheStore).
>
> > I did some research on the web and several users reported problems
> > using the HTTPSessionStore - especially regarding the back/forward
> > button behavior. Thus, I am currently trying to implement a Memcache-
> > backed IPagestore for GAE. On the Wicket mailinglist I was provided
> > with a HTTP session based implementation of IPageStore (done in the
> > Terracotta project) to have a starting point (http://www.nabble.com/
> > Google-App-Engine-and-Wicket-to23001592.html)- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -
--~--~-~--~~~---~--~~
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: Simple question: How to decrease a counter in a transaction

2009-10-22 Thread dflorey

Can someone help? What am I doing wrong?

On 19 Okt., 11:04, dflorey  wrote:
> Hi all,
> I need help!
> I'm using concurrent tasks executed in a task queue. Let's say I want
> to spawn 100 concurrent tasks and do something once they are all done.
> I thought this is simple by just storing the total number of spawned
> tasks into the datastore and let each task decrease the number by 1.
> The value should be 0 when all tasks are done.
> This is my code snippet to decrease the value:
>
> Transaction tx = datastore.beginTransaction();
> try {
>         Entity entity = datastore.get(tx, KeyFactory.createKey(kind, key));
>         Long number = (Long) entity.getProperty(column);
>         if (number == null || number == 0) {
>                 tx.commit();
>                 return 0;
>         }
>         number -= 1;
>         entity.setProperty(column, number);
>         datastore.put(tx, entity);
>         tx.commit();
>         return number;} catch (Exception e) {
>
>         throw new DBException("Failed to decrease counter, force retry!", 
> e);} finally {
>
>         if (tx.isActive()) {
>                 tx.rollback();
>         }
>
> }
>
> Something must be wrong with my code as from time to time two
> concurrent tasks return the same number after decreasing the value.
> Can someone please give me an advice?
--~--~-~--~~~---~--~~
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.NullPointerException cannot be cast to javax.servlet.ServletException

2009-10-22 Thread Marc Guillemot

Don,

I've tried to produce a unit test to open an issue for Jasper... and failed.

I'm now quite sure that this is a bug in the JVM used for GAE.

The JavaDoc of AccessController.doPrivileged (which is a native method) 
says that it propagates unchecked exceptions and throws a 
PrivilegedActionException only if a *checked* exception was thrown. 
Therefore Jasper code is correct not to await a RuntimeException as a 
PrivilegedActionException can't contain a NullPointerException and GAE's 
JVM is buggy here.

Cheers,
Marc.

Don Schwarz a écrit :
> Ah, you're right actually.  I hadn't looked closely enough at that bug.
> 
> We'll have to get the Jasper guys to fix that and then upgrade.
> 
> Thanks,
> Don
> 
> On Mon, Oct 19, 2009 at 10:39 AM, Marc Guillemot  > wrote:
> 
> 
> This seems to be a really old issue that relates to something
> different... or do you mean that GAE uses a 5 years old version of
> Jasper?
> 
> I've just look at the current sources of PageContextImpl
> 
> http://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
> and it seems to me that the problem still exists there.
> 
> Cheers,
> Marc.
> 
> Don Schwarz a écrit :
>  > Yes, this is:
>  >
>  > https://issues.apache.org/bugzilla/show_bug.cgi?id=31171
>  >
>  > We need to bundle a later version of Jasper with the App Engine
> SDK to
>  > fix this.
>  >
>  > On Mon, Oct 19, 2009 at 10:24 AM, Marc Guillemot
> mailto:mguille...@yahoo.fr>
>  > >> wrote:
>  >
>  >
>  > Hi,
>  >
>  > any progress on this issue?
>  >
>  > Is it possible that it comes from a bug in Jasper, not able
> to recognize
>  > RuntimeException occurring in a PrivilegedExceptionAction?
>  >
>  > // org.apache.jasper.runtime.PageContextImpl
>  >
>  > public void handlePageException(final Throwable t) throws
> IOException,
>  > ServletException {
>  >   if (t == null)
>  > throw new NullPointerException("null Throwable");
>  >
>  >   if (SecurityUtil.isPackageProtectionEnabled()) {
>  > try {
>  >   AccessController.doPrivileged(
>  >   new PrivilegedExceptionAction() {
>  > public Void run() throws Exception {
>  >   doHandlePageException(t);
>  >   return null;
>  > }
>  >   });
>  > } catch (PrivilegedActionException e) {
>  >   Exception ex = e.getException();
>  >   if (ex instanceof IOException) {
>  > throw (IOException) ex;
>  >   } else {
>  > throw (ServletException) ex; <-- here?
>  >   }
>  > }
>  >   } else {
>  > doHandlePageException(t);
>  >   }
>  >
>  > }
>  >
>  > Cheers,
>  > Marc.
>  >
>  > Toby Reyelts a écrit :
>  >  > There's an outstanding issue in the version of Jasper App
> Engine is
>  >  > currently using that can cause exceptions escaping a JSP to be
>  >  > incorrectly cast to ServletException. As a temporary
> workaround,
>  > you can
>  >  > wrap the body of your JSP in a try-catch block to get the
> actual
>  > exception.
>  >  >
>  >  > On Thu, Jul 30, 2009 at 1:13 PM, Blessed Geek
>  > mailto:blessedg...@gmail.com>
> >
>  >  >      >  >
>  >  >
>  >  >
> http://cuckooberra.blessed-are-the-geek.com/TableMgr/TableMgr.jsp
>  >  >
>  >  > Any idea what this error log means? LoggedIn.jsp is a
> rather
>  > simple
>  >  > jsp, getting a temp authtoken and exchanging it for a
>  > permanent one.
>  >  > My app runs fine on local eclipse plugin, but on
> deployment
>  > this error
>  >  > resulted.
>  >  >
>  >  > 07-30 07:30AM 49.848
>  >  > /TableMgr/LoggedIn.jsp
>  >  > java.lang.ClassCastException:
> java.lang.NullPointerException
>  > cannot be
>  >  > cast to javax.servlet.ServletException
>  >  >at
>  > org.apache.jasper.runtime.PageContextImpl.handlePageException
>  >  > (PageContextImpl.java:754)
>  >  >
>  >  >
>  >  >
>  >  >
>  >  > >
>  >
>  >
>  >
>  >
>  >
>  > >
> 
> 
> 
> 
> 
> > 


--~--~-~--~~~---~--~~

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

2009-10-22 Thread Nacho Coloma

Hi all,

We have been developing a persistence framework for the AppEngine
Datastore based on the raw DatastoreService API. For our (simple)
persistence case, both JDO and JPA were a bit overkill as we were
spending a significant amount of time jumping through hoops to make
our application roll, but at the same time the Datastore API was a too
low-level solution to be usable.

So we reinvented our wheel. In two days.

SimpleDS is a light wrapper around the DatastoreService APIs that
provide a simple interface for java persistent classes. It does not
include fancy stuff or any super features, it's just the
DatastoreService ported to a world where Java entities can be
persisted directly (using a subset of JPA annotations).  This is _not_
a JPA/JDO replacement, and will never be. But we have been using it
for some weeks and are quite happy with it.

Any kind of feedback from the AppEngine  community would be welcome.
Before calling the typical "but we already have JPA/JDO!" argument,
please notice the following:

* There are lots of considerations in a relational database that do
not apply to AppEngine. This allows a specific solution to be
simplified big time. Just see the depth of your typical stack trace to
understand what I am talking about.
* Solutions can be designed for specific cases that are common
practice in AppEngine but do not apply to a relational database. See,
for example, saving entities with a parent instance.
* Transactions also behave a bit differently, where a "one size fits
all" approach would probably not be the best solution.

To better ilustrate with an example, these are some typical tasks
performed with SimpleDS:

Retrieve instance:
FooBar bar = entityManager.get(key);

Transform from Google Datastore Entity to java and viceversa:
Entity entity = entityManager.datastoreToJava(bar);

Save generating a  primary key, with a parent instance:
FooBar bar = new FooBar();
entityManager.put(parentKey, bar);

More can be seen here:
http://code.google.com/p/simpleds/wiki/SimpleTasks

Any discussion about the current API state is welcome. This entire
thing was rolled in two days and tested in a couple of weeks so there
should be some bugs in between.

It is important to keep in mind the current list of limitations:

* Only the Key class is a supported primary key.
* IN and != are not supported (yet). I have big concerns about
supporting this, performance-wise.
* Relationships are not supported. You can use Keys and collections of
Keys for that purpose.
* Transactions are not yet included. We are not yet sure about how to
proceed here.

As I said, this is not conceived to become a feature-complete JPA
replacement, so please don't treat it like that.

Best regards,

Nacho.
--~--~-~--~~~---~--~~
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: about values

2009-10-22 Thread Alexander Arendar

Hi Jason,

maybe my question is a trivial for you but still:
how melodramatically should I detect when the value is NOT set?
As you already explained i can't use ==null. What should I use
instead?

Sincerely,
Alex

On Oct 21, 9:36 pm, "Jason (Google)"  wrote:
> No. If an entity does not have a value set for a particular property (null
> IS a value, different from ), then it won't appear in any query
> results involving that property. You'll need to continue sifting through
> every entity to see if a value is set, and if not, setting it directly.
> - Jason
>
> On Mon, Oct 19, 2009 at 6:09 AM, Prashant  wrote:
> > hi,
>
> > i added a new column to my data table, as it is newly added it is showing
> >  as column values in datastore. now i want to initialize those
> >  values to some value, say 0. how do i do that programmatically? i
> > tried using "column == null" as filter but that doesn't work.
>
>
--~--~-~--~~~---~--~~
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: SimpleDS: an alternative for Datastore persistence

2009-10-22 Thread Richard

Sounds good.  I also think I'll focus much of my attention on the low-
level API, so this could be very useful!

Regards,
Richard

On Oct 22, 11:37 am, Nacho Coloma  wrote:
> Hi all,
>
> We have been developing a persistence framework for the AppEngine
> Datastore based on the raw DatastoreService API. For our (simple)
> persistence case, both JDO and JPA were a bit overkill as we were
> spending a significant amount of time jumping through hoops to make
> our application roll, but at the same time the Datastore API was a too
> low-level solution to be usable.
>
> So we reinvented our wheel. In two days.
>
> SimpleDS is a light wrapper around the DatastoreService APIs that
> provide a simple interface for java persistent classes. It does not
> include fancy stuff or any super features, it's just the
> DatastoreService ported to a world where Java entities can be
> persisted directly (using a subset of JPA annotations).  This is _not_
> a JPA/JDO replacement, and will never be. But we have been using it
> for some weeks and are quite happy with it.
>
> Any kind of feedback from the AppEngine  community would be welcome.
> Before calling the typical "but we already have JPA/JDO!" argument,
> please notice the following:
>
> * There are lots of considerations in a relational database that do
> not apply to AppEngine. This allows a specific solution to be
> simplified big time. Just see the depth of your typical stack trace to
> understand what I am talking about.
> * Solutions can be designed for specific cases that are common
> practice in AppEngine but do not apply to a relational database. See,
> for example, saving entities with a parent instance.
> * Transactions also behave a bit differently, where a "one size fits
> all" approach would probably not be the best solution.
>
> To better ilustrate with an example, these are some typical tasks
> performed with SimpleDS:
>
> Retrieve instance:
> FooBar bar = entityManager.get(key);
>
> Transform from Google Datastore Entity to java and viceversa:
> Entity entity = entityManager.datastoreToJava(bar);
>
> Save generating a  primary key, with a parent instance:
> FooBar bar = new FooBar();
> entityManager.put(parentKey, bar);
>
> More can be seen here:http://code.google.com/p/simpleds/wiki/SimpleTasks
>
> Any discussion about the current API state is welcome. This entire
> thing was rolled in two days and tested in a couple of weeks so there
> should be some bugs in between.
>
> It is important to keep in mind the current list of limitations:
>
> * Only the Key class is a supported primary key.
> * IN and != are not supported (yet). I have big concerns about
> supporting this, performance-wise.
> * Relationships are not supported. You can use Keys and collections of
> Keys for that purpose.
> * Transactions are not yet included. We are not yet sure about how to
> proceed here.
>
> As I said, this is not conceived to become a feature-complete JPA
> replacement, so please don't treat it like that.
>
> Best regards,
>
> Nacho.
--~--~-~--~~~---~--~~
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: Tutorial for datastore with low-level api?

2009-10-22 Thread Richard

> You cannot specify more than 1000 keys in a batch get.
>
> If you specify more than 1000 keys in a batch get,
> you will encounter the following exception:
> java.lang.IllegalArgumentException: cannot get more than 1000 keys in
> a single call

Aha, thanks Yasuo.

Regards,
Richard
--~--~-~--~~~---~--~~
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: programatically upload files to datastore

2009-10-22 Thread Abhinav Lele
Hi,

Here is the code that I am using

upload.html










Servlet code:

ServletFileUpload upload = new ServletFileUpload();

// Parse the request
FileItemIterator iter = upload.getItemIterator(req);
while (iter.hasNext()) {
FileItemStream item = iter.next();
String name = item.getFieldName();
InputStream stream = item.openStream();
if (item.isFormField()) {
System.out.println("Form field " + name + " with value "
+ Streams.asString(stream) + " detected.");
} else {
System.out.println("File field " + name + " with file name "
+ item.getName() + " detected.");
// Process the input stream

}
}


When I am debugging the code using eclipse iter.hasNext() returns false.
Does anyone know the reason for this ?

--
Abhinav

-_[No constructors were harmed in the writing of this post. Any resemblance
to objects living or dead is purely coincidental]_-


On Tue, Oct 20, 2009 at 8:53 PM, Alexander Arendar <
alexander.aren...@gmail.com> wrote:

> Hi,
>
> it seems ok.
> I use the same way ApacheIO just I have regular UI form. But it's no matter
> if you fire POST http request from the HTML form or if that is done
> programatically.
> Just test and make sure it works.
>
> Sincerely,
> Alex
>
>
> On Tue, Oct 20, 2009 at 6:17 PM, Houston startup coder <
> stephenh...@gmail.com> wrote:
>
>>
>> I haven't actually tested this code yet since I got sidetracked with
>> some other stuff.  But I basically worked off of the example farther
>> down this page:
>>
>> http://code.google.com/appengine/kb/java.html
>>
>> Then I just modified it to save the file data as an attribute to an
>> object I want to persist to the datastore.  So does anyone know if
>> this is what I should be doing to have a desktop app upload files in
>> the background to Google App Engine?  Should they be going through a
>> servlet if it's not an actual human user filling out a file upload
>> form on a webpage?
>>
>> Here's my code:
>>
>>
>>
>> import org.apache.commons.fileupload.FileItemStream;
>> import org.apache.commons.fileupload.FileItemIterator;
>> import org.apache.commons.fileupload.servlet.ServletFileUpload;
>>
>> import org.apache.commons.io.IOUtils;
>>
>> import java.io.InputStream;
>> import java.io.IOException;
>> import java.util.logging.Logger;
>>
>> import javax.jdo.PersistenceManager;
>> import javax.servlet.ServletException;
>> import javax.servlet.http.HttpServlet;
>> import javax.servlet.http.HttpServletRequest;
>> import javax.servlet.http.HttpServletResponse;
>>
>> import com.google.appengine.api.datastore.Blob;
>> import com.ideate.PMF;
>>
>> public class FileUploader extends HttpServlet {
>>  private static final Logger log =
>>  Logger.getLogger(FileUploader.class.getName());
>>
>>  public void doPost(HttpServletRequest req, HttpServletResponse res)
>>  throws ServletException, IOException {
>>try {
>>  ServletFileUpload upload = new ServletFileUpload();
>>  res.setContentType("text/plain");
>>
>>  FileItemIterator iterator = upload.getItemIterator(req);
>>  while (iterator.hasNext()) {
>>FileItemStream item = iterator.next();
>>InputStream stream = item.openStream();
>>
>>if (item.isFormField()) {
>>  log.warning("Got a form field: " + item.getFieldName());
>>} else {
>>  log.warning("Got an uploaded file: " + item.getFieldName() +
>>  ", name = " + item.getName());
>>
>>  // You now have the filename (item.getName() and the
>>  // contents (which you can read from stream).  Here we just
>>  // print them back out to the servlet output stream, but you
>>  // will probably want to do something more interesting (for
>>  // example, wrap them in a Blob and commit them to the
>>  // datastore).
>>
>>  Blob uploadedImage = new Blob(IOUtils.toByteArray(stream));
>>
>>  Photo photo = new Photo();
>>  photo.setName(item.getName());
>>  photo.setImageData(uploadedImage);
>>
>>  PersistenceManager pm = PMF.get().getPersistenceManager();
>>  try {
>>  pm.makePersistent(photo);
>>  } finally {
>>  pm.close();
>>  }
>>
>>  /*
>>  int len;
>>  byte[] buffer = new byte[8192];
>>  while ((len = stream.read(buffer, 0, buffer.length)) != -1)
>> {
>>res.getOutputStream().write(buffer, 0, len);
>>  }
>>  */
>>}
>>  }
>>} catch (Exception ex) {
>>  throw new ServletException(ex);
>>}
>>  }
>> }
>>
>>
>> THE END
>>
>> Thanks for any help...
>>
>>
>>
>>
>>
>> On Oct 19, 12:18 pm, Abhinav Lele  wrote:
>> > Could you share your code for the servlet that handles file uploads. I
>> have
>> > been not able to get that working. Thanks in advance
>> > --
>> > Abhinav
>> >
>> > -_[No constructors were harmed i

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

2009-10-22 Thread Roy Smith
I did more or less the same thing for the same reasons, and with the same
happy result.The only difference for me was instead of annotations, I
generate my model from an RDBMS. This way I know I can port my app to an
RDBMS world should GAE ever go the same way as Google Notebook.


On Thu, Oct 22, 2009 at 11:43 AM, Richard  wrote:

>
> Sounds good.  I also think I'll focus much of my attention on the low-
> level API, so this could be very useful!
>
> Regards,
> Richard
>
> On Oct 22, 11:37 am, Nacho Coloma  wrote:
> > Hi all,
> >
> > We have been developing a persistence framework for the AppEngine
> > Datastore based on the raw DatastoreService API. For our (simple)
> > persistence case, both JDO and JPA were a bit overkill as we were
> > spending a significant amount of time jumping through hoops to make
> > our application roll, but at the same time the Datastore API was a too
> > low-level solution to be usable.
> >
> > So we reinvented our wheel. In two days.
> >
> > SimpleDS is a light wrapper around the DatastoreService APIs that
> > provide a simple interface for java persistent classes. It does not
> > include fancy stuff or any super features, it's just the
> > DatastoreService ported to a world where Java entities can be
> > persisted directly (using a subset of JPA annotations).  This is _not_
> > a JPA/JDO replacement, and will never be. But we have been using it
> > for some weeks and are quite happy with it.
> >
> > Any kind of feedback from the AppEngine  community would be welcome.
> > Before calling the typical "but we already have JPA/JDO!" argument,
> > please notice the following:
> >
> > * There are lots of considerations in a relational database that do
> > not apply to AppEngine. This allows a specific solution to be
> > simplified big time. Just see the depth of your typical stack trace to
> > understand what I am talking about.
> > * Solutions can be designed for specific cases that are common
> > practice in AppEngine but do not apply to a relational database. See,
> > for example, saving entities with a parent instance.
> > * Transactions also behave a bit differently, where a "one size fits
> > all" approach would probably not be the best solution.
> >
> > To better ilustrate with an example, these are some typical tasks
> > performed with SimpleDS:
> >
> > Retrieve instance:
> > FooBar bar = entityManager.get(key);
> >
> > Transform from Google Datastore Entity to java and viceversa:
> > Entity entity = entityManager.datastoreToJava(bar);
> >
> > Save generating a  primary key, with a parent instance:
> > FooBar bar = new FooBar();
> > entityManager.put(parentKey, bar);
> >
> > More can be seen here:http://code.google.com/p/simpleds/wiki/SimpleTasks
> >
> > Any discussion about the current API state is welcome. This entire
> > thing was rolled in two days and tested in a couple of weeks so there
> > should be some bugs in between.
> >
> > It is important to keep in mind the current list of limitations:
> >
> > * Only the Key class is a supported primary key.
> > * IN and != are not supported (yet). I have big concerns about
> > supporting this, performance-wise.
> > * Relationships are not supported. You can use Keys and collections of
> > Keys for that purpose.
> > * Transactions are not yet included. We are not yet sure about how to
> > proceed here.
> >
> > As I said, this is not conceived to become a feature-complete JPA
> > replacement, so please don't treat it like that.
> >
> > Best regards,
> >
> > Nacho.
> >
>

--~--~-~--~~~---~--~~
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: Possible to Add Child to Owned One to Many Relationship Without Loading All Children?

2009-10-22 Thread leszek

Wow  ! That's the stuff, 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: Where to report an error?

2009-10-22 Thread Joe

Thank you Jason. As usual, this was my fault; but thanks for your
time.

On Oct 20, 4:51 pm, "Jason (Google)"  wrote:
> Please include your application ID and the full stack trace. If you don't
> see a stack trace printed in the browser, check your error logs in your
> application's Admin Console.
> - Jason
>
> On Mon, Oct 19, 2009 at 6:43 AM, Joe  wrote:
>
> > I am getting this error since Friday Oct. 16th:
>
> > Error: Server Error
> > The server encountered an error and could not complete your request.
>
> > If the problem persists, please report your problem and mention this
> > error message and the query that caused it.
>
> > The stack trace tells me very little about the error. Stranger still,
> > everything worked, and I made no changes, this error just starting
> > happening. I waited over the weekend to see if it would "go away", but
> > no dice.
--~--~-~--~~~---~--~~
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: Tutorial for datastore with low-level api?

2009-10-22 Thread iker98

Jason,
Is not necessary to release o close the DatastoreService when the
datastore operations have finished?

Thanks

On Oct 19, 8:12 pm, "Jason (Google)"  wrote:
> Currently, most datastore examples use JDO, and the only official
> documentation available for the low-level API are the Javadocs that you
> linked to in your first post. It's a fairly straightforward API, however, so
> you shouldn't need too much training. Just get a reference to a
> DatastoreService instance and use it to get and retrieve Entity objects:
>
> DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
> ...
>
> If you have any specific questions or find any descriptions confusing,
> please let me know and I'll be happy to work through these issues with you.
>
> - Jason
>
> On Thu, Oct 15, 2009 at 1:45 PM, Iqbal Yusuf Dipu
> wrote:
>
>
>
> > Hi,
>
> > Is there any online reference material with some examples available
> > for low-level api with datastore in Java without using JDO/JPA? The
> > main app engine site has only reference to api doc for datastore.
>
> >http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...
>
> > 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: GAE Performance

2009-10-22 Thread Diana Cruise

I'm glad to hear that the 1-10 requests/second is per User root
entity...in my case this means that huge number of Users logged in
around the world should expect sub-second response even if tens of
thousands clicked the Update button at the same instance in time!

The only problem is we do NOT hear from anyone outside of Google to
confirm performance of large volume for specific applications and what
the real costs are!!!

Regarding deadlock, I hear GAE does NOT both with lock timeouts so as
soon as a transaction trys to retrieve a record that is already
locked, it will receive an error and have to retry.



On Oct 19, 5:50 pm, "Dr. Flufenstein" 
wrote:
> Preface: Please note, I'm not speaking for google at all in this note
> and a lot of what I've written is speculation based on what I've read
> in various GAE docs as well as some meager knowledge of how relational
> DBs generally work.  And yes, I know datastore isn't a relational DB,
> but I believe that their indexing implementation likely runs into many
> of the same problems you have with indexing relational data although
> that assumption could be completely wrong.
>
> From what I can tell, the update bottleneck you're referring to is for
> updating what you would often think of as a single record if you were
> persisting one instance of your User as a single denormalized record
> in a relational schema.  I suspect this bottleneck is due to the
> datastore architecture and the way that data updates are accumulated
> (possibly grouped/keyed by PK) in a queue, which is probably read from
> like a cache if read requests come in before the data has been flushed
> into the actual storage medium and replicated to the other
> datacenters.
>
> So if each of your users were updating their own User records, I don't
> believe you'd experience that limitation which may be an artifact of
> how those in-memory queue/cache structures are managed/locked during
> updates (i.e. a new update for a record may be held until it's been
> flushed from the queue to the storage medium to prevent having to
> merge/reconcile records in the queue).  If they were all updating a
> single shared record, then I think you'd hit this pretty quick.
>
> Let's say though that your users are updating separate records...as
> your data size grows, you will probably see your update throughput
> decrease as other factors become dominant, and I believe this will
> primarily be dependent on the number and composition of the indexes on
> your data as well as the number of entities persisted.  To me, this is
> the much riskier unknown because your average index structure is
> harder to update piecewise in parallel because the index must allow
> you to order/search all of the records' indexed columns.  In an RDBMS
> like SQL Server or Oracle, you'd see some level of index locking take
> place during each transaction (maybe one page of an index) to allow
> concurrent updates to different sections of an index before the
> updates are committed, the transaction is ended and the locks are
> released.
>
> In relational persistence systems, this gets slower as the indexes
> become larger and is usually overcome with a technique like
> partitioning which, if you aren't familiar with it, sort of gives you
> a top level of your index tree where the data is actually spread into
> n groups of tables/indexes depending on some value in each record, and
> you usually pick a partition key so that data volume in each partition
> is kind of naturally balanced because rebalancing across partitions is
> expensive.  I'm not sure that any kind of similar mechanism has been
> exposed in the GAE datastore right now and so a single index declared
> for an entity type is probably realized as one big index.  I would
> hope that there's sub-index granularity for locking during updates,
> but I'm actually guessing that's not the case for a couple of reasons:
>
> 1) With most relational systems, you need to periodically rebuild the
> index or at least refresh the index statistics.  I like to simplify
> this and think of rebuilding as rebalancing the data tree for optimal
> access speed while refreshing statistics typically just helps query
> optimizers decide whether use of an index should be preferred.  On the
> GAE though, they require you to have an index for each combination of
> query parameters, so I suspect that statistics don't come into play.
> And I haven't seen a "rebuild my indexes" function in the admin UI
> although admittedly I haven't looked for one too hard so I wonder if
> they aren't trying to keep the data tree somewhat well balanced during
> each data update, which would require the entire index to potentially
> be locked.
>
> 2) I also haven't read anything yet about deadlock situations on GAE
> which can happen surprisingly easily if you're updating multiple
> indexes with enough concurrency and are using page locking.  If you
> were designing the GAE datastore service, the way to avoid that
> situati

[appengine-java] Errors 500 and 409 while updating application

2009-10-22 Thread WSouza

Hello,

Since about 15 mins ago, when I try to update my application, it is
returning an error 500 (internal server error) and if i try again,
error 409 (conflict) until I restart my eclipse, then it goes back to
error 500 once and then 409 again.

Did something happen and my application got locked in an "error
state"? I've got some Internal Server Error on the dashboard pages too
at the same time the first error 500 happened.

PS: The application is still running OK.

PS2: app name is footbattle

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: Errors 500 and 409 while updating application

2009-10-22 Thread WSouza

The log says:

Unable to upload:
java.io.IOException: Error posting to URL:
http://appengine.google.com/api/appversion/create?app_id=footbattle&version=1&;
500 Internal Server Error

Server Error (500)
A server error has occurred.

at com.google.appengine.tools.admin.ServerConnection.send
(ServerConnection.java:143)
at com.google.appengine.tools.admin.ServerConnection.post
(ServerConnection.java:81)
at com.google.appengine.tools.admin.AppVersionUpload.send
(AppVersionUpload.java:429)
at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction
(AppVersionUpload.java:243)
at com.google.appengine.tools.admin.AppVersionUpload.doUpload
(AppVersionUpload.java:98)
at com.google.appengine.tools.admin.AppAdminImpl.update
(AppAdminImpl.java:53)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy
(AppEngineBridgeImpl.java:271)
at
com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace
(DeployProjectJob.java:148)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run
(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


On Oct 22, 12:51 pm, WSouza  wrote:
> Hello,
>
> Since about 15 mins ago, when I try to update my application, it is
> returning an error 500 (internal server error) and if i try again,
> error 409 (conflict) until I restart my eclipse, then it goes back to
> error 500 once and then 409 again.
>
> Did something happen and my application got locked in an "error
> state"? I've got some Internal Server Error on the dashboard pages too
> at the same time the first error 500 happened.
>
> PS: The application is still running OK.
>
> PS2: app name is footbattle
>
> 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: Errors 500 and 409 while updating application

2009-10-22 Thread Don Schwarz
The 500 errors in the Admin Console are a general issue that we're looking
into.

The 409's indicate that you have a pending update that needs to be rolled
back (via appcfg.sh rollback) due to one of the 500 errors.  After rolling
the update back you can try to deploy again.

On Thu, Oct 22, 2009 at 11:51 AM, WSouza  wrote:

>
> Hello,
>
> Since about 15 mins ago, when I try to update my application, it is
> returning an error 500 (internal server error) and if i try again,
> error 409 (conflict) until I restart my eclipse, then it goes back to
> error 500 once and then 409 again.
>
> Did something happen and my application got locked in an "error
> state"? I've got some Internal Server Error on the dashboard pages too
> at the same time the first error 500 happened.
>
> PS: The application is still running OK.
>
> PS2: app name is footbattle
>
> 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: Errors 500 and 409 while updating application

2009-10-22 Thread WSouza

Ok. Thank you!

On Oct 22, 1:10 pm, Don Schwarz  wrote:
> The 500 errors in the Admin Console are a general issue that we're looking
> into.
>
> The 409's indicate that you have a pending update that needs to be rolled
> back (via appcfg.sh rollback) due to one of the 500 errors.  After rolling
> the update back you can try to deploy again.
>
>
>
> On Thu, Oct 22, 2009 at 11:51 AM, WSouza  wrote:
>
> > Hello,
>
> > Since about 15 mins ago, when I try to update my application, it is
> > returning an error 500 (internal server error) and if i try again,
> > error 409 (conflict) until I restart my eclipse, then it goes back to
> > error 500 once and then 409 again.
>
> > Did something happen and my application got locked in an "error
> > state"? I've got some Internal Server Error on the dashboard pages too
> > at the same time the first error 500 happened.
>
> > PS: The application is still running OK.
>
> > PS2: app name is footbattle
>
> > 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] Authentication with Google Apps

2009-10-22 Thread sportrider

I am working to publish a site on App Engine and would like to
authenticate users by using their Google Apps email rather than a
gmail email.

For example I'd like my users to enter their u...@mycompany.com email
rather than someb...@gmail.com.  Is this possible?

I've tried adding "mycompany.com" to the authDomain argument on
userService.createLoginURL(), but this didn't seem to do anything.

Many thanks,
Chris

--~--~-~--~~~---~--~~
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] Failing to load child objects from datastore

2009-10-22 Thread MCaraway

I have a JUnit which I'm testing storing and retrieving of objects
into the datastore.  So far I cannot get any of the one to one or one
to many children objects to load.  Am I doing something wrong?  Below
I've listed my simple test with snippets of the objects.


@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class TestObject1
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key = null;
@Persistent
private String name = null;
@Persistent
private String version = null;
@Persistent
private TestObject2 object2 = null;

... accessors
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class TestObject2
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key = null;
@Persistent
private String name = null;
@Persistent
private String version = null;

... accessors
}

public class TestDOA extends LocalDatastoreTestCase
{
private static final PersistenceManagerFactory PMF = JDOHelper
.getPersistenceManagerFactory("transactions-optional");
public void testBatchInsert()
{
TestObject1 object1 = createTestObject1();

TestObject1 persisted = saveObjectToDataStore(object1);
assertNotNull(persisted);

TestObject1 loadedObject1 = getObjectFromDataStore();
assertNotNull(loadedObject1);

assertNotNull(loadedObject1.getObject2());  // currently 
fails this
assertion

}


private PersistenceManager getPersistenceManager()
{
return PMF.getPersistenceManager();
}

private TestObject1 saveObjectToDataStore(TestObject1 object1)
{
PersistenceManager pm = getPersistenceManager();
Transaction tx = pm.currentTransaction();
try
{
tx.begin();

TestObject1 persisted = pm.makePersistent(object1);
tx.commit();
return persisted;
}
catch (Throwable e)
{
e.printStackTrace();
}
finally{
if (tx.isActive())
{
tx.rollback();
}
pm.close();
}
return null;
}

@SuppressWarnings("unchecked")
public TestObject1 getObjectFromDataStore()
{
PersistenceManager pm = getPersistenceManager();
try
{
Query q = pm.newQuery("select from " + 
TestObject1.class.getName
());
List objects = (List) 
q.execute();
TestObject1 survey =objects.size() > 0 ? 
objects.get(objects.size()
- 1) : null;
return survey;
} finally
{
pm.close();
}
}

private TestObject1 createTestObject1()
{
TestObject2 object2 = new TestObject2("Name", "Version");
TestObject1 object1 = new TestObject1("Name", "Version", 
object2);
return object1;
}
}

--~--~-~--~~~---~--~~
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: Eclipse GWT update error

2009-10-22 Thread Arturito

I don't know if that helps you but. I had the same problem with my
projects after the upgrade. It was showing "GWT - version unknown"
All I did was:

1. "Properties" of the Project
2. "Java Build Path" > "Libraries"
3. "GWT - SDK unknown version" <- remove
4. "Add Library" > Google Web Toolkit
5. "Use specific SDK" > GWT 1.7.1

After that everything went to normal. I guess the same can be applied
to AppEngine.


On Sep 14, 3:17 pm, AndrewG  wrote:
> I Just had what looks like exactly the same problem - but on Ganymede.
>
> I was trying to do an 'update' of the installed GWT dev tools in
> Eclipse - from prefs it looks like upgrade was from bundle 1.6.4 to
> 1.7.0.
>
> The gwt update appears to succeed - and then a large number of errors
> appear in existing gwt projects.
>
> One symptom is that when you look at gwt prefs/properties - the
> selected version of app engine is: 'app engine - unknown version' -
> the 'unknown' version seems to correspond to the vn installed before
> the 'upgrade' - which has got lobotomised in the process.

--~--~-~--~~~---~--~~
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] External MySQL

2009-10-22 Thread seagull1

For my app, I need to access an external MySQL database and add data
(this is a connection between my app and a project outside of my
control). My app uses JDOs and all that what not.

I see that java.sql is on the white list, but perhaps some other
things are not (Drivers and ability to make eternal connections)

So, is there a way for me to make this connection to the external
MySQL database?

Thank you for the 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] null User from datastore

2009-10-22 Thread Brian

In development mode, when I query out my entities using JDOQL, they
come back with null User fields.  The Datastore Viewer shows a non-
null user field, however.

I tried importing them with like so, but it didn't help.
query.declareImports("import com.google.appengine.api.users.User");

Thanks for any ideas,
Brian

--~--~-~--~~~---~--~~
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] Casting Text to String exception

2009-10-22 Thread seungjin

I was trying to cast from Text
(com.google.appengine.api.datastore.Text) to String with getValue()
and toString() method but keep getting java.lang.ClassCastException:
java.lang.String.

Is it only 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: External MySQL

2009-10-22 Thread Richard

I think you'll need to build a web service in front of the MySQL db
and call it from GAE's urlfetch.  I don't see how you could connect
directly.

Regards,
Richard

On Oct 22, 7:54 am, seagull1  wrote:
> For my app, I need to access an external MySQL database and add data
> (this is a connection between my app and a project outside of my
> control). My app uses JDOs and all that what not.
>
> I see that java.sql is on the white list, but perhaps some other
> things are not (Drivers and ability to make eternal connections)
>
> So, is there a way for me to make this connection to the external
> MySQL database?
>
> Thank you for the 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] Photo and Video services

2009-10-22 Thread Diana Cruise

What options do I have in GAE to allow Users to upload, store, and
view media (photos, video, audio, etc) from my within my application?

Is there a special data type in datastore that would be used to store
media?  If I store a media item in datastore then how do I display it
to the User?  In a regular app server, I would do this as a static
file reference where I first transfer the data from the database to a
file accessible under webroot (if it is not already present).  But in
GAE the application can NOT create files in the static area due to
permissions...so is there another technique to accomplish this?

Would videos best be served indirectly via youtube?  If so, how do I
know they will NOT be removed prematurely by youtube?

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] JDO persistent fields on superclasses bug resolved?

2009-10-22 Thread Erem

The wiki states that "There is currently a bug preventing persistent
fields on superclasses from being saved to the datastore. This will be
fixed in a future release."
(http://code.google.com/appengine/docs/java/datastore/usingjdo.html)

Meanwhile, the pertinent DataNucleus issue seems to have been closed
(http://code.google.com/p/datanucleus-appengine/issues/detail?
id=5&can=7)

Does this mean that this bug is resolved and the wiki out of date? Can
we safely persist subclasses and expect persistence annotated
superclass fields to also be persisted?

Thanks,
Erem
--~--~-~--~~~---~--~~
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 persistent fields on superclasses bug resolved?

2009-10-22 Thread Max Ross
Sorry Erem, that was an earlier attempt to fix the problem in a quick and
dirty way.  It turned out to be far too quick and far too dirty.  There is a
newer bug to support inheritance that is currently open:
http://code.google.com/p/datanucleus-appengine/issues/detail?id=25

I've merged the bug you referenced into that one.  I'm working on it right
now, targeting the next SDK release.

Max

On Thu, Oct 22, 2009 at 11:15 AM, Erem  wrote:

>
> The wiki states that "There is currently a bug preventing persistent
> fields on superclasses from being saved to the datastore. This will be
> fixed in a future release."
> (http://code.google.com/appengine/docs/java/datastore/usingjdo.html)
>
> Meanwhile, the pertinent DataNucleus issue seems to have been closed
> (http://code.google.com/p/datanucleus-appengine/issues/detail?
> id=5&can=7
> )
>
> Does this mean that this bug is resolved and the wiki out of date? Can
> we safely persist subclasses and expect persistence annotated
> superclass fields to also be persisted?
>
> Thanks,
> Erem
> >
>

--~--~-~--~~~---~--~~
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: Photo and Video services

2009-10-22 Thread Raphael André Bauer

On Thu, Oct 22, 2009 at 7:55 PM, Diana Cruise  wrote:
>
> What options do I have in GAE to allow Users to upload, store, and
> view media (photos, video, audio, etc) from my within my application?
in short: it's not possible.
(don't forget that there is a 1mb limit for requests and responses on
http level - and also a 1mb level on all entities (blobs, whatever)).

long version:
you can work around that by using ajax calls and composing everything
from small requests and / or splitting stuff over many small entities
of 1mb each, but i guess that is not something you really want.

you can also use services like youtube to put content on external
sources and mesh them up with your application, but this is then a
completely different scenario (but a creative one :) )

a service for large file delivery is currently under development by
the googlers, but i do not know when it will be publicly available ---
this service will change a lot i guess...


ra!
>
> Is there a special data type in datastore that would be used to store
> media?  If I store a media item in datastore then how do I display it
> to the User?  In a regular app server, I would do this as a static
> file reference where I first transfer the data from the database to a
> file accessible under webroot (if it is not already present).  But in
> GAE the application can NOT create files in the static area due to
> permissions...so is there another technique to accomplish this?
>
> Would videos best be served indirectly via youtube?  If so, how do I
> know they will NOT be removed prematurely by youtube?
>
> 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: 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 full
10.0MB allowed by Google App Engine.

There's a feature on the roadmap called "Service for storing and
serving large files," but there's apparently no additional information
available on this feature:

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

Vince

On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise  wrote:
>
> What options do I have in GAE to allow Users to upload, store, and
> view media (photos, video, audio, etc) from my within my application?
>
> Is there a special data type in datastore that would be used to store
> media?  If I store a media item in datastore then how do I display it
> to the User?  In a regular app server, I would do this as a static
> file reference where I first transfer the data from the database to a
> file accessible under webroot (if it is not already present).  But in
> GAE the application can NOT create files in the static area due to
> permissions...so is there another technique to accomplish this?
>
> Would videos best be served indirectly via youtube?  If so, how do I
> know they will NOT be removed prematurely by youtube?
>
> 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: ClientLogin and user data

2009-10-22 Thread Jason (Google)
If you're trying to get your personal contact information using the Google
Contacts data API, then you should be asking this in the Google Contacts API
discussion group:

http://groups.google.com/group/google-contacts-api

If you're using ClientLogin with App Engine, you can submit the token to
your requests via a cookie in order to use the Google Accounts service.
Still, this will only give you access to your email and nickname, so you'll
want to look into the Google Contacts API if you need more profile
information.

- Jason

On Tue, Oct 20, 2009 at 3:54 PM, ale  wrote:

>
> hi every body,
> I'm trying to use GAE with ClientLogin and google data api.
> It's all ok, a can login e get the authtoken, and I can get all
> contatcs from the Google Contacts Data API.
>
> The question is, how can I get my data? I can see a lot of info for
> the contact, but for the prinicipal user I can see only email...
> (because I put in the login panel)
>
> there is a Profile Data API or something like that?
>
> Thanks a lot, and sorry for my very bad english
>
> Ale
>
> >
>

--~--~-~--~~~---~--~~
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: Caching using static fields

2009-10-22 Thread Jason (Google)
You're welcome to file a feature request, although for the time being,
memcache and the datastore will remain the only mechanisms for communicating
across all instances of a running application.

http://code.google.com/p/googleappengine/issues/list

- Jason

On Tue, Oct 20, 2009 at 10:20 PM, Adligo  wrote:

>
> Hi All,
>
> I also struggled with this topic a bit, and I am wondering why the
> google app engine doesn't have some api like;
>
> GWT RPC?
> public MachineMacOrSomething getRAMSessionMachineIdString session);
>
> regular http
> myapp.appspot.com/whatRAMSessionMachineId?jsessionId=
>
> It would also solve the issue of storing Sessions to disk on each
> request, which really doesn't seem all that efficient (having used it
> for a month or so).  For GWT( and other ajax) apps this would provide
> a simple way of using a Session and Static Cacheing the way it is
> usually done in Java App Servers (have seen static caching in a few
> Tomcat projects, Jboss and Tomcat keep the HttpSession in RAM).
>
> Perhaps there would also be a appengine-web.xml setting
> ram-session
> so that the older disk session impl would not need to be changed.
>
> GWT RPC itself may need also be upgraded to be compatible with the
> idea, including the MachineId somewhere for routing in the google app
> engine code.
>
> Cheers,
> Scott
> >
>

--~--~-~--~~~---~--~~
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: Photo and Video services

2009-10-22 Thread Diana Cruise

Vince, I was unable to upload small photos...getting error code 500!

What is the basic principle behind this solution?  It appears you are
storing the file in datastore in increments of 1M or less...along the
lines of what Raphael was getting at.  How do you display a list of
images from the datastore on a webpage?

On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
> 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 full
> 10.0MB allowed by Google App Engine.
>
> There's a feature on the roadmap called "Service for storing and
> serving large files," but there's apparently no additional information
> available on this feature:
>
>    http://code.google.com/appengine/docs/roadmap.html
>
> Vince
>
>
>
> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise  
> wrote:
>
> > What options do I have in GAE to allow Users to upload, store, and
> > view media (photos, video, audio, etc) from my within my application?
>
> > Is there a special data type in datastore that would be used to store
> > media?  If I store a media item in datastore then how do I display it
> > to the User?  In a regular app server, I would do this as a static
> > file reference where I first transfer the data from the database to a
> > file accessible under webroot (if it is not already present).  But in
> > GAE the application can NOT create files in the static area due to
> > permissions...so is there another technique to accomplish this?
>
> > Would videos best be served indirectly via youtube?  If so, how do I
> > know they will NOT be removed prematurely by youtube?
>
> > Thanks.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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] JDO Collection Load Issue

2009-10-22 Thread jeffgnpc

I am having an issue loading Collections after they have been stored
in the datastore.  I have simplified this issue down to a simple
example listed below.  If I run with the current comments, everything
works fine, and the Collections are loaded.  If I uncomment "foo1" or
"foo2", the Collections no longer load (they are null).  If I
uncomment the constructor where I add values to the list, everything
works fine again.

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Player2 {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
public Long key;

//@Persistent
//private Long foo1; //Cause Collection issue
//@Persistent
//private String foo2; //Causes Collection issue
@Persistent
private Key foo3; // This works

@Persistent(defaultFetchGroup = "true")
private Set longSet = new HashSet();
@Persistent(defaultFetchGroup = "true")
private List longList = new ArrayList();
@Persistent(defaultFetchGroup = "true")
private Set stringSet = new HashSet();
@Persistent(defaultFetchGroup = "true")
private List stringList = new LinkedList();
@Persistent(defaultFetchGroup = "true")
private Set keySet = new HashSet();
@Persistent(defaultFetchGroup = "true")
private List keyList = new LinkedList();

public Player2() {
//Adding to the List Fixes Collection issue
//longSet.add(1234l);
//longList.add(1234l);
//stringSet.add("1234l");
//stringList.add("1234l");
//keySet.add(KeyFactory.createKey(Player2.class.getSimpleName
(), "alfred.sm...@example.com"));
//keyList.add(KeyFactory.createKey(Player2.class.getSimpleName
(), "alfred.sm...@example.com"));
}
}


I believe this might be a similar issue to this thread:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/a44cb049f40d6bab/f9047e0a25e3453f?lnk=gst&q=JDO+collection+null#f9047e0a25e3453f

But when I run with in either of the successful ways, the Collections
don't seem to be SCO fields.  I will also post in that thread in case
it helps with the ticket.

Thanks,
Jeff
--~--~-~--~~~---~--~~
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: ArrayList's modification is not saved if modify it after makePersistent.

2009-10-22 Thread jeffgnpc

I might be having a similar issue.  I have simplified this issue down
to a simple example listed below.  If I run with the current comments,
everything works fine, and the Collections are loaded.  If I uncomment
"foo1" or "foo2", the Collections no longer load (they are null).  If
I uncomment the constructor where I add values to the list, everything
works fine again.

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Player2 {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
public Long key;

//@Persistent
//private Long foo1; //Cause Collection issue
//@Persistent
//private String foo2; //Causes Collection issue
@Persistent
private Key foo3; // This works

@Persistent(defaultFetchGroup = "true")
private Set longSet = new HashSet();
@Persistent(defaultFetchGroup = "true")
private List longList = new ArrayList();
@Persistent(defaultFetchGroup = "true")
private Set stringSet = new HashSet();
@Persistent(defaultFetchGroup = "true")
private List stringList = new LinkedList();
@Persistent(defaultFetchGroup = "true")
private Set keySet = new HashSet();
@Persistent(defaultFetchGroup = "true")
private List keyList = new LinkedList();

public Player2() {
//Adding to the List Fixes Collection issue
//longSet.add(1234l);
//longList.add(1234l);
//stringSet.add("1234l");
//stringList.add("1234l");
//keySet.add(KeyFactory.createKey(Player2.class.getSimpleName
(), "alfred.sm...@example.com"));
//keyList.add(KeyFactory.createKey(Player2.class.getSimpleName
(), "alfred.sm...@example.com"));
}
}

I have started another thread in case this is a different issue, but
wanted to post here because this thread is listed in a ticket.

Thanks,
Jeff

On Oct 14, 2:23 pm, WdWeaver  wrote:
> Hi Jason,
>
> I filed this issue 
> here:http://code.google.com/p/datanucleus-appengine/issues/detail?id=144
>
> Thanks,
> Wada3
>
> On 10月15日, 午前4:19, "Jason (Google)"  wrote:
>
> > Here's the link to the datanucleus-appengine project's issue 
> > tracker:http://code.google.com/p/datanucleus-appengine/issues/list
>
> > - Jason
>
> > On Mon, Oct 12, 2009 at 7:36 AM, datanucleus 
> > wrote:
>
> > > > Should it be filed as a bug of datanucleus-appengine?
>
> > > Yes.
> > > After makePersistent() an object should be in Persistent-Clean state
> > > and any SCO fields should be wrapped (see the log which should tell
> > > you if they are doing that); that is the whole point of transparent
> > > persistence. If GAE/J is not doing that then it is a bug
>
>
--~--~-~--~~~---~--~~
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 contains(Key) in JDO query

2009-10-22 Thread king

Thanks Yasuo, it works!  Do you know how I can set filter for multiple
keys? that is, how I can do something like:
query.setFilter("detailKeySet.contains(:keyList)");

On Oct 21, 10:36 pm, Yasuo Higa  wrote:
> Hi king,
>
> On Thu, Oct 22, 2009 at 6:19 AM, king  wrote:
>
> > Can anyone help me to figure out how to write a query to do contains
> > (Key) in JDO?  Here is my scriplet:
> > select from " + master.class.getName()
> > + " where detailKeySet.contains('" + detail.getKey().toString() + "')"
>
> PersistenceManager pm = PMF.get().getPersistenceManager();
> Query query = pm.newQuery(Master.class);
> query.setFilter("detailKeySet.contains(:key)");
> List list = (List) query.execute(detail.getKey());
>
> Hope this helps,
>
> 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] Re: Photo and Video services

2009-10-22 Thread Bassil Karam
Diana, from this thread:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/def13e8ec370af74
"Basically, you'll need to store both the image data and its content type.
Then, when the entity is fetched, set the content type appropriately
using  resp.setContentType(...) and echo the bytes to the browser. Let me
know if you have any more questions on this." (Jason, Google)

Baz


On Thu, Oct 22, 2009 at 12:04 PM, Diana Cruise wrote:

>
> Vince, I was unable to upload small photos...getting error code 500!
>
> What is the basic principle behind this solution?  It appears you are
> storing the file in datastore in increments of 1M or less...along the
> lines of what Raphael was getting at.  How do you display a list of
> images from the datastore on a webpage?
>
> On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
> > 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 full
> > 10.0MB allowed by Google App Engine.
> >
> > There's a feature on the roadmap called "Service for storing and
> > serving large files," but there's apparently no additional information
> > available on this feature:
> >
> >http://code.google.com/appengine/docs/roadmap.html
> >
> > Vince
> >
> >
> >
> > On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise 
> wrote:
> >
> > > What options do I have in GAE to allow Users to upload, store, and
> > > view media (photos, video, audio, etc) from my within my application?
> >
> > > Is there a special data type in datastore that would be used to store
> > > media?  If I store a media item in datastore then how do I display it
> > > to the User?  In a regular app server, I would do this as a static
> > > file reference where I first transfer the data from the database to a
> > > file accessible under webroot (if it is not already present).  But in
> > > GAE the application can NOT create files in the static area due to
> > > permissions...so is there another technique to accomplish this?
> >
> > > Would videos best be served indirectly via youtube?  If so, how do I
> > > know they will NOT be removed prematurely by youtube?
> >
> > > Thanks.- Hide quoted text -
> >
> > - Show quoted text -
> >
>

--~--~-~--~~~---~--~~
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: Photo and Video services

2009-10-22 Thread Vince Bonfanti

You were unable to upload a small photo on my demo site, or in your
development environment? I just successfully uploaded an image to the
demo site, which you can download from here:

http://gaevfs.appspot.com/gaevfs/images/

Yes, the images get stored in "blocks" of 1MB or less. GaeVFS
implements a virtual file system, so you refer to the file using URL
links, just as you would for a static file. For example, here's an
image I just uploaded:

http://gaevfs.appspot.com/gaevfs/images/img4.jpg

The GaeVfsServlet handles both upload and download, and demonstrates
how this is done:


http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlanta/appengine/servlet/GaeVfsServlet.java

The GaeVfsServlet also handles setting the content type for the response.

Vince

On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise  wrote:
>
> Vince, I was unable to upload small photos...getting error code 500!
>
> What is the basic principle behind this solution?  It appears you are
> storing the file in datastore in increments of 1M or less...along the
> lines of what Raphael was getting at.  How do you display a list of
> images from the datastore on a webpage?
>
> On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
>> 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 full
>> 10.0MB allowed by Google App Engine.
>>
>> There's a feature on the roadmap called "Service for storing and
>> serving large files," but there's apparently no additional information
>> available on this feature:
>>
>>    http://code.google.com/appengine/docs/roadmap.html
>>
>> Vince
>>
>>
>>
>> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise  
>> wrote:
>>
>> > What options do I have in GAE to allow Users to upload, store, and
>> > view media (photos, video, audio, etc) from my within my application?
>>
>> > Is there a special data type in datastore that would be used to store
>> > media?  If I store a media item in datastore then how do I display it
>> > to the User?  In a regular app server, I would do this as a static
>> > file reference where I first transfer the data from the database to a
>> > file accessible under webroot (if it is not already present).  But in
>> > GAE the application can NOT create files in the static area due to
>> > permissions...so is there another technique to accomplish this?
>>
>> > Would videos best be served indirectly via youtube?  If so, how do I
>> > know they will NOT be removed prematurely by youtube?
>>
>> > Thanks.- Hide quoted text -
>>
>> - Show quoted text -
>

--~--~-~--~~~---~--~~
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: Photo and Video services

2009-10-22 Thread Diana Cruise

Thanks Baz.

Vince, I hit your demo site and just 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  wrote:
> You were unable to upload a small photo on my demo site, or in your
> development environment? I just successfully uploaded an image to the
> demo site, which you can download from here:
>
>    http://gaevfs.appspot.com/gaevfs/images/
>
> Yes, the images get stored in "blocks" of 1MB or less. GaeVFS
> implements a virtual file system, so you refer to the file using URL
> links, just as you would for a static file. For example, here's an
> image I just uploaded:
>
>    http://gaevfs.appspot.com/gaevfs/images/img4.jpg
>
> The GaeVfsServlet handles both upload and download, and demonstrates
> how this is done:
>
>    http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant...
>
> The GaeVfsServlet also handles setting the content type for the response.
>
> Vince
>
>
>
> On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise  
> wrote:
>
> > Vince, I was unable to upload small photos...getting error code 500!
>
> > What is the basic principle behind this solution?  It appears you are
> > storing the file in datastore in increments of 1M or less...along the
> > lines of what Raphael was getting at.  How do you display a list of
> > images from the datastore on a webpage?
>
> > On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
> >> 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 full
> >> 10.0MB allowed by Google App Engine.
>
> >> There's a feature on the roadmap called "Service for storing and
> >> serving large files," but there's apparently no additional information
> >> available on this feature:
>
> >>    http://code.google.com/appengine/docs/roadmap.html
>
> >> Vince
>
> >> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise  
> >> wrote:
>
> >> > What options do I have in GAE to allow Users to upload, store, and
> >> > view media (photos, video, audio, etc) from my within my application?
>
> >> > Is there a special data type in datastore that would be used to store
> >> > media?  If I store a media item in datastore then how do I display it
> >> > to the User?  In a regular app server, I would do this as a static
> >> > file reference where I first transfer the data from the database to a
> >> > file accessible under webroot (if it is not already present).  But in
> >> > GAE the application can NOT create files in the static area due to
> >> > permissions...so is there another technique to accomplish this?
>
> >> > Would videos best be served indirectly via youtube?  If so, how do I
> >> > know they will NOT be removed prematurely by youtube?
>
> >> > Thanks.- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: Photo and Video services

2009-10-22 Thread Diana Cruise

Actually, I tried simple files without spaces also and they failed
too.  When I hit your photo I noticed execellent response time...have
you noticed any particular degradation when displaying lists of
photos, for example?

On Oct 22, 3:58 pm, Diana Cruise  wrote:
> Thanks Baz.
>
> Vince, I hit your demo site and just 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  wrote:
>
>
>
> > You were unable to upload a small photo on my demo site, or in your
> > development environment? I just successfully uploaded an image to the
> > demo site, which you can download from here:
>
> >    http://gaevfs.appspot.com/gaevfs/images/
>
> > Yes, the images get stored in "blocks" of 1MB or less. GaeVFS
> > implements a virtual file system, so you refer to the file using URL
> > links, just as you would for a static file. For example, here's an
> > image I just uploaded:
>
> >    http://gaevfs.appspot.com/gaevfs/images/img4.jpg
>
> > The GaeVfsServlet handles both upload and download, and demonstrates
> > how this is done:
>
> >    http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant...
>
> > The GaeVfsServlet also handles setting the content type for the response.
>
> > Vince
>
> > On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise  
> > wrote:
>
> > > Vince, I was unable to upload small photos...getting error code 500!
>
> > > What is the basic principle behind this solution?  It appears you are
> > > storing the file in datastore in increments of 1M or less...along the
> > > lines of what Raphael was getting at.  How do you display a list of
> > > images from the datastore on a webpage?
>
> > > On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
> > >> 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 full
> > >> 10.0MB allowed by Google App Engine.
>
> > >> There's a feature on the roadmap called "Service for storing and
> > >> serving large files," but there's apparently no additional information
> > >> available on this feature:
>
> > >>    http://code.google.com/appengine/docs/roadmap.html
>
> > >> Vince
>
> > >> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise  
> > >> wrote:
>
> > >> > What options do I have in GAE to allow Users to upload, store, and
> > >> > view media (photos, video, audio, etc) from my within my application?
>
> > >> > Is there a special data type in datastore that would be used to store
> > >> > media?  If I store a media item in datastore then how do I display it
> > >> > to the User?  In a regular app server, I would do this as a static
> > >> > file reference where I first transfer the data from the database to a
> > >> > file accessible under webroot (if it is not already present).  But in
> > >> > GAE the application can NOT create files in the static area due to
> > >> > permissions...so is there another technique to accomplish this?
>
> > >> > Would videos best be served indirectly via youtube?  If so, how do I
> > >> > know they will NOT be removed prematurely by youtube?
>
> > >> > Thanks.- Hide quoted text -
>
> > >> - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: LIKE query workaround for the Low Level API

2009-10-22 Thread Nicholas Albion

I don't suppose it's possible to do:

myString LIKE "%,foo,%"

I'm surprised that the datastore used by a search engine doesn't have
better support for string searching/comparison...
--~--~-~--~~~---~--~~
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: SimpleDS: an alternative for Datastore persistence

2009-10-22 Thread Peter Liu

Awesome!

I recently played with the lower level API as well. Some of the
features are not available in JDO, like reserving a key before
committing a new object. The detach/attach is also problematic when
dealing with caching and transaction. I also noticed small JDO objects
are much bigger than it needs to be when serialized.

Just wondering do you have any performance profiling stats? I also
feel like JDO is overkill, but I couldn't justify porting all JDO
objects to another simple type without knowing how much cpu_ms it will
save.

Also, do you keep track of which field is dirty and avoid committing
unmodified fields? I believe this is important to minimize api_cpu to
avoid unnecessary index updates.


On Oct 22, 2:37 am, Nacho Coloma  wrote:
> Hi all,
>
> We have been developing a persistence framework for the AppEngine
> Datastore based on the raw DatastoreService API. For our (simple)
> persistence case, both JDO and JPA were a bit overkill as we were
> spending a significant amount of time jumping through hoops to make
> our application roll, but at the same time the Datastore API was a too
> low-level solution to be usable.
>
> So we reinvented our wheel. In two days.
>
> SimpleDS is a light wrapper around the DatastoreService APIs that
> provide a simple interface for java persistent classes. It does not
> include fancy stuff or any super features, it's just the
> DatastoreService ported to a world where Java entities can be
> persisted directly (using a subset of JPA annotations).  This is _not_
> a JPA/JDO replacement, and will never be. But we have been using it
> for some weeks and are quite happy with it.
>
> Any kind of feedback from the AppEngine  community would be welcome.
> Before calling the typical "but we already have JPA/JDO!" argument,
> please notice the following:
>
> * There are lots of considerations in a relational database that do
> not apply to AppEngine. This allows a specific solution to be
> simplified big time. Just see the depth of your typical stack trace to
> understand what I am talking about.
> * Solutions can be designed for specific cases that are common
> practice in AppEngine but do not apply to a relational database. See,
> for example, saving entities with a parent instance.
> * Transactions also behave a bit differently, where a "one size fits
> all" approach would probably not be the best solution.
>
> To better ilustrate with an example, these are some typical tasks
> performed with SimpleDS:
>
> Retrieve instance:
> FooBar bar = entityManager.get(key);
>
> Transform from Google Datastore Entity to java and viceversa:
> Entity entity = entityManager.datastoreToJava(bar);
>
> Save generating a  primary key, with a parent instance:
> FooBar bar = new FooBar();
> entityManager.put(parentKey, bar);
>
> More can be seen here:http://code.google.com/p/simpleds/wiki/SimpleTasks
>
> Any discussion about the current API state is welcome. This entire
> thing was rolled in two days and tested in a couple of weeks so there
> should be some bugs in between.
>
> It is important to keep in mind the current list of limitations:
>
> * Only the Key class is a supported primary key.
> * IN and != are not supported (yet). I have big concerns about
> supporting this, performance-wise.
> * Relationships are not supported. You can use Keys and collections of
> Keys for that purpose.
> * Transactions are not yet included. We are not yet sure about how to
> proceed here.
>
> As I said, this is not conceived to become a feature-complete JPA
> replacement, so please don't treat it like that.
>
> Best regards,
>
> Nacho.
--~--~-~--~~~---~--~~
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: Photo and Video services

2009-10-22 Thread Vince Bonfanti

Can you try a different browser? From the logs it looks like you're
using IE7. I just tried with IE8, Chrome, and Firefox 3 (all on
Windows) and they all worked fine. Something about the path being sent
by the browser is causing the error--if we can narrow it to IE7 then I
can investigate further.

The only "degradation" I've ever seen is that larger files take longer
to download, which you'd expect. However, I've never done any real
load or stress testing.

Vince

On Thu, Oct 22, 2009 at 6:07 PM, Diana Cruise  wrote:
>
> Actually, I tried simple files without spaces also and they failed
> too.  When I hit your photo I noticed execellent response time...have
> you noticed any particular degradation when displaying lists of
> photos, for example?
>
> On Oct 22, 3:58 pm, Diana Cruise  wrote:
>> Thanks Baz.
>>
>> Vince, I hit your demo site and just 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  wrote:
>>
>>
>>
>> > You were unable to upload a small photo on my demo site, or in your
>> > development environment? I just successfully uploaded an image to the
>> > demo site, which you can download from here:
>>
>> >    http://gaevfs.appspot.com/gaevfs/images/
>>
>> > Yes, the images get stored in "blocks" of 1MB or less. GaeVFS
>> > implements a virtual file system, so you refer to the file using URL
>> > links, just as you would for a static file. For example, here's an
>> > image I just uploaded:
>>
>> >    http://gaevfs.appspot.com/gaevfs/images/img4.jpg
>>
>> > The GaeVfsServlet handles both upload and download, and demonstrates
>> > how this is done:
>>
>> >    http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant...
>>
>> > The GaeVfsServlet also handles setting the content type for the response.
>>
>> > Vince
>>
>> > On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise  
>> > wrote:
>>
>> > > Vince, I was unable to upload small photos...getting error code 500!
>>
>> > > What is the basic principle behind this solution?  It appears you are
>> > > storing the file in datastore in increments of 1M or less...along the
>> > > lines of what Raphael was getting at.  How do you display a list of
>> > > images from the datastore on a webpage?
>>
>> > > On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
>> > >> 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 full
>> > >> 10.0MB allowed by Google App Engine.
>>
>> > >> There's a feature on the roadmap called "Service for storing and
>> > >> serving large files," but there's apparently no additional information
>> > >> available on this feature:
>>
>> > >>    http://code.google.com/appengine/docs/roadmap.html
>>
>> > >> Vince
>>
>> > >> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise 
>> > >>  wrote:
>>
>> > >> > What options do I have in GAE to allow Users to upload, store, and
>> > >> > view media (photos, video, audio, etc) from my within my application?
>>
>> > >> > Is there a special data type in datastore that would be used to store
>> > >> > media?  If I store a media item in datastore then how do I display it
>> > >> > to the User?  In a regular app server, I would do this as a static
>> > >> > file reference where I first transfer the data from the database to a
>> > >> > file accessible under webroot (if it is not already present).  But in
>> > >> > GAE the application can NOT create files in the static area due to
>> > >> > permissions...so is there another technique to accomplish this?
>>
>> > >> > Would videos best be served indirectly via youtube?  If so, how do I
>> > >> > know they will NOT be removed prematurely by youtube?
>>
>> > >> > Thanks.- Hide quoted text -
>>
>> > >> - Show quoted text -- Hide quoted text -
>>
>> > - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
> >
>

--~--~-~--~~~---~--~~
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: [Persistence] Problem with saving parent entity

2009-10-22 Thread Jason (Google)
As a quick sanity check, can you issue an ancestor query on the stored
Source using the low-level datastore API? This will help verify whether all
News entities are being saved in the same entity group as the Source entity,
which is the implicit assumption here.
Also, you should modify your loadAll method to close the PersistenceManager
before exiting the method. As it stands, your application is leaking
resources every time this method is called.

- Jason

On Thu, Oct 15, 2009 at 3:08 AM, Shponter  wrote:

>
> Hi.
>
> I have a problem with saving parent entity (Source) when saving child
> entity (News) in one-to-many relationship.
> I try to save 5 News entities and only in first one the parent Source
> field is saved...
>
> Entities:
>
> @Entity
> public class Source {
>
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>private Key id;
>
>private String name;
>...
>
> @Entity
> public class News {
>
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>private Key id;
>
>private String title;
>
>@ManyToOne
>private Source source;
>...
>
>
>
> Test code:
>
> public void testSave() {
>Source source = new Source("Source");
>source = sourceDao.save(source);
>assertEquals(1, ds.prepare(new Query(Source.class.getSimpleName
> ())).countEntities());
>source = sourceDao.get(source.getId());
>assertNotNull(source);
>assertEquals("Source", source.getName());
>for (int i = 0; i < 5; i++) {
>News news = new News("Title-"+i);
>news.setSource(source);
>newsDao.save(news);
>}
>assertEquals(5, ds.prepare(new Query(News.class.getSimpleName
> ())).countEntities());
>List newsList = newsDao.loadAll();
>for (News n : newsList) {
>System.out.println("news: "+n.getTitle()+", s:
> "+n.getSource());
>}
> }
>
>
> Result of this code:
>
> news: Title-0, s: sou...@aa233f
> news: Title-1, s: null
> news: Title-2, s: null
> news: Title-3, s: null
> news: Title-4, s: null
>
>
> My generic DAO code looks like this:
>
> public T get(PK id) {
>PersistenceManager pm = PMF.get().getPersistenceManager();
>try {
>return (T) pm.getObjectById(this.type, id);
>} finally {
>pm.close();
>}
> }
>
> public T save(T o) {
>PersistenceManager pm = PMF.get().getPersistenceManager();
>try {
>return (T) pm.makePersistent(o);
>} finally {
>pm.close();
>}
> }
>
> @SuppressWarnings("unchecked")
> public List loadAll() {
>PersistenceManager pm = PMF.get().getPersistenceManager();
>return (List) pm.newQuery(this.type).execute();
> }
>
>
> Thanks in advance for any help!
>
> 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: Photo and Video services

2009-10-22 Thread Diana Cruise

Yes, that worked ok from another system so it must be an IE7
problem...good catch!

On Oct 22, 5:55 pm, Vince Bonfanti  wrote:
> Can you try a different browser? From the logs it looks like you're
> using IE7. I just tried with IE8, Chrome, and Firefox 3 (all on
> Windows) and they all worked fine. Something about the path being sent
> by the browser is causing the error--if we can narrow it to IE7 then I
> can investigate further.
>
> The only "degradation" I've ever seen is that larger files take longer
> to download, which you'd expect. However, I've never done any real
> load or stress testing.
>
> Vince
>
>
>
> On Thu, Oct 22, 2009 at 6:07 PM, Diana Cruise  
> wrote:
>
> > Actually, I tried simple files without spaces also and they failed
> > too.  When I hit your photo I noticed execellent response time...have
> > you noticed any particular degradation when displaying lists of
> > photos, for example?
>
> > On Oct 22, 3:58 pm, Diana Cruise  wrote:
> >> Thanks Baz.
>
> >> Vince, I hit your demo site and just 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  wrote:
>
> >> > You were unable to upload a small photo on my demo site, or in your
> >> > development environment? I just successfully uploaded an image to the
> >> > demo site, which you can download from here:
>
> >> >    http://gaevfs.appspot.com/gaevfs/images/
>
> >> > Yes, the images get stored in "blocks" of 1MB or less. GaeVFS
> >> > implements a virtual file system, so you refer to the file using URL
> >> > links, just as you would for a static file. For example, here's an
> >> > image I just uploaded:
>
> >> >    http://gaevfs.appspot.com/gaevfs/images/img4.jpg
>
> >> > The GaeVfsServlet handles both upload and download, and demonstrates
> >> > how this is done:
>
> >> >    
> >> > http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant...
>
> >> > The GaeVfsServlet also handles setting the content type for the response.
>
> >> > Vince
>
> >> > On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise  
> >> > wrote:
>
> >> > > Vince, I was unable to upload small photos...getting error code 500!
>
> >> > > What is the basic principle behind this solution?  It appears you are
> >> > > storing the file in datastore in increments of 1M or less...along the
> >> > > lines of what Raphael was getting at.  How do you display a list of
> >> > > images from the datastore on a webpage?
>
> >> > > On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
> >> > >> 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 full
> >> > >> 10.0MB allowed by Google App Engine.
>
> >> > >> There's a feature on the roadmap called "Service for storing and
> >> > >> serving large files," but there's apparently no additional information
> >> > >> available on this feature:
>
> >> > >>    http://code.google.com/appengine/docs/roadmap.html
>
> >> > >> Vince
>
> >> > >> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise 
> >> > >>  wrote:
>
> >> > >> > What options do I have in GAE to allow Users to upload, store, and
> >> > >> > view media (photos, video, audio, etc) from my within my 
> >> > >> > application?
>
> >> > >> > Is there a special data type in datastore that would be used to 
> >> > >> > store
> >> > >> > media?  If I store a media item in datastore then how do I display 
> >> > >> > it
> >> > >> > to the User?  In a regular app server, I would do this as a static
> >> > >> > file reference where I first transfer the data from the database to 
> >> > >> > a
> >> > >> > file accessible under webroot (if it is not already present).  But 
> >> > >> > in
> >> > >> > GAE the application can NOT create files in the static area due to
> >> > >> > permissions...so is there another technique to accomplish this?
>
> >> > >> > Would videos best be served indirectly via youtube?  If so, how do I
> >> > >> > know they will NOT be removed prematurely by youtube?
>
> >> > >> > Thanks.- Hide quoted text -
>
> >> > >> - Show quoted text -- Hide quoted text -
>
> >> > - Show quoted text -- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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-ja

[appengine-java] Re: Photo and Video services

2009-10-22 Thread Diana Cruise

What is the nature of the 10Mb limit again?

On Oct 22, 6:38 pm, Diana Cruise  wrote:
> Yes, that worked ok from another system so it must be an IE7
> problem...good catch!
>
> On Oct 22, 5:55 pm, Vince Bonfanti  wrote:
>
>
>
> > Can you try a different browser? From the logs it looks like you're
> > using IE7. I just tried with IE8, Chrome, and Firefox 3 (all on
> > Windows) and they all worked fine. Something about the path being sent
> > by the browser is causing the error--if we can narrow it to IE7 then I
> > can investigate further.
>
> > The only "degradation" I've ever seen is that larger files take longer
> > to download, which you'd expect. However, I've never done any real
> > load or stress testing.
>
> > Vince
>
> > On Thu, Oct 22, 2009 at 6:07 PM, Diana Cruise  
> > wrote:
>
> > > Actually, I tried simple files without spaces also and they failed
> > > too.  When I hit your photo I noticed execellent response time...have
> > > you noticed any particular degradation when displaying lists of
> > > photos, for example?
>
> > > On Oct 22, 3:58 pm, Diana Cruise  wrote:
> > >> Thanks Baz.
>
> > >> Vince, I hit your demo site and just 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  wrote:
>
> > >> > You were unable to upload a small photo on my demo site, or in your
> > >> > development environment? I just successfully uploaded an image to the
> > >> > demo site, which you can download from here:
>
> > >> >    http://gaevfs.appspot.com/gaevfs/images/
>
> > >> > Yes, the images get stored in "blocks" of 1MB or less. GaeVFS
> > >> > implements a virtual file system, so you refer to the file using URL
> > >> > links, just as you would for a static file. For example, here's an
> > >> > image I just uploaded:
>
> > >> >    http://gaevfs.appspot.com/gaevfs/images/img4.jpg
>
> > >> > The GaeVfsServlet handles both upload and download, and demonstrates
> > >> > how this is done:
>
> > >> >    
> > >> > http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant...
>
> > >> > The GaeVfsServlet also handles setting the content type for the 
> > >> > response.
>
> > >> > Vince
>
> > >> > On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise 
> > >> >  wrote:
>
> > >> > > Vince, I was unable to upload small photos...getting error code 500!
>
> > >> > > What is the basic principle behind this solution?  It appears you are
> > >> > > storing the file in datastore in increments of 1M or less...along the
> > >> > > lines of what Raphael was getting at.  How do you display a list of
> > >> > > images from the datastore on a webpage?
>
> > >> > > On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
> > >> > >> 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 
> > >> > >> full
> > >> > >> 10.0MB allowed by Google App Engine.
>
> > >> > >> There's a feature on the roadmap called "Service for storing and
> > >> > >> serving large files," but there's apparently no additional 
> > >> > >> information
> > >> > >> available on this feature:
>
> > >> > >>    http://code.google.com/appengine/docs/roadmap.html
>
> > >> > >> Vince
>
> > >> > >> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise 
> > >> > >>  wrote:
>
> > >> > >> > What options do I have in GAE to allow Users to upload, store, and
> > >> > >> > view media (photos, video, audio, etc) from my within my 
> > >> > >> > application?
>
> > >> > >> > Is there a special data type in datastore that would be used to 
> > >> > >> > store
> > >> > >> > media?  If I store a media item in datastore then how do I 
> > >> > >> > display it
> > >> > >> > to the User?  In a regular app server, I would do this as a static
> > >> > >> > file reference where I first transfer the data from the database 
> > >> > >> > to a
> > >> > >> > file accessible under webroot (if it is not already present).  
> > >> > >> > But in
> > >> > >> > GAE the application can NOT create files in the static area due to
> > >> > >> > permissions...so is there another technique to accomplish this?
>
> > >> > >> > Would videos best be served indirectly via youtube?  If so, how 
> > >> > >> > do I
> > >> > >> > know they will NOT be removed prematurely by youtube?
>
> > >> > >> > Thanks.- Hide quoted text -
>
> > >> > >> - Show quoted text -- Hide quoted text -
>
> > >> > - Show quoted text -- Hide quoted text -
>
> > >> - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this mes

[appengine-java] Re: Photo and Video services

2009-10-22 Thread Bassil Karam
Size of a single request.



On Thu, Oct 22, 2009 at 4:40 PM, Diana Cruise wrote:

>
> What is the nature of the 10Mb limit again?
>
> On Oct 22, 6:38 pm, Diana Cruise  wrote:
> > Yes, that worked ok from another system so it must be an IE7
> > problem...good catch!
> >
> > On Oct 22, 5:55 pm, Vince Bonfanti  wrote:
> >
> >
> >
> > > Can you try a different browser? From the logs it looks like you're
> > > using IE7. I just tried with IE8, Chrome, and Firefox 3 (all on
> > > Windows) and they all worked fine. Something about the path being sent
> > > by the browser is causing the error--if we can narrow it to IE7 then I
> > > can investigate further.
> >
> > > The only "degradation" I've ever seen is that larger files take longer
> > > to download, which you'd expect. However, I've never done any real
> > > load or stress testing.
> >
> > > Vince
> >
> > > On Thu, Oct 22, 2009 at 6:07 PM, Diana Cruise <
> diana.l.cru...@gmail.com> wrote:
> >
> > > > Actually, I tried simple files without spaces also and they failed
> > > > too.  When I hit your photo I noticed execellent response time...have
> > > > you noticed any particular degradation when displaying lists of
> > > > photos, for example?
> >
> > > > On Oct 22, 3:58 pm, Diana Cruise  wrote:
> > > >> Thanks Baz.
> >
> > > >> Vince, I hit your demo site and just 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  wrote:
> >
> > > >> > You were unable to upload a small photo on my demo site, or in
> your
> > > >> > development environment? I just successfully uploaded an image to
> the
> > > >> > demo site, which you can download from here:
> >
> > > >> >http://gaevfs.appspot.com/gaevfs/images/
> >
> > > >> > Yes, the images get stored in "blocks" of 1MB or less. GaeVFS
> > > >> > implements a virtual file system, so you refer to the file using
> URL
> > > >> > links, just as you would for a static file. For example, here's an
> > > >> > image I just uploaded:
> >
> > > >> >http://gaevfs.appspot.com/gaevfs/images/img4.jpg
> >
> > > >> > The GaeVfsServlet handles both upload and download, and
> demonstrates
> > > >> > how this is done:
> >
> > > >> >
> http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant...
> >
> > > >> > The GaeVfsServlet also handles setting the content type for the
> response.
> >
> > > >> > Vince
> >
> > > >> > On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise <
> diana.l.cru...@gmail.com> wrote:
> >
> > > >> > > Vince, I was unable to upload small photos...getting error code
> 500!
> >
> > > >> > > What is the basic principle behind this solution?  It appears
> you are
> > > >> > > storing the file in datastore in increments of 1M or
> less...along the
> > > >> > > lines of what Raphael was getting at.  How do you display a list
> of
> > > >> > > images from the datastore on a webpage?
> >
> > > >> > > On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
> > > >> > >> 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 full
> > > >> > >> 10.0MB allowed by Google App Engine.
> >
> > > >> > >> There's a feature on the roadmap called "Service for storing
> and
> > > >> > >> serving large files," but there's apparently no additional
> information
> > > >> > >> available on this feature:
> >
> > > >> > >>http://code.google.com/appengine/docs/roadmap.html
> >
> > > >> > >> Vince
> >
> > > >> > >> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise <
> diana.l.cru...@gmail.com> wrote:
> >
> > > >> > >> > What options do I have in GAE to allow Users to upload,
> store, and
> > > >> > >> > view media (photos, video, audio, etc) from my within my
> application?
> >
> > > >> > >> > Is there a special data type in datastore that would be used
> to store
> > > >> > >> > media?  If I store a media item in datastore then how do I
> display it
> > > >> > >> > to the User?  In a regular app server, I would do this as a
> static
> > > >> > >> > file reference where I first transfer the data from the
> database to a
> > > >> > >> > file accessible under webroot (if it is not already present).
>  But in
> > > >> > >> > GAE the application can NOT create files in the static area
> due to
> > > >> > >> > permissions...so is there another technique to accomplish
> this?
> >
> > > >> > >> > Would videos best be served indirectly via youtube?  If so,
> how do I
> > > >> > >> > know they will NOT be removed prematurely by youtube?
> >
> > > >> > >> > Thanks.- Hide quoted text -
> >
> > > >> > >> - Show quoted

[appengine-java] Re: Casting Text to String exception

2009-10-22 Thread Yasuo Higa

Hi seungjin,

On Thu, Oct 22, 2009 at 2:05 PM, seungjin  wrote:
>
> I was trying to cast from Text
> (com.google.appengine.api.datastore.Text) to String with getValue()
> and toString() method but keep getting java.lang.ClassCastException:
> java.lang.String.
>
You can convert Text to String using Text#getValue() as follows:

Text text = new Text("aaa");
assertEquals("aaa", text.getValue());

Hope this helps,

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] Re: Photo and Video services

2009-10-22 Thread Vince Bonfanti

That's the most GAE will let you upload in one request (for now).
Again, there's a "Service for storing and serving large files" feature
on the roadmap, but the details of this feature have not be revealed.

Vince

On Thu, Oct 22, 2009 at 7:40 PM, Diana Cruise  wrote:
>
> What is the nature of the 10Mb limit again?
>
> On Oct 22, 6:38 pm, Diana Cruise  wrote:
>> Yes, that worked ok from another system so it must be an IE7
>> problem...good catch!
>>
>> On Oct 22, 5:55 pm, Vince Bonfanti  wrote:
>>
>>
>>
>> > Can you try a different browser? From the logs it looks like you're
>> > using IE7. I just tried with IE8, Chrome, and Firefox 3 (all on
>> > Windows) and they all worked fine. Something about the path being sent
>> > by the browser is causing the error--if we can narrow it to IE7 then I
>> > can investigate further.
>>
>> > The only "degradation" I've ever seen is that larger files take longer
>> > to download, which you'd expect. However, I've never done any real
>> > load or stress testing.
>>
>> > Vince
>>
>> > On Thu, Oct 22, 2009 at 6:07 PM, Diana Cruise  
>> > wrote:
>>
>> > > Actually, I tried simple files without spaces also and they failed
>> > > too.  When I hit your photo I noticed execellent response time...have
>> > > you noticed any particular degradation when displaying lists of
>> > > photos, for example?
>>
>> > > On Oct 22, 3:58 pm, Diana Cruise  wrote:
>> > >> Thanks Baz.
>>
>> > >> Vince, I hit your demo site and just 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  wrote:
>>
>> > >> > You were unable to upload a small photo on my demo site, or in your
>> > >> > development environment? I just successfully uploaded an image to the
>> > >> > demo site, which you can download from here:
>>
>> > >> >    http://gaevfs.appspot.com/gaevfs/images/
>>
>> > >> > Yes, the images get stored in "blocks" of 1MB or less. GaeVFS
>> > >> > implements a virtual file system, so you refer to the file using URL
>> > >> > links, just as you would for a static file. For example, here's an
>> > >> > image I just uploaded:
>>
>> > >> >    http://gaevfs.appspot.com/gaevfs/images/img4.jpg
>>
>> > >> > The GaeVfsServlet handles both upload and download, and demonstrates
>> > >> > how this is done:
>>
>> > >> >    
>> > >> > http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant...
>>
>> > >> > The GaeVfsServlet also handles setting the content type for the 
>> > >> > response.
>>
>> > >> > Vince
>>
>> > >> > On Thu, Oct 22, 2009 at 3:04 PM, Diana Cruise 
>> > >> >  wrote:
>>
>> > >> > > Vince, I was unable to upload small photos...getting error code 500!
>>
>> > >> > > What is the basic principle behind this solution?  It appears you 
>> > >> > > are
>> > >> > > storing the file in datastore in increments of 1M or less...along 
>> > >> > > the
>> > >> > > lines of what Raphael was getting at.  How do you display a list of
>> > >> > > images from the datastore on a webpage?
>>
>> > >> > > On Oct 22, 1:33 pm, Vince Bonfanti  wrote:
>> > >> > >> 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 
>> > >> > >> full
>> > >> > >> 10.0MB allowed by Google App Engine.
>>
>> > >> > >> There's a feature on the roadmap called "Service for storing and
>> > >> > >> serving large files," but there's apparently no additional 
>> > >> > >> information
>> > >> > >> available on this feature:
>>
>> > >> > >>    http://code.google.com/appengine/docs/roadmap.html
>>
>> > >> > >> Vince
>>
>> > >> > >> On Thu, Oct 22, 2009 at 1:55 PM, Diana Cruise 
>> > >> > >>  wrote:
>>
>> > >> > >> > What options do I have in GAE to allow Users to upload, store, 
>> > >> > >> > and
>> > >> > >> > view media (photos, video, audio, etc) from my within my 
>> > >> > >> > application?
>>
>> > >> > >> > Is there a special data type in datastore that would be used to 
>> > >> > >> > store
>> > >> > >> > media?  If I store a media item in datastore then how do I 
>> > >> > >> > display it
>> > >> > >> > to the User?  In a regular app server, I would do this as a 
>> > >> > >> > static
>> > >> > >> > file reference where I first transfer the data from the database 
>> > >> > >> > to a
>> > >> > >> > file accessible under webroot (if it is not already present).  
>> > >> > >> > But in
>> > >> > >> > GAE the application can NOT create files in the static area due 
>> > >> > >> > to
>> > >> > >> > permissions...so is there another technique to accomplish this?
>>
>> > >> > >> > Would videos best be served indire

[appengine-java] Re: using contains(Key) in JDO query

2009-10-22 Thread Yasuo Higa

Hi king,

On Fri, Oct 23, 2009 at 4:21 AM, king  wrote:
>
> Thanks Yasuo, it works!  Do you know how I can set filter for multiple
> keys? that is, how I can do something like:
> query.setFilter("detailKeySet.contains(:keyList)");
>
In case of a primary key field, you can use a filter of multiple keys
as follows:

PersistenceManager pm = PMF.get().getPersistenceManager();
Query query = pm.newQuery(Master.class);
// "key" is a name of a primary key field.
query.setFilter("key == :keyList");
List list = (List) query.execute(keyList);

Hope this helps,

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] How Task Queue dispatches each task to multiple JVMs

2009-10-22 Thread kaz

Hi all,

I just posted my test result of Task Queue. Any feedbacks are welcome:

http://kazunori279.blogspot.com/2009/10/how-task-queue-dispatches-each-task-to.html

Thanks,

Kaz
--~--~-~--~~~---~--~~
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: SimpleDS: an alternative for Datastore persistence

2009-10-22 Thread Roy Smith
My goal wasn't to economise on api _ms so I haven't done any comparisons.
afaik, commit is done at an entity level, so I don't monitor individual
fields for changes. If I'm wrong then it wouldn't be too difficult to
build dirty flags into my DTO setters.

My advice to anybody building apps for GAE is to have your own abstraction
layer between JDO/JPA/LLAPI so any porting between regimes is painless. This
is why I took the approach of modelling my data in an RDBMS and then
generating my object data model automatically. At first it sounds like a
retrograde step, but the benefit is that my data model is independent of any
specific persistence framework (and the design tools are more mature).

On Thu, Oct 22, 2009 at 11:37 PM, Peter Liu  wrote:

>
> Awesome!
>
> I recently played with the lower level API as well. Some of the
> features are not available in JDO, like reserving a key before
> committing a new object. The detach/attach is also problematic when
> dealing with caching and transaction. I also noticed small JDO objects
> are much bigger than it needs to be when serialized.
>
> Just wondering do you have any performance profiling stats? I also
> feel like JDO is overkill, but I couldn't justify porting all JDO
> objects to another simple type without knowing how much cpu_ms it will
> save.
>
> Also, do you keep track of which field is dirty and avoid committing
> unmodified fields? I believe this is important to minimize api_cpu to
> avoid unnecessary index updates.
>
>
> On Oct 22, 2:37 am, Nacho Coloma  wrote:
> > Hi all,
> >
> > We have been developing a persistence framework for the AppEngine
> > Datastore based on the raw DatastoreService API. For our (simple)
> > persistence case, both JDO and JPA were a bit overkill as we were
> > spending a significant amount of time jumping through hoops to make
> > our application roll, but at the same time the Datastore API was a too
> > low-level solution to be usable.
> >
> > So we reinvented our wheel. In two days.
> >
> > SimpleDS is a light wrapper around the DatastoreService APIs that
> > provide a simple interface for java persistent classes. It does not
> > include fancy stuff or any super features, it's just the
> > DatastoreService ported to a world where Java entities can be
> > persisted directly (using a subset of JPA annotations).  This is _not_
> > a JPA/JDO replacement, and will never be. But we have been using it
> > for some weeks and are quite happy with it.
> >
> > Any kind of feedback from the AppEngine  community would be welcome.
> > Before calling the typical "but we already have JPA/JDO!" argument,
> > please notice the following:
> >
> > * There are lots of considerations in a relational database that do
> > not apply to AppEngine. This allows a specific solution to be
> > simplified big time. Just see the depth of your typical stack trace to
> > understand what I am talking about.
> > * Solutions can be designed for specific cases that are common
> > practice in AppEngine but do not apply to a relational database. See,
> > for example, saving entities with a parent instance.
> > * Transactions also behave a bit differently, where a "one size fits
> > all" approach would probably not be the best solution.
> >
> > To better ilustrate with an example, these are some typical tasks
> > performed with SimpleDS:
> >
> > Retrieve instance:
> > FooBar bar = entityManager.get(key);
> >
> > Transform from Google Datastore Entity to java and viceversa:
> > Entity entity = entityManager.datastoreToJava(bar);
> >
> > Save generating a  primary key, with a parent instance:
> > FooBar bar = new FooBar();
> > entityManager.put(parentKey, bar);
> >
> > More can be seen here:http://code.google.com/p/simpleds/wiki/SimpleTasks
> >
> > Any discussion about the current API state is welcome. This entire
> > thing was rolled in two days and tested in a couple of weeks so there
> > should be some bugs in between.
> >
> > It is important to keep in mind the current list of limitations:
> >
> > * Only the Key class is a supported primary key.
> > * IN and != are not supported (yet). I have big concerns about
> > supporting this, performance-wise.
> > * Relationships are not supported. You can use Keys and collections of
> > Keys for that purpose.
> > * Transactions are not yet included. We are not yet sure about how to
> > proceed here.
> >
> > As I said, this is not conceived to become a feature-complete JPA
> > replacement, so please don't treat it like that.
> >
> > Best regards,
> >
> > Nacho.
> >
>

--~--~-~--~~~---~--~~
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: LIKE query workaround for the Low Level API

2009-10-22 Thread Roy Smith
I think the answer is no, and the irony isn't lost.
I haven't looked into it, but depending on the length of your strings, you
might be able to store multiple substrings and build a query which applies
"like %" across all the substrings. There was an article somewhere (or was
it a Google IO talk) which talks about the features of set searches



On Thu, Oct 22, 2009 at 11:24 PM, Nicholas Albion  wrote:

>
> I don't suppose it's possible to do:
>
>myString LIKE "%,foo,%"
>
> I'm surprised that the datastore used by a search engine doesn't have
> better support for string searching/comparison...
> >
>

--~--~-~--~~~---~--~~
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] primary key portability

2009-10-22 Thread Rusty Wright

With Google App Engine you are invariably required to use the class 
com.google.appengine.api.datastore.Key for your primary key.

I would like to be able to compare the behaviour of of DataNucleus JDO between 
an RDBMS (e.g., HSQL) and Google's Big Table data store.  But I can't see any 
nice way to do this without having to have duplicate model/domain objects, as 
well as duplicate DAOs, because of the primary key difference.

Is anybody doing this, and if so, how are you handling 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: SimpleDS: an alternative for Datastore persistence

2009-10-22 Thread Rusty Wright

The name initially confused me because it made me think of

  http://www.opends.org/


Nacho Coloma wrote:
> Hi all,
> 
> We have been developing a persistence framework for the AppEngine
> Datastore based on the raw DatastoreService API. For our (simple)
> persistence case, both JDO and JPA were a bit overkill as we were
> spending a significant amount of time jumping through hoops to make
> our application roll, but at the same time the Datastore API was a too
> low-level solution to be usable.
> 
> So we reinvented our wheel. In two days.
> 
> SimpleDS is a light wrapper around the DatastoreService APIs that
> provide a simple interface for java persistent classes. It does not
> include fancy stuff or any super features, it's just the
> DatastoreService ported to a world where Java entities can be
> persisted directly (using a subset of JPA annotations).  This is _not_
> a JPA/JDO replacement, and will never be. But we have been using it
> for some weeks and are quite happy with it.
> 
> Any kind of feedback from the AppEngine  community would be welcome.
> Before calling the typical "but we already have JPA/JDO!" argument,
> please notice the following:
> 
> * There are lots of considerations in a relational database that do
> not apply to AppEngine. This allows a specific solution to be
> simplified big time. Just see the depth of your typical stack trace to
> understand what I am talking about.
> * Solutions can be designed for specific cases that are common
> practice in AppEngine but do not apply to a relational database. See,
> for example, saving entities with a parent instance.
> * Transactions also behave a bit differently, where a "one size fits
> all" approach would probably not be the best solution.
> 
> To better ilustrate with an example, these are some typical tasks
> performed with SimpleDS:
> 
> Retrieve instance:
> FooBar bar = entityManager.get(key);
> 
> Transform from Google Datastore Entity to java and viceversa:
> Entity entity = entityManager.datastoreToJava(bar);
> 
> Save generating a  primary key, with a parent instance:
> FooBar bar = new FooBar();
> entityManager.put(parentKey, bar);
> 
> More can be seen here:
> http://code.google.com/p/simpleds/wiki/SimpleTasks
> 
> Any discussion about the current API state is welcome. This entire
> thing was rolled in two days and tested in a couple of weeks so there
> should be some bugs in between.
> 
> It is important to keep in mind the current list of limitations:
> 
> * Only the Key class is a supported primary key.
> * IN and != are not supported (yet). I have big concerns about
> supporting this, performance-wise.
> * Relationships are not supported. You can use Keys and collections of
> Keys for that purpose.
> * Transactions are not yet included. We are not yet sure about how to
> proceed here.
> 
> As I said, this is not conceived to become a feature-complete JPA
> replacement, so please don't treat it like that.
> 
> Best regards,
> 
> Nacho.
> > 

--~--~-~--~~~---~--~~
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: LIKE query workaround for the Low Level API

2009-10-22 Thread Max Zhu
So far as I know, Bigtable only supports:

myString LIKE "foo,%"

On Fri, Oct 23, 2009 at 6:24 AM, Nicholas Albion  wrote:

>
> I don't suppose it's possible to do:
>
>myString LIKE "%,foo,%"
>
> I'm surprised that the datastore used by a search engine doesn't have
> better support for string searching/comparison...
> >
>

--~--~-~--~~~---~--~~
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: SimpleDS: an alternative for Datastore persistence

2009-10-22 Thread Rusty Wright

Peter, it was gratifying to hear you say "detach/attach is also problematic 
when dealing with caching and transactions" because I've been banging my head 
against the wall trying to write integration tests with GAE's datastore, using 
JDO and Spring's transactions.

I either get the "is managed by a different Object Manager" error or my objects 
don't get persisted or other errors I can't remember now.  I can't figure out 
if I'm getting bit by Spring, GAE's datastore, or JDO, and it's very 
frustrating.

What has been your experience, war stories, etc.?


Peter Liu wrote:
> Awesome!
> 
> I recently played with the lower level API as well. Some of the
> features are not available in JDO, like reserving a key before
> committing a new object. The detach/attach is also problematic when
> dealing with caching and transaction. I also noticed small JDO objects
> are much bigger than it needs to be when serialized.
> 
> Just wondering do you have any performance profiling stats? I also
> feel like JDO is overkill, but I couldn't justify porting all JDO
> objects to another simple type without knowing how much cpu_ms it will
> save.
> 
> Also, do you keep track of which field is dirty and avoid committing
> unmodified fields? I believe this is important to minimize api_cpu to
> avoid unnecessary index updates.
> 
> 
> On Oct 22, 2:37 am, Nacho Coloma  wrote:
>> Hi all,
>>
>> We have been developing a persistence framework for the AppEngine
>> Datastore based on the raw DatastoreService API. For our (simple)
>> persistence case, both JDO and JPA were a bit overkill as we were
>> spending a significant amount of time jumping through hoops to make
>> our application roll, but at the same time the Datastore API was a too
>> low-level solution to be usable.
>>
>> So we reinvented our wheel. In two days.
>>
>> SimpleDS is a light wrapper around the DatastoreService APIs that
>> provide a simple interface for java persistent classes. It does not
>> include fancy stuff or any super features, it's just the
>> DatastoreService ported to a world where Java entities can be
>> persisted directly (using a subset of JPA annotations).  This is _not_
>> a JPA/JDO replacement, and will never be. But we have been using it
>> for some weeks and are quite happy with it.
>>
>> Any kind of feedback from the AppEngine  community would be welcome.
>> Before calling the typical "but we already have JPA/JDO!" argument,
>> please notice the following:
>>
>> * There are lots of considerations in a relational database that do
>> not apply to AppEngine. This allows a specific solution to be
>> simplified big time. Just see the depth of your typical stack trace to
>> understand what I am talking about.
>> * Solutions can be designed for specific cases that are common
>> practice in AppEngine but do not apply to a relational database. See,
>> for example, saving entities with a parent instance.
>> * Transactions also behave a bit differently, where a "one size fits
>> all" approach would probably not be the best solution.
>>
>> To better ilustrate with an example, these are some typical tasks
>> performed with SimpleDS:
>>
>> Retrieve instance:
>> FooBar bar = entityManager.get(key);
>>
>> Transform from Google Datastore Entity to java and viceversa:
>> Entity entity = entityManager.datastoreToJava(bar);
>>
>> Save generating a  primary key, with a parent instance:
>> FooBar bar = new FooBar();
>> entityManager.put(parentKey, bar);
>>
>> More can be seen here:http://code.google.com/p/simpleds/wiki/SimpleTasks
>>
>> Any discussion about the current API state is welcome. This entire
>> thing was rolled in two days and tested in a couple of weeks so there
>> should be some bugs in between.
>>
>> It is important to keep in mind the current list of limitations:
>>
>> * Only the Key class is a supported primary key.
>> * IN and != are not supported (yet). I have big concerns about
>> supporting this, performance-wise.
>> * Relationships are not supported. You can use Keys and collections of
>> Keys for that purpose.
>> * Transactions are not yet included. We are not yet sure about how to
>> proceed here.
>>
>> As I said, this is not conceived to become a feature-complete JPA
>> replacement, so please don't treat it like that.
>>
>> Best regards,
>>
>> Nacho.
> > 

--~--~-~--~~~---~--~~
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 anyone provide me an example on add/remove tag to an Entity?

2009-10-22 Thread Prashant
good question ! i'm also waiting for it's answer.

--~--~-~--~~~---~--~~
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 anyone provide me an example on add/remove tag to an Entity?

2009-10-22 Thread edarroyo

Me too!

On Oct 20, 8:09 pm, Max Zhu  wrote:
> Hi Rusty,
>
> Thanks for your reply. I know that is a tag, but what I am looking for is
> how to implement using GAE.
>
> Hi Jason,
>
> I can not make my question more specific because I totally have no idea on
> it. :)
>
> Can I say we just simply put a Set to an Entity? Then how can I
> make use of it when making a global search? Shall we iterate through every
> Set? If that's the case, then what's the difference between
> Set and Set ?
>
> Regards,
> Max
>
> On Wed, Oct 21, 2009 at 1:23 AM, Jason (Google)  wrote:
> > Hi Max. This is currently the only reference available:
>
> >http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...
>
> > Do you have any specific questions around it?
>
> > - Jason
>
> > On Sat, Oct 17, 2009 at 10:02 AM, Max  wrote:
>
> >> I am not able to find a good reference on:
> >> com.google.appengine.api.datastore.Category
>
> >> Thanks
> >> Max
--~--~-~--~~~---~--~~
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 contains(Key) in JDO query

2009-10-22 Thread datanucleus

> query.setFilter("key == :keyList");
> List list = (List) query.execute(keyList);

I'd like to know if that works with GAE/J, because it is illegal JDOQL
syntax and would be a bug. JDOQL is supposed to follow Java syntax,
and you simply cannot do
Key == List
and get success in Java.
--~--~-~--~~~---~--~~
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] Base64DecoderException

2009-10-22 Thread Toru Tomita

Hi all

So I tried following junit code with SDK 1.2.6 and Java 6

--

KeyRange keyRange = DatastoreServiceFactory.getDatastoreService
().allocateIds("Account", 1);

String keyString = keyRange.getStart().toString();
System.out.println(keyString.toString());
Key key = KeyFactory.stringToKey(keyString);
System.out.println(key.toString());

--


Then I am facing following error.

--
java.lang.IllegalArgumentException: Cannot parse: Account(1)==
at com.google.appengine.api.datastore.KeyFactory.stringToKey
(KeyFactory.java:192)
at net.mapslog.gwt.server.db.dao.MarkerDaoS3ImplTest.testAddMarker
(MarkerDaoS3ImplTest.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run
(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:197)
Caused by:
com.google.appengine.repackaged.com.google.common.util.Base64DecoderException:
Bad Base64 input character at 7: 40(decimal)
at
com.google.appengine.repackaged.com.google.common.util.Base64.decode
(Base64.java:550)
at
com.google.appengine.repackaged.com.google.common.util.Base64.decodeWebSafe
(Base64.java:493)
at com.google.appengine.api.datastore.KeyFactory.stringToKey
(KeyFactory.java:190)
... 21 more

--

Kind regards

Toru Tomita

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---