[appengine-java] Re: Object Manager has been closed on 2 synchronous requests

2010-04-08 Thread Arny
Hmm, does it really matter even when using detached objects?
And aren't the persistence managers created individually on each
request?
I didn't know they are shared over many requests?

What's the best way to update about 20 objects synchronously using 20
asynch urlfetches?
It needs to be urlfetches, because the 20 objects are getting updates
from an urlfetch again.

Simple model:
- call 20 urls with individual ids
- each url gets an objects and gets its updates from another url

Any good solution for that?
Thanks

On Apr 8, 3:13 pm, bimbo jones bimbojone...@gmail.com wrote:
 hi,

 you should only close the persistence manager when your done.
 This error occurs because you try to close it a second time.
 Once you do the pm.close() all the data will be updated

 2010/4/8 Arny arny...@googlemail.com

  Hi,

  I'm getting an JDO/Nucleus exception when running 2 synchronous
  requests on different ids of an object:
  org.datanucleus.exceptions.NucleusUserException: Object Manager has
  been closed

  ---
  This is how my getById looks like:

                 PersistenceManager pm = getPM();
                 Stream stream = null;
                 try {
                         Stream tmp = pm.getObjectById(Stream.class, id);
                         stream = pm.detachCopy(tmp);
                 } finally {
                         pm.close(); // here the exception occurs
                 }
                 return stream;

  ---

  It works fine on single request, but fails on 2 or more.
  anyone know how to get around this?

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



-- 
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-j...@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: Object Manager has been closed on 2 synchronous requests

2010-04-08 Thread Arny
I could find my mistake.
Sorry for taking your time.

Thanks anyway!

On Apr 8, 3:24 pm, Arny arny...@googlemail.com wrote:
 Hmm, does it really matter even when using detached objects?
 And aren't the persistence managers created individually on each
 request?
 I didn't know they are shared over many requests?

 What's the best way to update about 20 objects synchronously using 20
 asynch urlfetches?
 It needs to be urlfetches, because the 20 objects are getting updates
 from an urlfetch again.

 Simple model:
 - call 20 urls with individual ids
 - each url gets an objects and gets its updates from another url

 Any good solution for that?
 Thanks

 On Apr 8, 3:13 pm, bimbo jones bimbojone...@gmail.com wrote:

  hi,

  you should only close the persistence manager when your done.
  This error occurs because you try to close it a second time.
  Once you do the pm.close() all the data will be updated

  2010/4/8 Arny arny...@googlemail.com

   Hi,

   I'm getting an JDO/Nucleus exception when running 2 synchronous
   requests on different ids of an object:
   org.datanucleus.exceptions.NucleusUserException: Object Manager has
   been closed

   ---
   This is how my getById looks like:

                  PersistenceManager pm = getPM();
                  Stream stream = null;
                  try {
                          Stream tmp = pm.getObjectById(Stream.class, id);
                          stream = pm.detachCopy(tmp);
                  } finally {
                          pm.close(); // here the exception occurs
                  }
                  return stream;

   ---

   It works fine on single request, but fails on 2 or more.
   anyone know how to get around this?

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



-- 
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-j...@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.