[appengine-java] Re: Exhaustive JPA/JDO tutorial

2009-09-15 Thread Java_GAE

Thanks Esteban. This seems useful. Will read and post feedback later.


On Sep 15, 12:02 am, Esteban Masoero emaso...@getsense.com.ar wrote:
 This should 
 help:http://www.datanucleus.org/products/accessplatform_1_1/index.html

 Regards,

 Esteban

 Java_GAE escribió:

  Hi,
  Please anybody can post a link to exhaustive and intensive tutorial on
  JPA/JDO. I got head and tail from the google app engine tutorial but
  need to understand much more than that to create my application.

  Thanks in advance.
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Fetch by string equality stopped working

2009-09-15 Thread damnpana...@googlemail.com

I have a jpa/spring dao that returns a user by open id url.  Running
on sdk 1.2.1, his worked without a problem. moving to 1.2.2, and now
1.2.5, it no longer returns any records.  Returning all records and
using String.equals works fine:

String openIdUrl = http://blah/me;;
List results = em.createQuery(select u from +OpenIDUser.class.getName
()+ u where u.openIDUrl=?1).setParameter(1, openIdUrl).getResultList
();
//results is size 0

List l = em.createQuery(select u from +OpenIDUser.class.getName()+
u).getResultList();
for(Object o: l){
 String url = ((OpenIDUser)o).getOpenIDUrl();
 if(openIdUrl.equals(url)){
 //string matches
  return (OpenIDUser)o;
 }
}

I am assuming I have inadvertently screwed something up in my
environment, but I'm struggling to get any more information  - can
anyone suggest any pointers?
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Regarding nullpoint exception

2009-09-15 Thread mahesh

Hi i have been working with an application and  when i send a url
request thru the browser,iam getting a null point exception,so someone
tell me how can i rectift dat error
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-15 Thread WilliamF

As leszek says I think you have a few things confused:

DataNucleus is a JDO/JPA implementation that can run within AppEngine.

AppEngine provides 2 persistence mechanisms, BigTable and VFS (Virtual
File System). You cannot configure your GoogleApp to use an external
RDBMS, nor can you host an RDBMS within your GoogleApp. Also note that
with each DB record, BigTable effectively stores not only the data but
also the metadata for the table. Ie all the column names are stored
alongside the column data, for each record. So a Gigabyte of data will
commonly consume 10GB of space within BigTable.

Using GWT on your client is orthogonal, to the persistence on the
server.

However, if you have a clean JPA (non-Hibernate specific)
implementation you might have a way continue to use JPA within your
GoogleApp by using a H2 RDBMS implementation running on top of VFS.
See 
http://groups.google.com/group/google-appengine-java/browse_thread/thread/fce7750aad2845ff?hl=en
and
http://groups.google.com/group/gaevfs/browse_thread/thread/c23b8af5791b3a4

On a side note, Andy (aka Datanucleus) you need to chill dude.
Users are reporting problems with Datanucleus because they are feeling
pain.
Barking at them is not the way to win support and market share for
Datanucleus, quite the opposite.

William


--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-15 Thread datanucleus

@WilliamF, I don't see how any of my responses in this thread can be
construed even remotely as barking at somebody. In fact providing
references to docs would likely be the opposite, as the user indeed
recognised in his post. In fact you can review all of my responses to
people over the last 5 months and judge that for yourself; some
replies where more time was available to give a full response and
others less. Obviously, in a written form, someone somewhere will
always want to construe a response in some other way maybe due to the
problems they themselves are having with some software and the
subsequent frustration and want someone to blame.

For the record, people in general are reporting problems with the
Google-provided datanucleus plugin, not DataNucleus itself. There are
actually no outstanding JIRAs for DataNucleus relating to AppEngine
usage. I chip in here occasionally with help in my spare time, since
DataNucleus is an open source project, to which anyone could volunteer
their time. If that is inadequate for you then that is indeed
unfortunate. Good luck with your application.
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-15 Thread leszek

Nobody can contradict that DataNucleus is a high quality software. The
fact that it is Google's persistence provider of choice speaks for
itself.
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: JDO/JPA Snippets That Work - Creating a bidirectional, owned, one-to-many relationship

2009-09-15 Thread Jeff Arbaugh
Max,
Love the examples, however I have one question. In the GAE JDO documentation
there's much written about the KeyFactory, Builder(s) and creating hierarcal
Key(s). It's doesn't appear that your example has factored these in. I know
littered through out my code are KeyFactory and Builders for the child
objects. Should these Key Builders be included within your example?

Thank you,

Jeff


