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)
...
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.
On Wed, Jun 17, 2009 at 9:15 AM, Charlie Zhu <zh.char...@gmail.com> wrote:
> 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
-- Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047
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.
// 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:
> 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
> On Wed, Jun 17, 2009 at 9:15 AM, Charlie Zhu <zh.char...@gmail.com> wrote:
> > 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
> --
> Nick Johnson, App Engine Developer Programs Engineer
> Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
> 368047
On Sat, Jun 20, 2009 at 3:36 PM, Charlie Zhu <zh.char...@gmail.com> wrote:
> 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.
> // 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:
> > 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
> > On Wed, Jun 17, 2009 at 9:15 AM, Charlie Zhu <zh.char...@gmail.com>
> wrote:
> > > 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
> > --
> > Nick Johnson, App Engine Developer Programs Engineer
> > Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
> Number:
> > 368047
-- Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047
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:
> 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.
> // 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:
> > 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
> > On Wed, Jun 17, 2009 at 9:15 AM, Charlie Zhu <zh.char...@gmail.com> wrote:
> > > 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
> > --
> > Nick Johnson, App Engine Developer Programs Engineer
> > Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
> > 368047