Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
NucleusUserException: Object Manager has been closed
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
tha  
View profile  
 More options Apr 13 2009, 10:01 am
From: tha <hathanht...@gmail.com>
Date: Mon, 13 Apr 2009 07:01:17 -0700 (PDT)
Local: Mon, Apr 13 2009 10:01 am
Subject: NucleusUserException: Object Manager has been closed
Hi all,

Today I got this error "NucleusUserException: Object Manager has been
closed" in my Spring application. Basically, my application loads some
objects in DAO classes, close the transaction (using Spring declared
transactions)  and returns the result to View layer. But when I access
the objects' properties, I got the error. After looking at the
GetFlights.java file (helloorm demo, GAE SDK), I see that the size()
method must be called before closing the transaction. So I changed my
DAO method to:

public List<T> findAll() {
        List<T> results = entityManager.createQuery("select o from "
                        + getPersistentClass().getName() + " o").getResultList();
        results.size(); // In JPA apps, we don't need this call!!
        return results;

}

It is working now. But I don't like the idea to call the size()
method. In theory, a JPA application must work with any JPA-compliant
provider. And a JPA application doesn't call size() method just to
load the results from query. So I believe that (DataNucleaus +
appengine plugin) is not a JPA-compliant provider. Please correct me
if I'm wrong.

Thai


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
datanucleus  
View profile  
 More options Apr 13 2009, 10:27 am
From: datanucleus <andy_jeffer...@yahoo.com>
Date: Mon, 13 Apr 2009 07:27:24 -0700 (PDT)
Local: Mon, Apr 13 2009 10:27 am
Subject: Re: NucleusUserException: Object Manager has been closed
Why not raise a bug on http://code.google.com/p/datanucleus-appengine/
since DataNucleus itself provides mechanisms for reading in of query
results when a transaction commits. It's likely just not yet
implemented in the plugin yet

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tha  
View profile  
 More options Apr 13 2009, 11:46 am
From: tha <hathanht...@gmail.com>
Date: Mon, 13 Apr 2009 08:46:05 -0700 (PDT)
Local: Mon, Apr 13 2009 11:46 am
Subject: Re: NucleusUserException: Object Manager has been closed
Submitted a ticket at http://code.google.com/p/datanucleus-appengine/issues/detail?id=24

On Apr 13, 9:27 pm, datanucleus <andy_jeffer...@yahoo.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pyko  
View profile  
 More options Apr 17 2009, 9:29 pm
From: pyko <psychop...@gmail.com>
Date: Fri, 17 Apr 2009 18:29:56 -0700 (PDT)
Local: Fri, Apr 17 2009 9:29 pm
Subject: Re: NucleusUserException: Object Manager has been closed
I am also having problems with getResultList() giving
NucleusUserException error. I've tried calling size() as suggested
here, but it doesn't seem to work. Like tha I'm using Spring as well.

public List<Product> getAllProducts() {
        String query = "select description, price from
springapp.domain.Product";
        List<Product> allProducts = (List<Product>)
entityManager.createQuery(query).getResultList(); // debug: Method
threw 'org.datanucleus.exceptions.NucleusUserException' exception.
        allProducts.size(); // debug:
org.datanucleus.exceptions.NucleusUserException: Object Manager has
been closed
        return allProducts;
    }

At first I thought maybe I haven't set up my entityManager etc
properly (new to Spring) however, finding a product by Id works...so
I'm not quite sure what is happening.

    public Product getProductWithId(int id) {
        Product product = entityManager.find(Product.class, id);
        return product;
    }

Any help will be great. Thanks!

On Apr 14, 1:46 am, tha <hathanht...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tha  
View profile  
 More options Apr 22 2009, 1:26 am
From: tha <hathanht...@gmail.com>
Date: Tue, 21 Apr 2009 22:26:09 -0700 (PDT)
Local: Wed, Apr 22 2009 1:26 am
Subject: Re: NucleusUserException: Object Manager has been closed
I put together a simple application here http://jira.codehaus.org/browse/MGAE-1
I don't see any similar problem when I test it.

On Apr 18, 8:29 am, pyko <psychop...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arjan  
View profile  
 More options Apr 22 2009, 4:37 am
From: Arjan <huij...@gmail.com>
Date: Wed, 22 Apr 2009 01:37:48 -0700 (PDT)
Local: Wed, Apr 22 2009 4:37 am
Subject: Re: NucleusUserException: Object Manager has been closed
I use Spring MVC and they have included a filter that keeps the
persistence manager open in the view. It is defined in web.xml:

<filter>
        <filter-name>OpenPersistenceManagerInView</filter-name>
        <filter-
class>org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilte r</
filter-class>
</filter>

I don't know how to do this without Spring MVC, but it might give you
a clue.

Good luck!

Arjan Huijzer

On Apr 22, 7:26 am, tha <hathanht...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
charpentier damien  
View profile  
 More options Apr 26 2009, 1:45 pm
From: charpentier damien <damien.charpent...@gmail.com>
Date: Sun, 26 Apr 2009 10:45:21 -0700 (PDT)
Local: Sun, Apr 26 2009 1:45 pm
Subject: Re: NucleusUserException: Object Manager has been closed
Hi,

Exact same problem here without spring.

It's solved with your "trick", so this is a bug ?

Regards.

On 13 avr, 16:01, tha <hathanht...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arjan  
View profile  
 More options Apr 26 2009, 4:15 pm
From: Arjan <huij...@gmail.com>
Date: Sun, 26 Apr 2009 13:15:15 -0700 (PDT)
Local: Sun, Apr 26 2009 4:15 pm
Subject: Re: NucleusUserException: Object Manager has been closed
I don't think this is a bug; it's just designed this way. Very often
it makes sense to close the connection (or object manager)  with the
underlying data source (be it Googles datasore or a relational
database) after retrieving the results. However, the combination of a
web application and lazy loading (only retrieving data when you
actually need it) creates this problem and therefor we need some
mechanism to keep the connection open. Thus the
OpenPersistenceManagerInViewFilter.

Gr. Arjan

On Apr 26, 7:45 pm, charpentier damien <damien.charpent...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »