Hi,

I am trying to programmatically delete a large set of entities from
the datastore based on the value of one of the properties of the
entity, namely, "asOfDate".

The Java method that I am using to perform this operation is shown at
the end of this message.
I have another method that is very similar that tells me the count of
the entities for the given parameter.

The date parameter that I am using is Mar 01, 2010. There are 12032
entities whose "asOfDate" property is less than this value. When I
invoke the deleteUsageDates method below, the server tries for a while
and ultimately gives a 500 error with the following message:
"A serious problem was encountered with the process that handled this
request, causing it to exit. This is likely to cause a new process to
be used for the next request to your application. If you see this
message frequently, you may be throwing exceptions during the
initialization of your application. (Error code 104)"

Any idea what I am doing wrong?
Thanks,
Viji


        public static boolean deleteUsageDates (Date endDate)
        {
                SimpleDateFormat dateFormat = new SimpleDateFormat 
("yyyy-MM-dd");
                String endDateStr = dateFormat.format (endDate);

                PersistenceManagerFactory factory = 
JdoPersistenceManagerFactory.get
();
                PersistenceManager manager = factory.getPersistenceManager ();
                try
                {
                        Query query = manager.newQuery (UsageHistory.class);
                        query.setFilter ("asOfDate < endDateParam");
                        query.declareImports ("import java.util.Date");
                        query.declareParameters ("Date endDateParam");
                        query.deletePersistentAll (endDate);
                        return true;
                }
                catch (Exception ex)
                {
                        logger.severe (String.format ("Exception while deleting 
usage
histories before %s; Exception message = %s", endDateStr,
ex.getMessage ()));
                }
                return false;
        }

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

Reply via email to