google app engine - grails with JDO - how do I work with persistenceManager correctly -


I am making an application with a Google application engine and grails to call for my Flex application. The controller has a service call to get the controller back to the list and send it back to Flex.

Flex Client is able to retrieve data once back. Also, if I call an action in the browser, I can make an action call and get the data back. The problem is that I'm feeling that this is not able to make more calls than this once, because the application is using JDO and after the first call I'm saying that persistenceManager gets an error turned off.

I have some posts that show you how to set a single tone and if you need it, you get an example of the sustainability manager, but this does not seem to work either .

This is my first time working with JDO. I can use some of these services to work on a stable basis.

Here is the code of service In fact the datastore is interrogating

  package com.dlish.fulcrum import com.dlish.fulcrum.PMF import org.springframework.beans.factory.InitializingBean import com.google.appengine.api .datastore * Import com.dlish .fulcrum.show class VenueBlastService {static behavior = def grailsApplication def def persistenceManager def getAllShows zero afterPropertiesSet {this.setting = grailsApplication.config.setting} setting {true} {def = persistenceManager.newQuery (show) Def showInstanceList = query query .execute () returned showInstanceList}}  

grails app engine plugin Creates persistenceManager requests in Scope Object by default, services are Sington, which means that instead of requesting them one The bar is made. Thus, if you give your service a persistenceManager example variable, the first request will be a valid persistenceManager, but later all calls will be a closed persistenceManager, because your service is still referencing the request manager beforehand.

There are two ways to correct this:

1) Change the scope of your service You can do your service by putting the following in the class:

    from your controller for a static scope = "request"  

2)

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -