Datastore Blob fields are limited to approximately 1M each: http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Blob.html
If you need to store data larger than 1M, you'll need to use the new Blobstore API: http://code.google.com/appengine/docs/java/blobstore/ You then store a BlobKey to a larger block of data in your CacheEntity. On Mon, Dec 28, 2009 at 8:04 AM, Miroslav Genov <[email protected]>wrote: > Hello, > Does anyone knows why I'm getting the following exception when Blob > field is used ? > > The documentation doesn't mention any limits for that data type. > > java.lang.IllegalArgumentException: string property content is too > long. It cannot exceed 1000000 characters. > at > > com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:33) > at > > com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:60) > at > > com.google.appengine.api.datastore.DatastoreServiceImpl$2.run(DatastoreServiceImpl.java:173) > at > > com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java:30) > at > > com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:161) > at > > com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:141) > at > > com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:133) > at > > org.datanucleus.store.appengine.RuntimeExceptionWrappingDatastoreService.put(RuntimeExceptionWrappingDatastoreService.java:93) > at > > org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:165) > at > > org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:124) > at > > org.datanucleus.store.appengine.DatastorePersistenceHandler.put(DatastorePersistenceHandler.java:119) > at > > org.datanucleus.store.appengine.DatastorePersistenceHandler.updateObject(DatastorePersistenceHandler.java:492) > at > > org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4576) > at > > org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2814) > at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:2754) > at > org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:2893) > at > org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:369) > at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:256) > at org.datanucleus.ObjectManagerImpl.close(ObjectManagerImpl.java:801) > > > Here is the definition of my entity object: > > @PersistenceCapable(identityType = IdentityType.APPLICATION, > detachable="true") > public class CacheEntity { > > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > private Key key; > > @Persistent > private Blob content; > > public Key getKey() { > return key; > } > > public void setKey(Key key) { > this.key = key; > } > > public Blob getContent() { > return content; > } > > public void setContent(Blob content) { > this.content = content; > } > } > > Regards, > Miroslav > > -- > > 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 > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