On Mon, Sep 14, 2009 at 7:07 PM, Max Ross
maxr+appeng...@google.commaxr%2bappeng...@google.com
 wrote:

 Hello hello and welcome to the very first installment of JDO/JPA Snippets
 That Work!

 Creating A Bidrectional Owned One-To-Many

 Suppose you're building a book catalog application and you want to model
 books and chapters.  Books contain chapters.  A chapter cannot exist without
 a book, so if you delete a book you want its chapters automatically deleted
 along with it.  You also want to each chapter to have a reference to the
 book that owns it.  Sounds like a bidrectional, owned, one-to-many
 relationship is just the thing.  First we'll set up our model objects and
 then we'll add some code to create a Book with 2 Chapters.

 JPA:
 @Entity
 public class Book {
 @Id
 @GeneratedValue(strategy=GenerationType.IDENTITY)
 private Key id;

 private String title;

 @OneToMany(mappedBy = book, cascade = CascadeType.ALL)
 private ListChapter chapters = new ArrayListChapter();

 // getters and setters
 }

 @Entity
 public class Chapter {
 @Id
 @GeneratedValue(strategy=GenerationType.IDENTITY)
 private Key id;

 private String title;
 private int numPages;

 @ManyToOne(fetch = FetchType.LAZY)
 private Book book;

 // getters and setters
 }

 Now let's create a book with two chapters (we'll assume someone else is
 creating and closing an EntityManager named 'em' for us):

 Book b = new Book();
 b.setTitle(JPA 4eva);
 Chapter c1 = new Chapter();
 c1.setTitle(Intro);
 c1.setNumPages(10);
 b.getChapters().add(c1);
 Chapter c2 = new Chapter();
 c2.setTitle(Configuration);
 c2.setNumPages(9);
 b.getChapters().add(c2);

 em.getTransaction().begin();
 try {
 em.persist(b);
 em.getTransaction().commit();
 } finally {
 if (em.getTransaction().isActive()) {
 em.getTransaction().rollback();
 }
 }


 JDO:

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable =
 true)
 public class Book {

 @PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 private Key id;

 private String title;

 @Persistent(mappedBy = book)
 @Element(dependent = true)
 private ListChapter chapters = new ArrayListChapter();

 // getters and setters
 }

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable =
 true)
 public class Chapter {
 @PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 private Key id;

 private String title;
 private int numPages;

 @Persistent
 private Book book;

 // getters and setters
 }

 Now let's create a book with two chapters (we'll assume someone else is
 creating and closing a PersistenceManager named 'pm' for us):

 Book b = new Book();
 b.setTitle(JDO 4eva);
 Chapter c1 = new Chapter();
 c1.setTitle(Intro);
 c1.setNumPages(10);
 b.getChapters().add(c1);
 Chapter c2 = new Chapter();
 c2.setTitle(Configuration);
 c2.setNumPages(9);
 b.getChapters().add(c2);

 pm.currentTransaction().begin();
 try {
 pm.makePersistent(b);
 pm.currentTransaction().commit();
 } finally {
 if (pm.currentTransaction().isActive()) {
 pm.currentTransaction().rollback();
 }
 }


 


--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] built in security features of GAE

2009-09-15 Thread George Simon
Has anyone know the built in security features in GAE.

Thanks in Advance

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: How to save GeoPt in JPA?

2009-09-15 Thread Matt Farnell
use geohash

Sent from my iPhone

On 15/09/2009, at 7:09 AM, Jason (Google) apija...@google.com wrote:

 Release 1.2.5 did add a GeoPt property type for Java so you can more  
 easily store geographic coordinates in the datastore, but App Engine  
 itself does not provide the logic necessary for doing bounding-box  
 or other geo queries. As you said, there are several projects  
 available for App Engine Python, but I don't know of any for Java,  
 though they could still be out there.

 - Jason

 On Sat, Sep 12, 2009 at 1:55 PM, damenlon inhouse...@gmail.com  
 wrote:

 Hi,

 There is a good Map tutorial, geodatastore, for Python.

 Is there one for Java using JPA?

 What I want to do is searching Geo Points within a boundary.

 Thanks!




 

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Bulk writes to datastore

2009-09-15 Thread Richard

Hi Larry

 I am wondering about writing a Servlet that would form/multi-part
 upload large files and cache them in memcache then use the
 cron API to trickle persist them into the DS over time ...

I've been thinking about using something like this as well.  I think
you could likely cache the upload to the store because the limit here
seems to be mainly the amount of entities, not the size of one entity
(below 1mb).  I have e.g. 100/200k worth of data that I upload, but
because it's represented as a couple hundred entities it chokes.  I
could just upload the 93k and fire off a task (or cron job) that would
parse and insert the data offline.

At the very least, I plan to use the low-level api more.  The (very
useful) performance testing app http://gaejava.appspot.com/ shows
consistently higher CPU usage from JDO.  If this ever improves, that
app should show it.  Until then, low-level looks good.

Regards,
Richard
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: ArrayIndexOutOfBoundsException: at org.datanucleus.plugin.ConfigurationElement.putAttribute(Configuratio nElement.java:104)

2009-09-15 Thread Patrizio Munzi




No one has any update on this???

Thanks

Patrizio Munzi wrote:

  
  
Mmm,
  
I think there's need of datanucleus experts.
  
Hope someone could clarify this subject
  
wada3 wrote:
  
It would be bug or limitation of development environment.
I have not met them on real appengine environment because
container looks like running on single thread model.
Normally it would not need to be synchronized I think.

On Sep 11, 4:41pm, "patrizio.munzi" eris4.mu...@gmail.com wrote:
  

  Isn't this an important subject to address?
Are all method calling the makePersistent method needed to be
synchronized...??
Is this a bug..??

No one has any consideration???

Thanks

On Sep 10, 10:35am, "patrizio.munzi" eris4.mu...@gmail.com wrote:


  
I did a few more investigation and It looks like a threads safety
problem.
In fact if I synchronize the method
com.myapp.server.datastore.EventsManager.addEvent whithin
makePersistent is called everything works fine.
  
  
  
I think here experts are needed..
:-)
  
  
  
Bye
  
  
  
On Sep 10, 10:18am, "patrizio.munzi" eris4.mu...@gmail.com wrote:
  
  
  

  Hi everybody I'm having an ArrayOutOfBoundException from nucleus...


  
  

  I don't know where it comes from...
