[appengine-java] After upgrade to Java SDK 1.2.5 Key property saved but retrieved as null

2009-09-04 Thread Yegor

Hi,

I am experiencing a problem after upgrading to Java SDK 1.2.5. In a
simple CMS application a page is stored as a CMSPage entity, which
points to its text saved as a DetachedText entity using a Key property
(i.e. an unowned relationship) as follows:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class CMSPage {

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key id;

  @Persistent
  private Key text;

  public Key getId() {
return id;
  }

  public void setId(Key id) {
this.id = id;
  }

  public Key getText() {
return text;
  }

  public void setText(Key text) {
this.text = text;
  }

}

The Key property text points to:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DetachedText {

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key id;

  @Persistent
  private Text content;

  public DetachedText(Text content) {
this.content = content;
  }

  public Key getId() {
return id;
  }

  public Text getContent() {
return content;
  }

}

NOTE: I have removed other properties and code that I found unrelated
to the problem

After saving the page I can see the text field populated in the
development console. The value shows as DetachedText(5). I also
verified that the DetachedText entity exists and its ID equals 5.

However, after I retrieve CMSPage from the datastore using a
javax.jdo.Query the text field in the retrieved object is null (both
the Eclipse debugger and the application throwing NPE confirm it).

What am I doing wrong?

Any pointers will be appreciated.

Thanks,

Yegor
--~--~-~--~~~---~--~~
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: new stack traces after upgrading to SDK 1.2.5

2009-09-04 Thread Yegor

Vince,

If you are interested the reason for the exception is that App Engine
does not support threads. Reference finalizer usually runs as a
separate thread. In this case the finalizer (correctly) failed to
initialize. However, it looks like finalizer is not a critical
component in this context.

Guice prints a similar stacktrace for its reference finalizer too,
also as INFO.

Cheers,

Yegor


On Sep 4, 1:41 pm, Vince Bonfanti vbonfa...@gmail.com wrote:
 After upgrading to SDK 1.2.5, I've noticed a set of stack traces that
 show up in both the development environment and on the production
 server. These only appear if the logging level is set to INFO, and
 they show up as INFO logs on the production server. I'm pretty sure
 these are new in SDK 1.2.5 since I've been running at the INFO logging
 level for quite some time. They only happen for the first request
 after the application has been restarted. From my production server:

 com.google.appengine.repackaged.com.google.common.base.FinalizableReference 
 Queue$SystemLoader
 loadFinalizer: Not allowed to access system class loader.

 com.google.appengine.repackaged.com.google.common.base.internal.Finalizer
 getInheritableThreadLocalsField: Couldn't access
 Thread.inheritableThreadLocals. Reference finalizer threads will
 inherit thread local values.

 com.google.appengine.repackaged.com.google.common.base.FinalizableReference 
 Queue
 init: Failed to start reference finalizer thread. Reference cleanup
 will only occur when new references are created.
 java.lang.reflect.InvocationTargetException
         at 
 com.google.appengine.runtime.Request.process-ad303eae7c610e90(Request.java)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Method.java:40)
         at 
 com.google.appengine.repackaged.com.google.common.base.FinalizableReference 
 Queue.init(FinalizableReferenceQueue.java:124)
         at 
 com.google.appengine.repackaged.com.google.common.labs.misc.InterningPools$ 
 WeakInterningPool.clinit(InterningPools.java:104)
         at 
 com.google.appengine.repackaged.com.google.common.labs.misc.InterningPools. 
 newWeakInterningPool(InterningPools.java:48)
         at 
 com.google.appengine.repackaged.com.google.io.protocol.ProtocolSupport.cli 
 nit(ProtocolSupport.java:55)
         at 
 com.google.apphosting.api.DatastorePb$Query.init(DatastorePb.java:1072)
         at 
 com.google.apphosting.api.DatastorePb$Query$1.init(DatastorePb.java:2355)
         at 
 com.google.apphosting.api.DatastorePb$Query.clinit(DatastorePb.java:2355)
         at 
 com.google.appengine.api.datastore.QueryTranslator.convertToPb(QueryTransla 
 tor.java:27)
         at 
 com.google.appengine.api.datastore.DatastoreServiceImpl$PreparedQueryImpl.c 
 onvertToPb(DatastoreServiceImpl.java:357)
         at 
 com.google.appengine.api.datastore.DatastoreServiceImpl$PreparedQueryImpl.r 
 unQuery(DatastoreServiceImpl.java:339)
         at 
 com.google.appengine.api.datastore.DatastoreServiceImpl$PreparedQueryImpl.a 
 ccess$100(DatastoreServiceImpl.java:269)
         at 
 com.google.appengine.api.datastore.DatastoreServiceImpl$PreparedQueryImpl$1 
 .iterator(DatastoreServiceImpl.java:303)
         at 
 org.apache.jsp.test.listEntities_jsp._jspService(listEntities_jsp.java:49)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
         at 
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
 ...truncated
