Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4611318
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:15:06+00:00 2026-05-22T01:15:06+00:00

I have a newly coded GWT/GAE app that uses RequestFactory and Editors on the

  • 0

I have a newly coded GWT/GAE app that uses RequestFactory and Editors on the client and a custom Objectify DAO Service on the back.

The flush() then persist() paths work fine on success.
Client side JSR 303 works as well as can be expected too.

My question is how to trigger server warnings/errors and handle UI updates?

I am using Chandler’s Generic DAO for Objectify 2 at
http://turbomanage.wordpress.com/2010/02/09/generic-dao-for-objectify-2/

my gwt activity is calling persist( myProxy ).fire( new Receiver<> )

my dao code is throwing IllegalArgumentException and other RuntimeExceptions for business logic situations like “Duplicate email address found – want to login instead?”

Receiver<>.onSuccess() works fine to track a successful outcome.
neither Receiver<>.onFailure() nor Receiver<>.onViolation() report the RuntimeExceptions.

( Correction: onFailure() is being called for server-side exceptions)

Is there a better way to do this?
What exceptions should the DAO throw such that onViolation() or onFailure() report errors?
How should the editor(s) handle and recover from the exception?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:15:07+00:00Added an answer on May 22, 2026 at 1:15 am

    I’ve found the most versatile command sequence to be

    void start() {
        // Either get p
        context1.get(..).to( new Receiver<P> { onSuccess(P resp){p = resp;} ... }).fire();
        // OR create p
        p = context2.create( P.class );
        // Then save p
        req = context2.persist(p).to( new Receiver<P>{  /* note do not use context1 */
            onViolation(...) { /*JSR 303 handler*/ };
            onFailure( error ) { /* handle */ error.getMessage() }; 
            onSuccess(X x) { /* whatever persist() returns handler */ }; } ); 
        // drive editor with p
        driver.edit( p, req);    
    }
    
    ....
    void onSave() {    
        // editor
        ctxt = driver.flush()  /* note ctxt == context2 */
        if ( driver.hasErrors() ) { /*JSR 303 handler*/};
        // RF
        ctxt.fire();
    }
    

    Based on the conversation excerpt below at http://groups.google.com/group/google-web-toolkit/browse_thread/thread/da863606b3893132/96956661c53e1064?hl=en

    Thomas Broyer
    onFailure should containg the getMessage() of the
    exception you threw on the server
    side.

    You can tweak it by providing your own
    ExceptionHandler to the
    RequestFactoryServlet (extend it and
    use its constructor taking an
    ExceptionHandler).

    onViolation will only be called if
    your entities do not pass JSR-303 Bean
    Validation, which is checked before
    calling any service method.

    If you want to
    “catch” the failure in clidnt code,
    you have to add a Receiver for the
    persist() service method:
    context.persist(p).to(new Receiver…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently been trying to upgrade my app form Rails 2.3.8 to newly-releases
I have a new web app that is packaged as a WAR as part
I found a bunch of scripts in the project I have been newly assigned
Have had to write my first proper multithreaded coded recently, and realised just how
I have a newly created game using Cocos2D on the iPhone. I am at
I have been googling around looking for a advantages that one might gain in
I have a Console App created in VS 2010 targeting .NET 4.0. According to
I have a code that fetches a list from DB. Using that returned array
I am referring specifically to windows 7. I have code that associates a certain
I have my own derived WPF DataVisualization chart control and within that control, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.