Can anyone give me some information about it...
Here's the stack trace...
---
The server is running athttp://localhost:8181/
java.lang.ArrayIndexOutOfBoundsException: 1187
at org.datanucleus.plugin.ConfigurationElement.putAttribute
(ConfigurationElement.java:104)
at
org.datanucleus.store.appengine.DatastorePluginRegistry.getExtensionPoint
(DatastorePluginRegistry.java:59)
at org.datanucleus.plugin.PluginManager.getExtensionPoint
(PluginManager.java:65)
at
org.datanucleus.plugin.PluginManager.getConfigurationElementForExtension
(PluginManager.java:113)
at org.datanucleus.plugin.PluginManager.getAttributeValueForExtension
(PluginManager.java:230)
at org.datanucleus.ObjectManagerImpl.getCallbackHandler
(ObjectManagerImpl.java:3804)
at org.datanucleus.state.AbstractStateManager.getCallbackHandler
(AbstractStateManager.java:160)
at
org.datanucleus.state.JDOStateManagerImpl.initialiseForPersistentNew
(JDOStateManagerImpl.java:466)
at
org.datanucleus.state.StateManagerFactory.newStateManagerForPersistentNew
(StateManagerFactory.java:151)
at org.datanucleus.ObjectManagerImpl.persistObjectInternal
(ObjectManagerImpl.java:1297)
at org.datanucleus.ObjectManagerImpl.persistObject
(ObjectManagerImpl.java:1175)
at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent
(JDOPersistenceManager.java:669)
at org.datanucleus.jdo.JDOPersistenceManager.makePersistent
(JDOPersistenceManager.java:694)
at com.myapp.server.datastore.EventsManager.addEvent
(EventsManager.java:167)
at com.myapp.server.restlet.EventResource.addEvent(EventResource.java:
30)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:
390)
at org.restlet.resource.ServerResource.doHandle(ServerResource.java:
328)
at org.restlet.resource.ServerResource.doNegotiatedHandle
(ServerResource.java:581)
at org.restlet.resource.ServerResource.doConditionalHandle
(ServerResource.java:254)
at org.restlet.resource.ServerResource.handle(ServerResource.java:
923)
at org.restlet.resource.Finder.handle(Finder.java:510)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:201)
at org.restlet.routing.Router.doHandle(Router.java:321)
at org.restlet.routing.Router.handle(Router.java:520)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:201)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:201)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.engine.application.StatusFilter.doHandle
(StatusFilter.java:152)
at org.restlet.routing.Filter.handle(Filter.java:201)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:201)
at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
at org.restlet.engine.application.ApplicationHelper.handle
(ApplicationHelper.java:72)
at org.restlet.Application.handle(Application.java:344)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:201)
at org.restlet.routing.Router.doHandle(Router.java:321)
at org.restlet.routing.Router.handle(Router.java:520)
at 

[appengine-java] CPU Occasionally Spikes when HttpSession is Created

2009-09-15 Thread Traveler1980

Hi Everyone,

I've noticed that CPU occasionally spikes when creating an
HTTPSession.  It only seems to happen when it's been awhile since an
app has been accessed or when an app is initially deployed.

For example, I created a simple test servlet that creates a session
and and writes a response:

protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
   req.getSession();
   PrintWriter writer = resp.getWriter();
   writer.write(Test Complete);
   writer.flush();
   writer.close();
}

When I deploy the app and invoke the servlet for the first time, I see
the following in the admin console:
09-15 05:57AM 29.487 /test 200 7184ms 4381cpu_ms 65api_cpu_ms 0kb
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/
2009011913 Firefox/3.0.6 (.NET C

Note the high CPU and long response time.

Subsequent session creations are much faster.  If I delete my cookies
and re-invoke the servlet, CPU is approx. 70-80ms.

Now, if I leave the app for awhile (let's say an hour) and hit the
servlet again, CPU is once again through the roof for the initial
GET.

Any thoughts about what's going on here?  I know that Google's session
management involves memcache and the datastore.  Could the high CPU be
a side-effect of some initialization routine, etc...?

Thanks for the feedback,
Jamie

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Regarding debugging error

2009-09-15 Thread leszek

Replace:
   filter-classAuthFilter/filter-class
With
filter-classcom.org.login.AuthFilter/filter-class
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: JDO/JPA Snippets That Work - Creating a bidirectional, owned, one-to-many relationship

2009-09-15 Thread Max Ross
This example only demonstrates creation of parent and child when both parent
and child use datastore id generation.  If you wanted to use a named Key for
either of these objects as opposed to datastore id generation, the
KeyFactory and the KeyFactory.Builder class would be involved.  This would
also be the case if you were constructing a Key to perform a lookup of
either parent or child.

I plan to devote other snippets to more complicated Key-management
scenarios.

Thanks,
Max

On Tue, Sep 15, 2009 at 4:16 AM, Jeff Arbaugh jeffarba...@gmail.com wrote:

 Max,
 Love the examples, however I have one question. In the GAE JDO
 documentation there's much written about the KeyFactory, Builder(s) and
 creating hierarcal Key(s). It's doesn't appear that your example has
 factored these in. I know littered through out my code are KeyFactory and
 Builders for the child objects. Should these Key Builders be included within
 your example?

 Thank you,

 Jeff


 On Mon, Sep 14, 2009 at 7:07 PM, Max Ross 
 maxr+appeng...@google.commaxr%2bappeng...@google.com
  wrote:

 Hello hello and welcome to the very first installment of JDO/JPA Snippets
 That Work!

 Creating A Bidrectional Owned One-To-Many

 Suppose you're building a book catalog application and you want to model
 books and chapters.  Books contain chapters.  A chapter cannot exist without
 a book, so if you delete a book you want its chapters automatically deleted
 along with it.  You also want to each chapter to have a reference to the
 book that owns it.  Sounds like a bidrectional, owned, one-to-many
 relationship is just the thing.  First we'll set up our model objects and
 then we'll add some code to create a Book with 2 Chapters.

 JPA:
 @Entity
 public class Book {
 @Id
 @GeneratedValue(strategy=GenerationType.IDENTITY)
 private Key id;

 private String title;

 @OneToMany(mappedBy = book, cascade = CascadeType.ALL)
 private ListChapter chapters = new ArrayListChapter();

 // getters and setters
 }

 @Entity
 public class Chapter {
 @Id
 @GeneratedValue(strategy=GenerationType.IDENTITY)
 private Key id;

 private String title;
 private int numPages;

 @ManyToOne(fetch = FetchType.LAZY)
 private Book book;

 // getters and setters
 }

 Now let's create a book with two chapters (we'll assume someone else is
 creating and closing an EntityManager named 'em' for us):

 Book b = new Book();
 b.setTitle(JPA 4eva);
 Chapter c1 = new Chapter();
 c1.setTitle(Intro);
 c1.setNumPages(10);
 b.getChapters().add(c1);
 Chapter c2 = new Chapter();
 c2.setTitle(Configuration);
 c2.setNumPages(9);
 b.getChapters().add(c2);

 em.getTransaction().begin();
 try {
 em.persist(b);
 em.getTransaction().commit();
 } finally {
 if (em.getTransaction().isActive()) {
 em.getTransaction().rollback();
 }
 }


 JDO:

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable =
 true)
 public class Book {

 @PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 private Key id;

 private String title;

 @Persistent(mappedBy = book)
 @Element(dependent = true)
 private ListChapter chapters = new ArrayListChapter();

 // getters and setters
 }

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable =
 true)
 public class Chapter {
 @PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 private Key id;

 private String title;
 private int numPages;

 @Persistent
 private Book book;

 // getters and setters
 }

 Now let's create a book with two chapters (we'll assume someone else is
 creating and closing a PersistenceManager named 'pm' for us):

 Book b = new Book();
 b.setTitle(JDO 4eva);
 Chapter c1 = new Chapter();
 c1.setTitle(Intro);
 c1.setNumPages(10);
 b.getChapters().add(c1);
 Chapter c2 = new Chapter();
 c2.setTitle(Configuration);
 c2.setNumPages(9);
 b.getChapters().add(c2);

 pm.currentTransaction().begin();
 try {
 pm.makePersistent(b);
 pm.currentTransaction().commit();
 } finally {
 if (pm.currentTransaction().isActive()) {
 pm.currentTransaction().rollback();
 }
 }





 