--~--~-~--~~~---~--~~
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: After upgrade to Java SDK 1.2.5 Key property saved but retrieved as null

2009-09-04 Thread Yegor

Just so you know, I think I have solved the problem by setting
defaultFetchGroup=true on the Key property:

@Persistent(defaultFetchGroup=true)
private Key text;

Might have something to do with the recently closed issue #58 Queries
don't respect fetch groups: 
http://code.google.com/p/datanucleus-appengine/issues/detail?id=58

What's puzzling is that I have unowned relationships all over the
application, however only one class - CMSPage - fails to retrieve the
Key properties.

I am not sure why Key is not automatically in the default fetch group.
Key is not an entity class. It should be ok to fetch it non-lazily by
default.

Yegor

On Sep 4, 1:21 pm, Yegor yegor.jba...@gmail.com wrote:
 Hi,

 I am experiencing a problem after upgrading to Java SDK 1.2.5. In a
 simple CMS application a page is stored as a CMSPage entity, which
 points to its text saved as a DetachedText entity using a Key property
 (i.e. an unowned relationship) as follows:

 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class CMSPage {

   @PrimaryKey
   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
   private Key id;

   @Persistent
   private Key text;

   public Key getId() {
     return id;
   }

   public void setId(Key id) {
     this.id = id;
   }

   public Key getText() {
     return text;
   }

   public void setText(Key text) {
     this.text = text;
   }

 }

 The Key property text points to:

 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class DetachedText {

   @PrimaryKey
   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
   private Key id;

   @Persistent
   private Text content;

   public DetachedText(Text content) {
     this.content = content;
   }

   public Key getId() {
     return id;
   }

   public Text getContent() {
     return content;
   }

 }

 NOTE: I have removed other properties and code that I found unrelated
 to the problem

 After saving the page I can see the text field populated in the
 development console. The value shows as DetachedText(5). I also
 verified that the DetachedText entity exists and its ID equals 5.

 However, after I retrieve CMSPage from the datastore using a
 javax.jdo.Query the text field in the retrieved object is null (both
 the Eclipse debugger and the application throwing NPE confirm it).

 What am I doing wrong?

 Any pointers will be appreciated.

 Thanks,

 Yegor
--~--~-~--~~~---~--~~
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: After upgrade to Java SDK 1.2.5 Key property saved but retrieved as null

2009-09-06 Thread Yegor

I think it makes sense now. I did see more exceptions related to
incorrect transaction handling (e.g. updating multiple entities from
different entity groups) that didn't happen prior to 1.2.5. It seems
that it was the upgrade to datanucleus 1.1.5 that triggered these
exceptions. I am not suggesting that 1.1.5 introduced bugs (but
neither denying it). I think it was my code that relied on a previous
bug that got fixed in 1.1.5. Actually I do not require transactions at
this point at all and in the future expect them to be an exception
rather than the norm, so I disabled them and the application is now
running as expected.

Thanks,

Yegor

On Sep 6, 11:08 am, Max Ross maxr+appeng...@google.com wrote:
 It shouldn't be inconsistent.  The field will only be unavailable outside
 the transaction if it was not accessed inside the transaction, so that might
 explain why it only happens in certain places.



 On Sat, Sep 5, 2009 at 11:55 PM, bgood ben.mcgee.g...@gmail.com wrote:

  OK, but why would this behavior be happening inconsistently across his
  (and probably others) application?

  On Sep 5, 7:06 pm, Max Ross 
  maxr+appeng...@google.commaxr%2bappeng...@google.com
  wrote:
   Key is not in the default fetch group because it is an appengine-specific
   class.  The JDO spec doesn't know anything about app engine so there's no
   way that Key could be included in the list of types that are
  automatically
   included in the default fetch group.

   Max

   On Fri, Sep 4, 2009 at 1:32 PM, Yegor yegor.jba...@gmail.com wrote:

