Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
No way to delete error data entry
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Charlie Zhu  
View profile  
 More options Jun 17, 4:15 am
From: Charlie Zhu <zh.char...@gmail.com>
Date: Wed, 17 Jun 2009 01:15:17 -0700 (PDT)
Local: Wed, Jun 17 2009 4:15 am
Subject: No way to delete error data entry
Hi,

I have tried all ways I known to delete some schema changing caused
error Entities and failed.

1. Delete on Data Viewer on the console.
Data Viewer shows "No Data Yet."

2. Delete by code
Below is part of the codes:
        Query q = pm.newQuery(CDKFingerprint.class);
        List<CDKFingerprint> results2;
        results2 = (List<CDKFingerprint>) q.execute();
        pm.deletePersistentAll(results2);
But that cause server error:
java.lang.NullPointerException: Datastore entity with kind
CDKFingerprint and key CDKMol(c=cc=cc=c)/CDKFingerprint(1) has a null
property named bits_count.  This property is mapped to
cdkhelper.CDKFingerprint.bits_count, which cannot accept null values.
...
at org.datanucleus.jdo.JDOPersistenceManager.deletePersistentAll
(JDOPersistenceManager.java:795)
...

3. Assign values to the NULL field then delete
The code
        for(CDKFingerprint r: results2) {
                r.bits_count = 0;
                pm.makePersistent(r);
        }
And server error again
java.lang.NullPointerException: Datastore entity with kind
CDKFingerprint and key CDKMol(c=cc=cc=c)/CDKFingerprint(1) has a null
property named bits_count.  This property is mapped to
cdkhelper.CDKFingerprint.bits_count, which cannot accept null values.
...
at org.datanucleus.store.appengine.query.StreamingQueryResult
$AbstractListIterator.hasNext(StreamingQueryResult.java:205)
...

Having no idea and hoping help.

Regards,
Charlie


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Johnson (Google)  
View profile  
(1 user)  More options Jun 17, 11:58 am
From: "Nick Johnson (Google)" <nick.john...@google.com>
Date: Wed, 17 Jun 2009 16:58:02 +0100
Local: Wed, Jun 17 2009 11:58 am
Subject: Re: [google-appengine] No way to delete error data entry

Hi Charlie,

Your easiest option here is probably to upload an alternate major version of
your app with the old schema, and use that to retrieve and fix the faulty
entit(y|ies). Alternate approaches include using the low level datastore
API, or uploading a Python version that uses the low level API or
db.Expando.

-Nick Johnson

--
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charlie Zhu  
View profile  
(1 user)  More options Jun 20, 10:36 am
From: Charlie Zhu <zh.char...@gmail.com>
Date: Sat, 20 Jun 2009 07:36:57 -0700 (PDT)
Local: Sat, Jun 20 2009 10:36 am
Subject: Re: No way to delete error data entry
Thank you, Nick,

I have written code as below with low level API to delete the entry.
It runs without error but seems not totally working. And thanks god
that data suddenly appeared at Data Viewer and problem resolved.

Code pasted here and hope it useful for others

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Query;

        public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
                 String tbname = req.getParameter("tbname");
                 if(tbname!=null)
                 {
                         DatastoreService datastore =
DatastoreServiceFactory.getDatastoreService();

                         // Or perform a query
                         Query query = new Query(tbname);
                         for (Entity taskEntity : datastore.prepare(query).asIterable()) {
                             datastore.delete(taskEntity.getKey());
                         }
                 }
        }

Regards,
Charlie

On Jun 17, 11:58 pm, "Nick Johnson (Google)" <nick.john...@google.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Johnson (Google)  
View profile  
 More options Jun 22, 6:07 am
From: "Nick Johnson (Google)" <nick.john...@google.com>
Date: Mon, 22 Jun 2009 11:07:19 +0100
Local: Mon, Jun 22 2009 6:07 am
Subject: Re: [google-appengine] Re: No way to delete error data entry

Hi Charlie,

What do you mean by "not totally working"? Also, you may have better luck
asking this in the google-appengine-java group.

-Nick Johnson

--
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
andrew  
View profile  
 More options Jul 24, 10:39 am
From: andrew <andrew.r...@gmail.com>
Date: Fri, 24 Jul 2009 07:39:36 -0700 (PDT)
Local: Fri, Jul 24 2009 10:39 am
Subject: Re: No way to delete error data entry
Thanks for the code.  Worked great except I got a bunch of these:
com.google.apphosting.api.DeadlineExceededException: This request
(f557629c71ca7b8d) started at 2009/07/24 13:20:12.825 UTC and was
still executing at 2009/07/24 13:20:41.505 UTC.

but just had to hit refresh a few times.  It'd be nice if appengine
provided means to truncate/drop tables in the admin console.

Andrew

On Jun 20, 10:36 am, Charlie Zhu <zh.char...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google