--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] RPC call and variables

2009-09-15 Thread sahil mahajan
Hello

In my application, If a client A makes an rpc call and changes a variable at
server, I want this change to be immediately reflected to other clients when
they make same rpc call. But it looks that my clients are interacting with
different servers and changes are not reflected. What can I do to make this
possible?

Regards
Sahil

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Fetch by string equality stopped working

2009-09-15 Thread Max Ross
Looks like a regression in handling of positional params.  I could've sworn
I had tests for these.but no, they don't exist.  I'll follow up with a
bug number you can use to track this issue. I'll also try to find you a
workaround.

Sorry for the trouble,
Max

On Tue, Sep 15, 2009 at 12:33 AM, damnpana...@googlemail.com 
damnpana...@googlemail.com wrote:


 I have a jpa/spring dao that returns a user by open id url.  Running
 on sdk 1.2.1, his worked without a problem. moving to 1.2.2, and now
 1.2.5, it no longer returns any records.  Returning all records and
 using String.equals works fine:

 String openIdUrl = http://blah/me;;
 List results = em.createQuery(select u from +OpenIDUser.class.getName
 ()+ u where u.openIDUrl=?1).setParameter(1, openIdUrl).getResultList
 ();
 //results is size 0

 List l = em.createQuery(select u from +OpenIDUser.class.getName()+
 u).getResultList();
 for(Object o: l){
  String url = ((OpenIDUser)o).getOpenIDUrl();
  if(openIdUrl.equals(url)){
  //string matches
  return (OpenIDUser)o;
  }
 }

 I am assuming I have inadvertently screwed something up in my
 environment, but I'm struggling to get any more information  - can
 anyone suggest any pointers?
 


--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Fetch by string equality stopped working

2009-09-15 Thread Max Ross
http://code.google.com/p/datanucleus-appengine/issues/detail?id=128

Unfortunately the only real workaround is to use named params instead of
positional params.  Do you think you can make that work?

Max

On Tue, Sep 15, 2009 at 7:36 AM, Max Ross
maxr+appeng...@google.commaxr%2bappeng...@google.com
 wrote:

 Looks like a regression in handling of positional params.  I could've sworn
 I had tests for these.but no, they don't exist.  I'll follow up with a
 bug number you can use to track this issue. I'll also try to find you a
 workaround.

 Sorry for the trouble,
 Max


 On Tue, Sep 15, 2009 at 12:33 AM, damnpana...@googlemail.com 
 damnpana...@googlemail.com wrote:


 I have a jpa/spring dao that returns a user by open id url.  Running
 on sdk 1.2.1, his worked without a problem. moving to 1.2.2, and now
 1.2.5, it no longer returns any records.  Returning all records and
 using String.equals works fine:

 String openIdUrl = http://blah/me;;
 List results = em.createQuery(select u from +OpenIDUser.class.getName
 ()+ u where u.openIDUrl=?1).setParameter(1, openIdUrl).getResultList
 ();
 //results is size 0

 List l = em.createQuery(select u from +OpenIDUser.class.getName()+
 u).getResultList();
 for(Object o: l){
  String url = ((OpenIDUser)o).getOpenIDUrl();
  if(openIdUrl.equals(url)){
  //string matches
  return (OpenIDUser)o;
  }
 }

 I am assuming I have inadvertently screwed something up in my
 environment, but I'm struggling to get any more information  - can
 anyone suggest any pointers?
 



--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Exception since upgrading to 1.2.5

2009-09-15 Thread David Fuelling

I was also getting this error after upgrading to 1.2.5, except that in
my case the javax.jdo.JDODetachedFieldAccessException was happening
when I tried to access a simple
'com.google.appengine.api.datastore.Text' field on a Detached object
(Datanucleus must be treating Enumerated fields like a Collection).

I'm using JPA, so for every Text in my entities I had to add the
annotation @Basic(fetch = FetchType.EAGER).  Just FYI, because I'd
never used a fetchtype on a non-collection field.