Just so you know, I think I have solved the problem by setting
defaultFetchGroup=true on the Key property:

@Persistent(defaultFetchGroup=true)
private Key text;

Might have something to do with the recently closed issue #58 Queries
don't respect fetch groups:
   http://code.google.com/p/datanucleus-appengine/issues/detail?id=58

What's puzzling is that I have unowned relationships all over the
application, however only one class - CMSPage - fails to retrieve the
Key properties.

I am not sure why Key is not automatically in the default fetch group.
Key is not an entity class. It should be ok to fetch it non-lazily by
default.

Yegor

On Sep 4, 1:21 pm, Yegor yegor.jba...@gmail.com wrote:
 Hi,

 I am experiencing a problem after upgrading to Java SDK 1.2.5. In a
 simple CMS application a page is stored as a CMSPage entity, which
 points to its text saved as a DetachedText entity using a Key
  property
 (i.e. an unowned relationship) as follows:

 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class CMSPage {

   @PrimaryKey
   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
   private Key id;

   @Persistent
   private Key text;

   public Key getId() {
     return id;
   }

   public void setId(Key id) {
     this.id = id;
   }

   public Key getText() {
     return text;
   }

   public void setText(Key text) {
     this.text = text;
   }

 }

 The Key property text points to:

 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class DetachedText {

   @PrimaryKey
   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
   private Key id;

   @Persistent
   private Text content;

   public DetachedText(Text content) {
     this.content = content;
   }

   public Key getId() {
     return id;
   }

   public Text getContent() {
     return content;
   }

 }

 NOTE: I have removed other properties and code that I found unrelated
 to the problem

 After saving the page I can see the text field populated in the
 development console. The value shows as DetachedText(5). I also
 verified that the DetachedText entity exists and its ID equals 5.

 However, after I retrieve CMSPage from the datastore using a
 javax.jdo.Query the text field in the retrieved object is null
  (both
 the Eclipse debugger and the application throwing NPE confirm it).

 What am I doing wrong?

 Any pointers will be appreciated.

 Thanks,

 Yegor
--~--~-~--~~~---~--~~
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: JPA and Scala

2009-10-20 Thread Yegor

Hi, Chris,

Scala is quite interoperable with Java. Wouldn't it make sense to
write data objects in Java and use them from Scala? Or maybe wrap them
into Scala classes to take advantage of Scala facilities? It is, of
course, more work, but it will keep your design clean and should avoid
any Datastore/Datanucleus complications. After all, you data object
definitions are probably a tiny fraction of the rest of the
application.

Yegor

On Oct 13, 11:02 pm, chrislewis burningodzi...@gmail.com wrote:
 Hi all,

 I've spent hours wrestling with getting some form of a working dev
 environment for a Scala (Lift) app on app engine. Getting scala going
 is cake, lift not much harder. The pain point is using the datastore.
 Given the choice between JDO and JPA, I'm choosing JPA. After spending
 hours getting a frankenbuild working, I'm now at issues with the
 datastore that have me stumped. Using the following class,
 successfully built and enhanced, appengine (under eclipse) throws the
 following error when I try to merge() an entity:

 javax.jdo.JDOFatalInternalException: It's illegal to call
 jdoCopyKeyFieldsToObjectId for a class with SingleFieldIdentity.

 The class:

 import javax.persistence._

 @Entity
 class Author {

   @Id
   @GeneratedValue{ val strategy = GenerationType.IDENTITY }
   var id: java.lang.Long = _

   var name: String = _

 }

 Can anyone shed some light on this? 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] How to define parent persistent class without identity field

2009-12-12 Thread Yegor
Hi,

Glad to see some reasonable inheritance support in Datastore. However,
I'm a little puzzled. I am trying to setup a simple persistent class
hierarchy, in which the base class defines some standard audit fields
shared by all concrete persistent classes:

