I see. I'm not a JPA expert, but isn't there a way to disable the
auto-flush capability like

queryObject.setFlushMode(FlushModeType.COMMIT);

/dmc

On Thu, Feb 24, 2011 at 12:29 PM, Tim <tim.muri...@gmail.com> wrote:
>
> On Feb 24, 11:18 am, David Chandler <drfibona...@google.com> wrote:
> > Hi Tim,
> >
> > It seems like you would want to do the following within the same
> > RequestFactory service method (and probably the same JPA transaction, as
> > well):
> >
> > Persist the new Phone entity
> > Persist the new Person entity
> >
> > Is that possible?
>
> That's exactly what I want to do. Here's my (pseudo) service method
> code:
>
> @SecurityRequired
> public void persist(String sessionId, Person person) {
>    performPersist(person);
> }
>
> performPersist() is a method that will guarantee
> EntityManager.persist()ing the Phone before EntityManager.merge()ing
> the Person (it uses reflection to iterate over the members of Person
> handling any sub-entities it may find).
>
> @SecurityRequired will use the sessionId string to determine whether
> the user making this request has permission to access the person. It
> does this via a EntityManager.createNamedQuery(), this causes the
> trouble. I never get a chance to execute performPersist().
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



--
David Chandler
Developer Programs Engineer, Google Web Toolkit
w: http://code.google.com/
b: http://googlewebtoolkit.blogspot.com/
t: @googledevtools

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to