Not sure if this is how it's supposed to work, but it fixes the issue.

david


On Sep 10, 1:13 am, hansamann sven.hai...@googlemail.com wrote:
 Hi all,

 since I updated my app to the latest java sdk, I sometimes see these
 errors (which results in the homepage of the app being blank or
 showing an ugly error message):

 [groovytweets/73.336182399219449559].stdout: StackTrace Sanitizing
 stacktrace:
 org.codehaus.groovy.runtime.InvokerInvocationException:
 javax.jdo.JDODetachedFieldAccessException: You have just attempted to
 access field retweets yet this field was not detached when you
 detached the object. Either dont access this field, or detach it when
 detaching the object.
         at org.codehaus.groovy.reflection.CachedMethod.invoke
 (CachedMethod.java:92)
         at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
         at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1062)
         at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:
 926)
         at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:893)
         at groovy.lang.Closure.call(Closure.java:279)
         at org.codehaus.groovy.grails.web.pages.GroovyPage.invokeTag
 (GroovyPage.java:219)
         at org.codehaus.groovy.grails.web.pages.GroovyPage$invokeTag
 $0.callCurrent(Unknown Source)
         at


--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Regarding Error in Jsp Code

2009-09-15 Thread Rajeev Dayal
It looks like there is a problem with your import statement:

   [javac] 
C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:9:
cannot find symbol

[javac] symbol  : class query
[javac] location: package javax.jdo

[javac] import javax.jdo.query;
[javac]


I think you want to import javax.jdo.Query here (note the difference in
case).

As for:

  [javac] 
C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:144:
cannot find symbol
[javac] symbol  : method getContent()
[javac] location: class exe.exeEntry


[javac]   out.print(e.getContent());
[javac]  ^


Your class exe.exeEntry does not have a method named getContent(), though it
does have a field named content. You have to expose the getter/setter
yourself.

On Tue, Sep 15, 2009 at 3:14 AM, nimmala anukarthi 
nimmala.anukar...@gmail.com wrote:

 Hi rajeev,
  Thanks for your reply, i have included % % between the curly braces and
 compiled it again
 then iam getiing following error.

 HTTP ERROR: 500

 Unable to compile class for JSP


 Generated servlet error:
 [javac] 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:9:
  cannot find symbol
 [javac] symbol  : class query

 [javac] location: package javax.jdo

 [javac] import javax.jdo.query;
 [javac] ^


 Generated servlet error:
 [javac] 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:116:
  cannot find symbol


 [javac] symbol  : class Query
 [javac] location: class org.apache.jsp.ex_jsp
 [javac] Query query=pm.newQuery(SELECT * FROM 
 +exeEntry.class.getName());
 [javac] ^


 Generated servlet error:


 [javac] 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:144:
  cannot find symbol
 [javac] symbol  : method getContent()
 [javac] location: class exe.exeEntry


 [javac]   out.print(e.getContent());
 [javac]  ^


 Generated servlet error:
 [javac] 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:147:
  cannot find symbol


 [javac] symbol  : method getPoster()
 [javac] location: class exe.exeEntry
 [javac]   out.print(e.getPoster());
 [javac]  ^


 Generated servlet error:
 [javac] Note: 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java
  uses unchecked or unsafe operations.



 Generated servlet error:
 [javac] Note: Recompile with -Xlint:unchecked for details.
 [javac] 4 errors



 RequestURI=/ex.jsp
 Caused by:

 org.apache.jasper.JasperException: Unable to compile class for JSP

 Generated servlet error:
 [javac] 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:9:
  cannot find symbol


 [javac] symbol  : class query
 [javac] location: package javax.jdo
 [javac] import javax.jdo.query;
 [javac] ^


 Generated servlet error:
 [javac] 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:116:
  cannot find symbol


 [javac] symbol  : class Query
 [javac] location: class org.apache.jsp.ex_jsp
 [javac] Query query=pm.newQuery(SELECT * FROM 
 +exeEntry.class.getName());
 [javac] ^


 Generated servlet error:


 [javac] 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:144:
  cannot find symbol
 [javac] symbol  : method getContent()
 [javac] location: class exe.exeEntry


 [javac]   out.print(e.getContent());
 [javac]  ^


 Generated servlet error:
 [javac] 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java:147:
  cannot find symbol


 [javac] symbol  : method getPoster()
 [javac] location: class exe.exeEntry
 [javac]   out.print(e.getPoster());
 [javac]  ^


 Generated servlet error:
 [javac] Note: 
 C:\Users\DEVELO~1.ADM\AppData\Local\Temp\Jetty_127_0_0_1_8087_war-iudaqf\jsp\org\apache\jsp\ex_jsp.java
  uses unchecked or unsafe operations.



 Generated servlet error:
 [javac] Note: Recompile with -Xlint:unchecked for details.

 [javac] 4 errors




   at 
 org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)


   at 
 org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
   at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)


   at 

[appengine-java] Re: Eclipse GWT update error

2009-09-15 Thread AndrewG

Miguel,

I have now tried this - but not had any luck making it work as yet.

I have downloaded and unzipped 'gwt-windows-1.6.4' - then put it into
eclipse/plugins.

If I try to 'Add App Engine SDK' - it just says: Failed to Initialise
App Engine SDK at ./gwt-windows-1.6.4 - don't know why.

One obvious thing - don't know if its significant - if you look inside
the dirs for the other gwt versions installed - they have a number of
things, like: appengine-sdk-plugin.jar, META-INF directory, etc as
well as an appengine-java-sdk-xxx directory, but the newly downloaded/
unzipped directory only contains a 'gwt-windows-1.6.4' sub-directory.

Andrew


--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Problem with a query that uses Date

2009-09-15 Thread lucian