public abstract class AbstractEntity implements StoreCallback {

  @Persistent
  private Date created;

  @Persistent
  private Date modified;

  public final Date getCreated() {
return created;
  }

  public final Date getModified() {
return modified;
  }

  @Override
  public void jdoPreStore() {
if (this.created == null) {
  this.created = new Date();
}
this.modified = new Date();
  }

}

The plan was then to have concrete classes extend from this abstract
class and provide the identity field as well as other functional
fields, e.g.:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Account extends AbstractEntity {

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key accountId;

  ...

}

What JDO annotations would you suggest putting on the AbstractEntity
class to make it work? Everything I tried ends up with either class
not enhanced at runtime or complains about the lack of identity field
on the abstract class. Well, duh! to the latter error message I'd
say.

Any suggestions are welcome.

Thanks,

Yegor

--

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-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: How to define parent persistent class without identity field

2009-12-13 Thread Yegor
Thanks for your reply. I guess that's what I will do in my next app.
However, in the existing app the identity fields are already defined
in the subclasses, and they have different names too, e.g. Account
would have accountId, Customer would have customerId, so I cannot move
the ID field to the root of the hierarchy as it will not map to the
existing data in the App Engine Datastore.

This seems very strange. Ability to move common fields into a shared
class seems like a very natural thing to do. I am surprised that it is
not supported by Datanucleus.

That said, I haven't lost all hope. Maybe composition instead of
inheritance can help. I am going to check if I can use embedded
classes to solve this problem.

Yegor

On Dec 13, 1:54 am, datanucleus andy_jeffer...@yahoo.com wrote:
 With all persistence standards, the identity field(s)/property(s) have
 to be in the base persistent class.

--

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-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.




[appengine-java] Re: How to define parent persistent class without identity field

2009-12-17 Thread Yegor
Thanks, Rusty, for your insight.

I think this will technically work, but I will have to kiss goodbye to
database look-ups by key, which is a big loss. Key look-up is
lightning fast compared to querying by index. If I separate accountId
from id, then I'll have to GQL something like select from Account
where accountId=? as opposed to pm.getObjectById(accountId).

I'm still hopeful about the composition approach. I just started
coding. Let's see how it goes.

Thanks,

Yegor

On Dec 13, 2:51 pm, Rusty Wright rwright.li...@gmail.com wrote:
 Another way you could look at is that by using things like customerId and 
 accountId as your database primary keys you're mixing your business stuff 
 with the database persistence stuff.  If you create a primary key in the base 
 class and call it something like id, you can still have the accountId and 
 customerId in the subclasses.  But ignore that database primary key (id) in 
 your business logic and only use it for database things.  You still have and 
 can still use customerId and accountId in queries.  Think of the database 
 primary key, id, as just some book keeping stuff, an implementation detail, 
 for the orm (datanucleus).Yegor wrote:
  Thanks for your reply. I guess that's what I will do in my next app.
  However, in the existing app the identity fields are already defined
  in the subclasses, and they have different names too, e.g. Account
  would have accountId, Customer would have customerId, so I cannot move
  the ID field to the root of the hierarchy as it will not map to the
  existing data in the App Engine Datastore.

  This seems very strange. Ability to move common fields into a shared
  class seems like a very natural thing to do. I am surprised that it is
  not supported by Datanucleus.

  That said, I haven't lost all hope. Maybe composition instead of
  inheritance can help. I am going to check if I can use embedded
  classes to solve this problem.

  Yegor

  On Dec 13, 1:54 am, datanucleus andy_jeffer...@yahoo.com wrote:
  With all persistence standards, the identity field(s)/property(s) have
  to be in the base persistent class.

  --

  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-j...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-appengine-java?hl=en.

--

You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@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] App Engine down?

2010-07-22 Thread Yegor
My GAE apps (Java) and the app engine dashboard produce intermittent
Server 500 errors with a generic message:


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.


Because the dashboard is down too I can't even see the error logs.

The system status doesn't show any problems except for some Python
anomaly. I am on Java.

Yegor

-- 
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-j...@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: App Engine down?

2010-07-22 Thread Yegor
Yep, it seems to be back to normal. Thanks.

