Check if "EntityManager.createNamedQuery" associated with @SecurityRequired
don't flush the entityManager and cause problems.

Juan

2011/2/24 Tim <[email protected]>

> On Feb 24, 11:18 am, David Chandler <[email protected]> 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 [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-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" 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-web-toolkit?hl=en.

Reply via email to