I have this simple query:
Query query = pm.newQuery(Contact.class);
query.setFilter(accountKey == accountKeyParam  lastActionDate 
lastActionDateParam);
query.declareParameters(com.google.appengine.api.datastore.Key
accountKeyParam, Date lastActionDateParam);
query.declareImports(java.util.Date);

public class Contact {
 @PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
   private Date latestActionDate;

// ...
}

When I run this query I get this exception:
javax.jdo.JDOUserException: Invalid import declaration :
java.util.Date
at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException
(NucleusJDOHelper.java:375)
at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:275)

Any ideas why?
Thanks

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: RPC call and variables

2009-09-15 Thread leszek

It is a clustered environment and you cannot assume that every request
is run in the JVM. If you want to share data between requests you
should persist them (data) in datastore.
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Eclipse GWT update error

2009-09-15 Thread Miguel Méndez
Hi Andrew,
This is confusing, but the App Engine SDK and the GWT SDKs are separate SDKs
(one does not contain the other) and they are added via separate
preferences.  Trying to add the GWT SDK via the App Engine preferences will
fail in the manner that you described.


To clarify, if you want to add a GWT SDK you need to navigate to *Window 
Preferences*, or *Eclipse  Preferences* if you are on Mac OS X. Open the *
Google* entry in the left pane and select *Web Toolkit.*

On Tue, Sep 15, 2009 at 10:57 AM, AndrewG andrew.g...@rcrt.co.uk wrote:


 Miguel,

 I have now tried this - but not had any luck making it work as yet.

 I have downloaded and unzipped 'gwt-windows-1.6.4' - then put it into
 eclipse/plugins.

 If I try to 'Add App Engine SDK' - it just says: Failed to Initialise
 App Engine SDK at ./gwt-windows-1.6.4 - don't know why.

 One obvious thing - don't know if its significant - if you look inside
 the dirs for the other gwt versions installed - they have a number of
 things, like: appengine-sdk-plugin.jar, META-INF directory, etc as
 well as an appengine-java-sdk-xxx directory, but the newly downloaded/
 unzipped directory only contains a 'gwt-windows-1.6.4' sub-directory.

 Andrew


 



-- 
Miguel

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Task Queues questions

2009-09-15 Thread Patrizio Munzi

Hi all,

I'm thinking of using the Task Queue feature in order to split a 
particular resource consuming request which could hit the 30 secs 
request limits.
I've got a few questions about queues (for the moment, maybe more are 
coming :-))...

1) is it possible to simulate a serial tasks execution? I was thinking 
of the following configuration for that.

  queue
namequeue/name
rate5/s/rate
bucket-size1/bucket-size
  /queue

2) Where Can I find more information about what you call the special 
task scheduling parameters...??
3) Is the quota total queue execution rate of 10/s a per queue basis 
quota or a global quota for all configured queues??


Thanks

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Eclipse GWT update error

2009-09-15 Thread AndrewG


Miguel,

thank you - just before I picked up yr msg I figured out that I had
tried to install it in the wrong place, and tried again. I have now
(re-)installed the 'web toolkit' at v1.6.4, but I haven't yet
reinstalled the app engine to its previous state.

With just the toolkit re-installed, I am now getting a different set
of errors: Project xxx is missing required library ..
com.google.appenginesdkbundle_1_2_1

where the missing jars are things like: appengine-tools-api.jar,
appengine-local-runtime-shared.jar, etc'.

does this mean that the gwt sdk v 1.6.4 is closely tied to the
appengine vn that was broken during the upgrade? - or is something
else wrong - at the moment eclipse has appengine v1.2.5 installed -
prior to the upgrade it was 1.2.1. I would like to get back to the
configuration that I had before the upgrade (which worked) - but the
only vn that I can see on the download page is v1.2.5 - so not sure
where to get the 1.2.1 version - or is this a red herring and the
errors are being caused by something else ?

Thank you,

Andrew
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Eclipse GWT update error

2009-09-15 Thread Miguel Méndez
Let us know when you have something.

On Tue, Sep 15, 2009 at 12:43 PM, AndrewG andrew.g...@rcrt.co.uk wrote:


 Miguel,

 I have sorted that last problem out - when I switched versions some
 'phantom' jar references appeared in the build path - which I have
 removed.

 There is something else strange going on though - I will post again
 when I have pinned it down.

 Andrew

 



-- 
Miguel

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Eclipse GWT update error

2009-09-15 Thread AndrewG

Miguel,

ok - I think that I am closer to the problem now.

At the moment I am running the web app under tomcat 6 with the re-
installed gwt 1.6.4 sdk, following the problematic upgrade.

There now appears to be what looks like a classloader problem - the
various servlets which this app runs cannot now be created. When the
web app starts you get the 'Error loading WebAppClassLoader' message -
and then 'ClassNotFoundException' for each of the servlets defined in
the project - so none of the servlets work.

I have checked that the entries visible in the 'Build Path' - and
everything seems right.

This problem appears to be isolated to the gwt project - if I create a
new dynamic web project from scratch in eclipse - it runs ok - so this
is not just something in the tomcat installation that has broken.

Also, if I run an 'export to war' of the web app - and run it in a
stand-alone tomcat web server - it seems to work.

My guess is that somehow - during the upgrade something in the low-
level classes which the web server has to class-load in order to
create and run servlets has got broken. Unfortunately, if this
assumption is right, I have no idea how to find out what the offender
might be and fix it.

Andrew

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] How to reset the datastore

2009-09-15 Thread Steve B.

I seem to recall this question passing through the group before. But now 
I cannot find the answer (if there was one) in the maillist or in 
documentation...

I would like to purge all data from my datastore on the App Engine. (I 
do this locally by deleting the 2 files in 
/WEB-INF/appengine-generated.) Is there a way to do this in bulk? Or do 
I need to use the Admin Console and delete one table at a time?