On Jul 22, 12:21 pm, Don Schwarz schwa...@google.com wrote:
 It should be okay now.  There was a brief outage that affected some
 percentage of both Java and Python applications.  The Java application that
 we test to create that dashboard was apparently lucky.



 On Thu, Jul 22, 2010 at 1:14 PM, Yegor yegor.jba...@gmail.com wrote:
  My GAE apps (Java) and the app engine dashboard produce intermittent
  Server 500 errors with a generic message:

  
  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.
  

  Because the dashboard is down too I can't even see the error logs.

  The system status doesn't show any problems except for some Python
  anomaly. I am on Java.

  Yegor

  --
  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-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2B 
  unsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@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] Google Plugin for Eclipse 3.6: Unable to connect to repository

2010-09-08 Thread Yegor
Just tried to upgrade to SDK 1.3.7 from Eclipse 3.6, but got this
error in a dialog:

[QUOTE]
Unable to connect to repository 
http://dl.google.com/eclipse/plugin/3.6/content.xml
Unable to connect to repository 
http://dl.google.com/eclipse/plugin/3.6/content.xml
Connection refused: connect
[END QUOTE]

Following http://dl.google.com/eclipse/plugin/3.6/content.xml in a web
browser results in a 404 page not found. I guess I'll have to download
the SDK outside of Eclipse.

What's up?

Thanks,

Yegor

-- 
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-j...@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: 1.3.8 upgrade delete datastore contents

2010-10-20 Thread Yegor
Actually, I have seen this behaviour in several recent releases of the
SDK. At this point, every time I upgrade, I kinda half-expect that my
test data will be gone. It would be nice if local data persisted
between releases.

On Oct 19, 12:20 pm, Ikai Lan (Google) ikai.l+gro...@google.com
wrote:
 This is a known issue with the 1.3.8 release. We're looking into it.

 --
 Ikai Lan
 Developer Programs Engineer, Google App Engine
 Blogger:http://googleappengine.blogspot.com
 Reddit:http://www.reddit.com/r/appengine
 Twitter:http://twitter.com/app_engine

 On Mon, Oct 18, 2010 at 11:06 AM, Christian Goudreau 







 goudreau.christ...@gmail.com wrote:
  Same here and that's kinda problematic, I had a lot of test data and it
  would take days to reinitialize everything...  I guess I'll have no other
  choice but to come back to AppEngine 1.3.7 since the datastore.bin doesn't
  seem to be affected.

  Cheers,

  On Mon, Oct 18, 2010 at 2:29 AM, Vlad Skarzhevskyy skarzhevs...@gmail.com
   wrote:

  My data also disappeared in development environment with the same
  error.

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

  --
  Christian Goudreau
 www.arcbees.com

   --
  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-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2B 
  unsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@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: passing multiple parameters to JDOQL

2010-12-30 Thread Yegor
   query.declareParameters(Long bind_pocId, Date bind_startDate, Date
 bind_endDate);

This is correct. However, I personally prefer the shorter form, where
instead of using filter column == alias along with
query.declareParameters(Type alias) you just use filter column
== :alias (note the colon before the alias name). Your query can be
rewritten as follows:

Query query = pm.newQuery(PocVacationSchedule.class);
query.setFilter(pocId == :pi  startDate == :sd  endDate == :ed);
ListPocVacationSchedule rulesList = (ListPocVacationSchedule)
query.execute(pocId, startFrom, endFrom);

-- 
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-j...@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: Concurrency issue when dealing with datastore

2010-12-30 Thread Yegor
 I had to strongly synchronize my app using Java options (locka,
 synchrnized objects, and so on...).

I have to warn you that all this synchronization will be in vain once
your application grows beyond 1 JVM. Java keyword synchronized is
only effective within a single instance of JVM. That is not to say
that even with 1 JVM your application may lose a lot of performance if
you are synchronizing on static methods or singleton objects, e.g. the
datastore.

 I think it is quite unbelievable that a huge giant like BigTable is so
 weak in concurrency issues...

BigTable gives you a lot of well-documented options to deal with
simultaneous access to data. A good place to start is
http://code.google.com/appengine/docs/java/datastore/transactions.html.
In your case, unless you really have to transact on all entities
processed by the servlet, I would recommend that you break your task
into several sub-tasks each limited to a single entity group.

 Perhaps my approach is geared from my experience in relational DBs,
 but I'm quite puzzeld...

