the RF Servlet (check JsonRequestProcessor#getSideEffects() method)
try to get your entity (using your find static method) to determine
the type of WriteOperation to return to the client. It return a DELETE
operation only if it get a null return value.
To have this behavior, you've to handle the Exception thrown by your
data backend when it doesn't find an entity. For example, in my
Message JDO entity, i'm doing this :
public static Message findMessage(Long id) {
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
return pm.getObjectById(Message.class, id);
} catch(RuntimeException e) {
return null;
} finally {
pm.close();
}
}
If you don't catch the exception, a ServerError is returned back to
the client.
Anthony.
On 23 nov, 16:27, poe <stefan.poe...@googlemail.com> wrote:
> I've got the same problem.
>
> I catch an object with the "find" Method through the RequestFactory.
> When I try to remove the object with my remove Method the object send
> to the server is marked with UPDATE as if you've called
> request.edit().using(currentObject) before (which I didn't).
> When I remove the object my "find" Method is called once again after
> the object is deleted (but not by me, that musst be handled by the
> RequestFactory). That's were the "No such Object" error comes from.
>
> Can you confirm that? Does anyone has a solution yet?
>
> On 11 Nov., 02:46, ziggystardust <camke...@gmail.com> wrote:
>
> > Did you ever find an answer to your question? I am having the same
> > problem and have not yet been able to find an answer.
>
> > On Oct 27, 5:28 am, AlexG <alexander.gauss.ax...@googlemail.com>
> > wrote:
>
> > > Hi @ all,
>
> > > I know, that theres an issue, and that this bug is already known.
>
> > > I always get errors, when I try toremovean Entity. I´m using
> > > JDO with theRequestFactory, and I get the following Error:
>
> > > Server Error: No such Object
>
> > > I checked the id and everything, but the Object definitely
> > > exists in my database. I don´t understand, why I get this
> > > Error? I mean persist() works as intended. The querys
> > > also works fine.
>
> > > Does someone know, what I´m doing wrong, or is it a bug?
>
> > > Greets
> > > Alex
>
>
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment