sir Plz tell me. how to be work with tomcat with Google app engine. thanks On 30 November 2010 21:16, Matthew Adams <[email protected]> wrote:
> I would recommend setting javax.jdo.option.RetainValues=true if you're > only going to read the values (for example, during rendering in the > view after the controller has committed (or caused to be committed) > the transaction. > > Using any of the detachCopy*(..) methods will be a performance hit, > because copies of objects are made. Using DetachAllOnCommit might be > better, as the objects are supposed to transition to detached in place > with no copying. > > Using any of the makeTransient*(..) methods would work, too, but they > might lose their identity values, which are often important to keep > around. > > Setting javax.jdo.option.NontransactionalRead=true could have > performance and correctness implications. Most operations will > require their own connection, and once an object is in the > PersistenceManager's cache, it won't necessarily be transactionally > consistent. > > HTH, > Matthew > > On Nov 28, 5:25 pm, tamsler <[email protected]> wrote: > > I am trying to get a collection of objects that are stored in the > > database using JDO. Once the objects have been retrieved, they are > > marshaled into JSON and sent to the client. > > > > I need some help in deciding which of the following two approaches is > > the better one: > > > > Approach 1: > > // Using detachCopy(...) > > public List<Employee> getEmployee(User user) { > > > > PersistenceManager pm = PMF.get().getPersistenceManager(); > > List<Employee> employees, detached = null; > > Query query = pm.newQuery(Employee.class); > > > > try { > > employees = (List<Employee>)query.execute(); > > detached = pm.detachCopyAll(employees); > > > > } finally { > > pm.close(); > > } > > return detached; > > } > > > > Approach 2: > > > > // Using Transaction with setDetachAllOnCommit(true) > > > > public List<Employee> getEmployee(User user) { > > > > PersistenceManager pm = PMF.get().getPersistenceManager(); > > pm.setDetachAllOnCommit(true); > > Transaction tx = persistenceManager.currentTransaction(); p.p1 {margin: > > 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} > > Query query = pm.newQuery(Employee.class); > > > > List<Employee> employees = null; > > > > try { > > tx.begin(); > > > > employees = (List<Employee>)query.execute(); tx.commit); > > > > } finally { > > pm.close(); > > } > > return employees; > > } > > > > Any help/advise is greatly appreciated. > > > > -- Thomas > > -- > 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 > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- Amrendra Kumar Tripathi New Delhi-92 9873075473 -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
