I've been using this too with a combination of Java/Jython, Java for the JDO/data POJOs, Jython the rest. Jython doesn't appear to support Java decorators which JDO uses extensively in the examples and seems to be stumbling block for a pure Jython GAE solution or am I missing something ? Jynx looks like a possible solution with respect to Java decorators ?

 
2009/8/12 Cliff Hill <xlorep@darkhelm.org>
Now, maybe there is something wrong in Jython's reflection functionality, so maybe there is a need for a bug report... But I was more or less assuming it was something weird with the GAE/J DataNucleus hooks.

On Tue, Aug 11, 2009 at 4:15 PM, Cliff Hill <xlorep@darkhelm.org> wrote:
Yes, the Java code is casting it as a different class that does have makePersistent(), while the Jython code doesn't do that (without coersion through the trick I showed earlier).

I think this is a bit strange myself, but one way works, the other doesn't. And the only thing I could find was that the DataNucleus object which is returned doesn't actually have makePersistent... which doesn't make much sense if it is derived from the class that does, but oh well... but a PersistenceManager object does have the needed method. The Java code assigns the results to a PersistenceManager object and therefore it gets recast as one, while the Jython code doesn't do this, and it leaves it as the DataNucleus object which is missing that method. As such, my solution is to have the java code coerce it to the correct class, and then hand it off to Jython as the correct one (that is, the class with makePersistent).


On Tue, Aug 11, 2009 at 3:46 PM, Charlie Groves <charlie.groves@gmail.com> wrote:
On Tue, Aug 11, 2009 at 1:31 PM, Cliff Hill<xlorep@darkhelm.org> wrote:
> Actually, it matters, because the object that returns when you do
> PMF.getPersistenceManager() doesn't have the makePersistent() method,
> apparently.

But the one returned from Java does have makePersistent?  I feel like
the Java and Jython code are equivalent, so I'd like to track down the
difference as that might be a Jython bug.  Is there anything the Java
code is doing that isn't in the example?

Charlie



--
"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
Website: http://darkhelm.org
Sent from Santa Maria, California, United States



--
"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
Website: http://darkhelm.org
Sent from Santa Maria, California, United States

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users