Can JPA do batch update | put | write | insert as pm.makePersistentAll() does in GAE/J

Posted by Kenyth on Stack Overflow See other posts from Stack Overflow or by Kenyth
Published on 2010-06-14T09:17:36Z Indexed on 2010/06/14 9:22 UTC
Read the original article Hit count: 130

Filed under:
|
|
|
|

I searched through multiple discussions here. Can someone just give me a quick and direct answer?

And if with JPA you can't do a batch update, what if I don't use transaction, and just use the following flow:

em = emf.getEntityManager
// do some query
// make some data modification
em.persist(..)
// do some query
// make some data modification
em.persist(..)
// do some query
// make some data modification
em.persist(..)
...
em.close()

How does this compare to batch update with regard to performance, and compare to a single transaction commit, measured by RPC calls to datastore server, CPU cycles per request, or so. Does every call to em.persist(..) before em.close() trigger a RPC call to the datastore server?

Thanks very much for any response!

© Stack Overflow or respective owner

Related posts about java

Related posts about google-app-engine