MountainClimb / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

makePersistent does not wrap ArrayList with SCO wrapper. #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
makePersistent does not wrap ArrayList with SCO wrapper.
PM committing or PM closing don't save ArrayList's modification
 that changed after makePersistent.
Maybe it is incompatible behavior with JDO specification.

related discussion here:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/a44cb0
49f40d6bab#

Original issue reported on code.google.com by kenta.wa...@gmail.com on 13 Oct 2009 at 6:15

GoogleCodeExporter commented 8 years ago
I am noticing this bug with HashSet and LinkedList also.  It seems to work with 
Owned
Relationships, but I am unable to Set<Long>, Set<String>, Set<Key> to work.

Original comment by jeffg....@gmail.com on 22 Oct 2009 at 6:19

GoogleCodeExporter commented 8 years ago
I also see this bug. I see occasional persistence of my List<String>, but very
inconsistently. (This is in the Eclipse plugin.)

Original comment by gregbill...@gmail.com on 4 Nov 2009 at 8:00

GoogleCodeExporter commented 8 years ago
We are not correctly wrapping the Collection on insert.  The workaround is to 
make
your changes before you call makePersistent().

Original comment by max.r...@gmail.com on 6 Nov 2009 at 6:34

GoogleCodeExporter commented 8 years ago
Can someone please provide a simple example of a work around for 
ArrayList<String>??

Original comment by jhowe...@gmail.com on 20 Mar 2010 at 7:05

GoogleCodeExporter commented 8 years ago
Please max, could you make an sample for the work around. Thanks a lot!!

Original comment by coelh...@gmail.com on 17 Apr 2010 at 11:14

GoogleCodeExporter commented 8 years ago
Anyone have a work around that allows you to change the collection after the 
initial
makePersistent?  Calling makePeristent a second time doesn't seem to help.  

Only adding items to the object once during construction makes collections 
useless
for my application

Original comment by UncleSo...@gmail.com on 5 May 2010 at 5:12

GoogleCodeExporter commented 8 years ago
Max - Can you please explain the workaround?

I'm experiencing this after switching from "non-detachable but I called 
detachCopy anyway" entities (I think you'd call that Transient) to "entities 
declared as detachable".  Since this change I can persist new entries in an 
ArrayList or HashSet, but removing an entry and attempting to persist in that 
state does not remove any items from the list.

Original comment by jamesk...@gmail.com on 1 Jul 2010 at 4:41

GoogleCodeExporter commented 8 years ago
For the workaround he means 

MyClass entity = new MyClass(...);
entity.getCollection().add(...);
pm.makePersistent(entity);

instead of 
MyClass entity = new MyClass(...);
pm.makePersistent(entity);
entity.getCollection().add(...);

Original comment by googleco...@yahoo.co.uk on 20 Jul 2011 at 6:23

GoogleCodeExporter commented 8 years ago

Original comment by googleco...@yahoo.co.uk on 14 Aug 2011 at 7:15

GoogleCodeExporter commented 8 years ago
SVN trunk wraps all SCO fields after insert/update calls

Original comment by googleco...@yahoo.co.uk on 2 Nov 2011 at 7:59