TIA,

Steve B.

--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: self referral one-to-many relationship with null root

2009-09-15 Thread Arash

Can someone please answer it. I appreciate it.

On Sep 14, 5:09 pm, Arash aras...@gmail.com wrote:
 I have a class which has a collection of itself as its children. It is
 mapped as :

 @Persistent
     private Group parent;
 @Persistent(mappedBy= parent)
     private ListGroup children;

 The problem is I cannot insert the root object. The call to
 makePersistent comes back successfully, but the entity is not in the
 database.  I guess this object with this mapping can not have null
 parents. Is there anyway I can make the parent nullable?
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] java.lang.IllegalArgumentException: id or name, but not both, must be set in each key path element

2009-09-15 Thread mably

I get this exception in my application.  Anybody knows what is it
about ?

java.lang.IllegalArgumentException: id or name, but not both, must be
set in each key path element
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError
(DatastoreApiHelper.java:29)
at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
(DatastoreApiHelper.java:56)
at com.google.appengine.api.datastore.DatastoreServiceImpl$2.run
(DatastoreServiceImpl.java:170)
at
com.google.appengine.api.datastore.TransactionRunner.runInTransaction
(TransactionRunner.java:30)
at com.google.appengine.api.datastore.DatastoreServiceImpl.put
(DatastoreServiceImpl.java:158)
at com.google.appengine.api.datastore.DatastoreServiceImpl.put
(DatastoreServiceImpl.java:138)
at com.google.appengine.api.datastore.DatastoreServiceImpl.put
(DatastoreServiceImpl.java:134)
at com.mably.webwinewatch.model.DatastoreEntity.save
(DatastoreEntity.java:84)
[...]

Thanx for your help.

François
Bordeaux, FRANCE
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: Problem with a query that uses Date

2009-09-15 Thread datanucleus

 Any ideas why?

In Java when you have an import statement what do you write ?
Something like
import java.util.Date ? so do that for JDOQL
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: ClassLoading Problems in FileUpload Servlet

2009-09-15 Thread John

Toby,

thanks for taking the time to respond, I appreciate it.

First some things I should have said before, I am using the GAE
Eclipse plug in. GWT 1.7, App Engine 1.2.5.

What I don't understand is why other test applications seem to work
quite hapilly with datastore without me adding a load of jars to the
lib area. Those other applications are using GWT and for example the
standard eclipse generated GreatingServer expanded to use
PersistenceManager seem to work just fine.

Now this may just be down to good/bad luck and the way that the google
projects are structured and therefore work with Jetty etc.

If the correct way to structure things is to explicitly put the GAE/
JDO/... jars in the war/WEB-INF/lib area should they be appearing on
the classpath of the eclipse projects? And why do some projects/use
cases (such as via GWT RCP) seem to work and others fail?

Its coming up to midnight here, so I am going to sleep and revisit
this in the morning, hopefully with a clear head I will be able to
work out what I need to do, but any input on how to set up properly is
really appreciated.

J

On Sep 15, 11:23 pm, Toby Reyelts to...@google.com wrote:
 John,
 The JDO/JPA support for App Engine lives entirely in userland. Like all
 the other libraries under the sdk's SDK_ROOT/lib/user folder, you must
 bundle it with your application in order to use it. One nice aspect about
 the ORM support living in userland is that you can easily apply patches or
 try new interim releases between official SDK releases.

 On Tue, Sep 15, 2009 at 6:17 PM, John john.r.nic...@gmail.com wrote:

  Actually I think I have simplified this further. The basic issue seems
  to be referencing anything to do with the datastore from an ordinary
  servlet. So if I have a servlet

  import java.io.IOException;

  import javax.jdo.JDOHelper;
  import javax.jdo.PersistenceManagerFactory;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;

  public class UploadFileServlet extends HttpServlet {
        �...@override
         protected void service(HttpServletRequest request,
  HttpServletResponse response) throws ServletException, IOException {
         }

         private static final PersistenceManagerFactory PMF =

   JDOHelper.getPersistenceManagerFactory(transactions-optional);

  }

  and  I send it a request I get the following exception

  WARNING: Nested in javax.servlet.ServletException: init:
  java.lang.NoClassDefFoundError: javax/jdo/JDOHelper
          at
  com.cloudscapesolutions.wavacalculator.server.UploadFileServlet.clinit
  (UploadFileServlet.java:18)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
  Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance
  (NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
  (DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
         at org.mortbay.jetty.servlet.ServletHolder.getServlet
  (ServletHolder.java:339)
         at
  org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
  463)
         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
  (ServletHandler.java:1093)
         at
  com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
  (TransactionCleanupFilter.java:43)
         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
  (ServletHandler.java:1084)
         at com.google.appengine.tools.development.StaticFileFilter.doFilter
  (StaticFileFilter.java:121)
         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
  (ServletHandler.java:1084)
         at org.mortbay.jetty.servlet.ServletHandler.handle
  (ServletHandler.java:360)
         at org.mortbay.jetty.security.SecurityHandler.handle
  (SecurityHandler.java:216)
         at org.mortbay.jetty.servlet.SessionHandler.handle
  (SessionHandler.java:181)
         at org.mortbay.jetty.handler.ContextHandler.handle
  (ContextHandler.java:712)
         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
  405)
         at
  com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle
  (DevAppEngineWebAppContext.java:54)
         at org.mortbay.jetty.handler.HandlerWrapper.handle
  (HandlerWrapper.java:139)
         at com.google.appengine.tools.development.JettyContainerService
  $ApiProxyHandler.handle(JettyContainerService.java:313)
         at org.mortbay.jetty.handler.HandlerWrapper.handle
  (HandlerWrapper.java:139)
         at org.mortbay.jetty.Server.handle(Server.java:313)
         at
  

[appengine-java] Re: How to grow your data model over the long term