Sounds like that might be the case. When working with BigTable, always
keep in mind that two entities (called table rows in RDBMS) do not
necessarily end up on the same server node. This is good, because it
allows BigTable to distribute the load across multiple hard drives.
However, when this happens you no longer are able to transact on these
entities. Entity groups tell BigTable that two or more related
entities must be stored in the database in such a way that a
transaction is possible. Unfortunately, you immediately lose
scalability within the entity group (thus the recommendation to keep
them small). Relational DBs always make that sacrifice by default and
put all table rows on the same hard drive. This makes it easy to
transact on arbitrary entities. However, you have to partition your
database manually to scale. Plus, you cannot transact across
partitions, so even with a RDBMS you still have the same limitation.

-- 
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-j...@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: Lightweight Best performing MVC framework - Recommendation

2010-12-30 Thread Yegor
http://code.google.com/p/litemvc/

Before you read on, a disclaimer: I am biased as I am one of the
commiters to this project

- I have used litemvc with a fairly complex appengine application
- Really easy to integrate with Guice and Freemarker
- Follows Guice configuration philosophy, namely:
  * No XML
  * Java-based configuration, e.g.: map(/,
IndexHandler.class).templateResult(OK, /index.jsp);
- Follows convention-over-configuration for handlers:
  * Handlers are POJOs
  * No interfaces and no annotations
  * Handler method names == HTTP method names, e.g. get(), post()
  * URL regex groups are mapped to method parameters, e.g. map(/user/
(\\d+), ...) will pass group(1) to get(String userId)
  * Automatic injection of standard method parameters, such as
HttpServetRequest and HttpServletResponse

Cheers,

Yegor

-- 
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-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Task Queue timing out in 30 sec instead of the promised 10 min on GAE/J SDK 1.4

2011-02-09 Thread Yegor
According to 
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Task_Execution
 a 