2009-09-15 Thread bgood

Purely from experimenting with this (if anyone can identify a
reference to a good doc that would be great) I've succeeded with the
just add the new fields approach described above.  The hiccups I've
experienced are that you have to use nullable types for your new
properties (e.g. an int won't work but an Integer will) and, if you
don't implement and execute some sort of batch update-everything-to-
good-non-null-defaults process queries containing the new properties
won't work as you might expect.

Its definitely a source of some concern for me. Looking forward to the
model migration segments of the JDO/JPA Snippets That Work series
here (which seem like they are important enough to promote to blog
posts or the like).
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: ClassLoading Problems in FileUpload Servlet

2009-09-15 Thread John

Ok having thought about what Toby said and allied to what I knew I
went back to retest basics, which no longer worked!!! On investigation
I see that all of my projects have empty lib areas, except for gwt-
servlet.jar.

I created a new Eclipse project and sure enough it has been created
with all of the necessary jar files in the war/WEB-INF/lib area.

I can't immediately think why/how the jars have been removed from the
lib area, I am thinking it must be related to upgrading from App
Engine 1.2.2 to App Engine 1.2.5 yesterday.

Well thanks again Toby for the comments, they have helped me onto the
right path hopefully and I can continue with a clearer model of how
things are constructed.

Now sleep ... John

On Sep 15, 11:49 pm, John john.r.nic...@gmail.com wrote:
 Toby,

 thanks for taking the time to respond, I appreciate it.

 First some things I should have said before, I am using the GAE
 Eclipse plug in. GWT 1.7, App Engine 1.2.5.

 What I don't understand is why other test applications seem to work
 quite hapilly with datastore without me adding a load of jars to the
 lib area. Those other applications are using GWT and for example the
 standard eclipse generated GreatingServer expanded to use
 PersistenceManager seem to work just fine.

 Now this may just be down to good/bad luck and the way that the google
 projects are structured and therefore work with Jetty etc.

 If the correct way to structure things is to explicitly put the GAE/
 JDO/... jars in the war/WEB-INF/lib area should they be appearing on
 the classpath of the eclipse projects? And why do some projects/use
 cases (such as via GWT RCP) seem to work and others fail?

 Its coming up to midnight here, so I am going to sleep and revisit
 this in the morning, hopefully with a clear head I will be able to
 work out what I need to do, but any input on how to set up properly is
 really appreciated.

 J

 On Sep 15, 11:23 pm, Toby Reyelts to...@google.com wrote:

  John,
  The JDO/JPA support for App Engine lives entirely in userland. Like all
  the other libraries under the sdk's SDK_ROOT/lib/user folder, you must
  bundle it with your application in order to use it. One nice aspect about
  the ORM support living in userland is that you can easily apply patches or
  try new interim releases between official SDK releases.

  On Tue, Sep 15, 2009 at 6:17 PM, John john.r.nic...@gmail.com wrote:

   Actually I think I have simplified this further. The basic issue seems
   to be referencing anything to do with the datastore from an ordinary
   servlet. So if I have a servlet

   import java.io.IOException;

   import javax.jdo.JDOHelper;
   import javax.jdo.PersistenceManagerFactory;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServlet;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;

   public class UploadFileServlet extends HttpServlet {
         �...@override
          protected void service(HttpServletRequest request,
   HttpServletResponse response) throws ServletException, IOException {
          }

          private static final PersistenceManagerFactory PMF =

    JDOHelper.getPersistenceManagerFactory(transactions-optional);

   }

   and  I send it a request I get the following exception

   WARNING: Nested in javax.servlet.ServletException: init:
   java.lang.NoClassDefFoundError: javax/jdo/JDOHelper
           at
   com.cloudscapesolutions.wavacalculator.server.UploadFileServlet.clinit
   (UploadFileServlet.java:18)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
   Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance
   (NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
   (DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          at java.lang.Class.newInstance0(Class.java:355)
          at java.lang.Class.newInstance(Class.java:308)
          at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)
          at org.mortbay.jetty.servlet.ServletHolder.getServlet
   (ServletHolder.java:339)
          at
   org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
   463)
          at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
   (ServletHandler.java:1093)
          at
   com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
   (TransactionCleanupFilter.java:43)
          at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
   (ServletHandler.java:1084)
          at com.google.appengine.tools.development.StaticFileFilter.doFilter
   (StaticFileFilter.java:121)
          at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
   (ServletHandler.java:1084)
          at org.mortbay.jetty.servlet.ServletHandler.handle
   (ServletHandler.java:360)
          at org.mortbay.jetty.security.SecurityHandler.handle
  

[appengine-java] Re: cron query

2009-09-15 Thread antshpra
no...

On Wed, Sep 16, 2009 at 3:47 AM, bgood ben.mcgee.g...@gmail.com wrote:


 Is it possible to specify the start time for a scheduled task that
 happens at regular intervals?

 For example, if I want something to happen at 12:00, 12:10, 12:20 ...
 (not e.g. 12:03, 12:13, 12:23...)

 ?
 thanks
 


--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Re: cron query

2009-09-15 Thread antshpra
no...

On Wed, Sep 16, 2009 at 3:47 AM, bgood ben.mcgee.g...@gmail.com wrote:


 Is it possible to specify the start time for a scheduled task that
 happens at regular intervals?

 For example, if I want something to happen at 12:00, 12:10, 12:20 ...
 (not e.g. 12:03, 12:13, 12:23...)

 ?
 thanks
 


--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---



[appengine-java] Accessing file from within a jar file

2009-09-15 Thread Sarhan

How do you access a file inside of a jar file in the appengine?

I was able to successfully do it on my local box, but i get a
FileNotFoundException while in the cloud.
--~--~-~--~~~---~--~~
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 google-appengine-java@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~--~~~~--~~--~--~---