single task has up to 10 minutes to execute. However, while testing my app 
in slow mode I discovered that the GAE/J SDK consistently times out queue 
tasks in 30 seconds (I'm on version 1.4.0). That is, of course, if the task 
need more than 30 seconds. Anything below that works fine. Scroll down for a 
stack trace.

Is this a bug in SDK or do I have to configure something in queue.xml to 
increase the timeout limit? I couldn't find anything in the docs here: 
http://code.google.com/appengine/docs/java/config/queue.html

I do not expect my tasks to exceed 30 seconds, but there might be 
exceptions, especially because some tasks make heavy use of URLFetch. I 
decided to check here before submitting a bug report in case I'm being 
stupid.

Thanks,

Yegor

==
[ERROR] Job default.task3 threw an unhandled Exception: 
com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 
5: http method POST against URL http://0.0.0.0:/deferredTaskService 
timed out.
at 
com.google.appengine.api.urlfetch.dev.LocalURLFetchService.fetch(LocalURLFetchService.java:236)
at 
com.google.appengine.api.taskqueue.dev.LocalTaskQueue$UrlFetchServiceLocalTaskQueueCallback.execute(LocalTaskQueue.java:471)
at 
com.google.appengine.api.taskqueue.dev.UrlFetchJob.execute(UrlFetchJob.java:77)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
[ERROR] Job (default.task3 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested 
exception: com.google.apphosting.api.ApiProxy$ApplicationException: 
ApplicationError: 5: http method POST against URL 
http://0.0.0.0:/deferredTaskService timed out.]
at org.quartz.core.JobRunShell.run(JobRunShell.java:214)
at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
* Nested Exception (Underlying Cause) ---
com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 
5: http method POST against URL http://0.0.0.0:/deferredTaskService 
timed out.
at 
com.google.appengine.api.urlfetch.dev.LocalURLFetchService.fetch(LocalURLFetchService.java:236)
at 
com.google.appengine.api.taskqueue.dev.LocalTaskQueue$UrlFetchServiceLocalTaskQueueCallback.execute(LocalTaskQueue.java:471)
at 
com.google.appengine.api.taskqueue.dev.UrlFetchJob.execute(UrlFetchJob.java:77)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
==

-- 
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: Tiles. Struts. No errors, no exceptions.

2011-02-09 Thread Yegor
Do you mean that all pages work, except one? Or not even one works? I am 
asking because if it the former, then the problem is page-specific. If it's 
the latter, then something's wrong with your application config.

-- 
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: Ability to send mail using appspotmail.com

2011-02-09 Thread Yegor
You probably already know this, but just in case you don't, appid has to 
be replaced with your app's real application id, as defined in your 
appengine-web.xml (for Java) or app.yaml (for Python).

If you knew this already and you still cannot send emails, then you might 
have found a bug in app-engine. Alternatively, your from address might be 
blocked by a spam filter.

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



[appengine-java] Re: Cron job limit 30 sec or 10 minutes?

2011-02-13 Thread Yegor
I was wondering about the same question for task queues (http://
groups.google.com/group/google-appengine-java/browse_thread/thread/
18ee8bfbbfd309fd), but nobody answered. I filed a bug report (http://
code.google.com/p/googleappengine/issues/detail?id=4564) and mentioned
cron in it. You might want to star the issue to get more attention
from the GAE team.

Cheers,

Yegor

On Feb 11, 4:12 am, pac parvez.chau...@gmail.com wrote:
   It says here
  http://code.google.com/appengine/docs/java/config/cron.html

   A cron job will invoke a URL, using an HTTP GET request, at a given time
 of day. A URL invoked by cron is subject to the same limits and quotas as a
 normal HTTP request, including the request time limit.

   But here it says
  http://googleappengine.blogspot.com/2010/12/happy-holidays-from-app-e...%20%20It%20says%20here%20%20%20http://code.google.com/appengine/docs/java/config/cron.html%20%20%20%

   No more 30-second limit for background work - With this release, we’ve
 significantly raised this limit for offline requests from Task Queue and *
 Cron*: you can now run for up to 10 minutes without interruption.

 Clarification/confirmation will be helpful.
 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: raise limits for applications

2011-03-24 Thread Yegor
Hi, Ikai,

Interactions between GAE apps and Blobstore are billed for storage +
CPU. Google Storage is billed for storage + network + request count.

How do the two compare in a real-world scenario from price/performance
standpoint? It seems that Blobstore, being a core part of GAE, is
regarded as local to your application, while Google Storage will be
external and is therefore no different from Amazon S3 or Rackspace
CloudFiles.

There are also these URL Fetch 1mb-out/32mb-in limits, which seem to
apply to everything. It's like we have a Titan 4 class rocket but
we're only allowed to use a car engine to fly it.

Cheers,

Yegor

On Mar 23, 6:32 pm, Ikai Lan (Google) ika...@google.com wrote:
 You should explore:

 - Blobstore:http://code.google.com/appengine/docs/java/blobstore/overview.html
 - Google storage:http://code.google.com/apis/storage/

 There are other options for application distribution.

 Ikai Lan
 Developer Programs Engineer, Google App Engine
 Blog:http://googleappengine.blogspot.com
 Twitter:http://twitter.com/app_engine
 Reddit:http://www.reddit.com/r/appengine







 On Tue, Mar 22, 2011 at 7:17 AM, Perun Katana gabec@yahoo.com wrote:
  Hi all,

  I was thinking if there could be a way to raise the limits for
  applications. My contecern is, that I have a JNLP application with a nice
  bunch of libraries included (e.g. jasper reports, etc), which takes the
  application nicely over 10 MB. The application is built as a Netbeans RPC
  application, so there is a jnlp-servlet for downloading all necessary files.
  Unfortunatelly, such applications are rarely under 10 MB.

  The jnlp-servlet itself does not consume much memory (as far I know), so
  this is not a problem, To download all libraries may take a little
  processing time, traffic and request time (well, even for slow trafic I hope
  each library is downloaded in 30s), but that's why there is billing quota
  for I am willing to pay. I'd see the google apps as a nice platform to
  deploy web start applications too, but for bigger application there would be
  nice to raise request handler quotas too, even if it would be a payed
  service. I don't think a need a separate VPS instance running 24x7 just to
  download a jnlp application.

  The question is, if there is another solution or I'll have to work on
  getting the static libraries deployed somewhere else (not a bad ide too).

  Regards
           Perun

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

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



[appengine-java] Re: Blobstore vs. Datastore for HTML files

2011-05-06 Thread Yegor
Brandon,

Have you considered storing HTML in compressed form as Datastore
blobs? Being plain text HTML should have very high compression ratio.

* java.util.zip.GZIPOutputStream is usually no worse than x5, but it
is slower
* com.ning.compress.lzf.LZFOutputStream should yield x3 compression,
but it is faster than GZIP

Cheers,

Yegor

On May 5, 8:14 pm, Brandon Donnelson branflake2...@gmail.com wrote:
 Entity limit is 1MB total. But you could have multiple blobs within one if
 they where less than 1MB.

 Brandon

-- 
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: Cannot upgrade to app engine SDK 1.6.0 on STS 2.8.1

2011-11-28 Thread Yegor
Sounds like you are running an old version of JRE/JDK.

On Nov 28, 3:46 pm, AnthoniS anthoni.schioc...@eliium.com wrote:
 After upgrading STS to 2.8.1 (based on Eclipse 3.7.1) running on
 MacOSX 10.5.8, i am unable to update the AppEngine SDK to 1.6.0. Here
 is the error log:
 java.lang.UnsupportedClassVersionError: Bad version number in .class
 file
         at java.lang.ClassLoader.defineClass2(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:775)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
 160)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:254)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
         at java.lang.Class.getConstructor0(Class.java:2671)
         at java.lang.Class.newInstance0(Class.java:321)
         at java.lang.Class.newInstance(Class.java:303)
         at
 com.google.appengine.eclipse.core.sdk.AppEngineBridgeFactory.createBridge(A 
 ppEngineBridgeFactory.java:
 184)
         at
 com.google.appengine.eclipse.core.sdk.AppEngineBridgeFactory.createBridge(A 
 ppEngineBridgeFactory.java:
 122)
         at
 com.google.appengine.eclipse.core.sdk.AppEngineBridgeFactory.getAppEngineBr 
 idge(AppEngineBridgeFactory.java:
 95)
         at
 com.google.appengine.eclipse.core.sdk.GaeSdk.getAppEngineBridge(GaeSdk.java :
 265)
         at com.google.appengine.eclipse.core.sdk.GaeSdk.validate(GaeSdk.java:
 379)
         at com.google.gdt.eclipse.core.ui.SdkTable
 $1.selectionChanged(SdkTable.java:185)
         at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:164)
         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
         at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
         at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
         at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:
 162)
         at
 org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer 
 .java:
 2188)
         at
 org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.ja 
 va:
 1211)
         at
 org.eclipse.jface.viewers.CheckboxTableViewer.handleSelect(CheckboxTableVie 
 wer.java:
 310)
         at org.eclipse.jface.viewers.StructuredViewer
 $4.widgetSelected(StructuredViewer.java:1241)
         at
 org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:
 239)
         at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:
 233)
         at org.eclipse.jface.util.OpenStrategy
 $1.handleEvent(OpenStrategy.java:403)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1669)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1693)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1678)
         at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1421)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
 3738)
         at org.eclipse.swt.widgets.Control.sendTrackEvents(Control.java:3235)
         at org.eclipse.swt.widgets.Control.kEventControlTrack(Control.java:
 2262)
         at org.eclipse.swt.widgets.Widget.controlProc(Widget.java:381)
         at org.eclipse.swt.widgets.Display.controlProc(Display.java:916)
         at org.eclipse.swt.internal.carbon.OS.CallNextEventHandler(Native
 Method)
         at org.eclipse.swt.widgets.Table.kEventMouseDown(Table.java:2325)
         at org.eclipse.swt.widgets.Widget.mouseProc(Widget.java:1387)
         at org.eclipse.swt.widgets.Display.mouseProc(Display.java:3166)
         at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native
 Method)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3289)
         at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
         at org.eclipse.jface.window.Window.open(Window.java:801)
         at
 org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPre 
 ferenceDialog.java:
 215)
         at
 org.eclipse.ui.internal.handlers.ShowPreferencePageHandler.execute(ShowPref 
 erencePageHandler.java:
 54)
         at
 org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:
 293)
         at org.eclipse.core.commands.Command.executeWithChecks(Command.java:
 476)
         at