This sounds like just what i need, I was just thinking of putting in EJB because i thought it was the right way to go, but i can see that EJB's are fast becoming the dinosaurs of J2EE. I have just a few questions relating not using EJB's as a service layer. Later on we will want to implement Web Services, my design now has to cater for that. Any suggestions? Also, I've looked at the xPetstore using WW and Hibernate,and i see there is cool transaction handling..as below.. It just seems to me that there's a lot of duplicate code around starting Hibernate Sessions etc, I'm just really wanting to know if the xpetstore is a good place to base a project on, if its optimal enuf. i'd like to use it as the basic format of my new project. Also, usually session EJB would be used for all your business logic etc, where will that go now, without an EJB session/service layer? =========================================================
protected String doExecute( ) throws Exception { Transaction tx = null; Session s = getHibernateSession( ); String customerId = _customer.getUserId( ); try { tx = s.beginTransaction( ); /* Make sure that the user-id is unique */ try { Customer c = ( Customer ) s.load( Customer.class, customerId ); if ( !c.getUserId( ).equalsIgnoreCase( _customer.getUserId( ) ) ) { addError( "customer", getText( "duplicate_account" ) ); return ERROR; } } catch ( ObjectNotFoundException o ) {} /* Make sure that the email is unique */ String oql = "FROM cst IN CLASS " + Customer.class + " WHERE cst.email=?"; Collection col = s.find( oql, _customer.getEmail( ), Hibernate.STRING ); if ( col.size( ) > 0 ) { Customer c = ( Customer ) col.iterator( ).next( ); if ( !c.getUserId( ).equalsIgnoreCase( customerId ) ) { addError( "customer", getText( "duplicate_email" ) ); return ERROR; } } save( _customer, s ); tx.commit( ); return SUCCESS; } catch ( Exception e ) { _log.error( "Unexpected error", e ); if ( tx != null ) { tx.rollback( ); } throw e; } finally { s.close( ); } } -----Original Message----- From: Ben Alex [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 11:51 PM To: [EMAIL PROTECTED] Subject: Re: [OS-webwork] examples examples examples...looked at xpetstore > Im also interested in how the ClientDispatcher works? > Is the ValueStack available on the client side? IE: Can I > call an action on the server via the ClientDispatcher, and > access the resultant in a ValueStack on my Swing client? If > so... COOL!!!! And how the hell do you do that??? I have submitted a WW2 ClientDispatcher into Jira. It also includes a very basic demo SWING application that takes advantage of GUI progress monitoring (eg sending request to remote, remote processing, receiving reply etc). You can get the files here: http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-234 Cheers Ben ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork NOTICE: This message contains privileged and confidential information intended only for the person or entity to which it is addressed. Any review, retransmission, dissemination, copy or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient, is prohibited. If you received this message in error, please notify the sender immediately by e-mail, facsimile or telephone and thereafter delete the material from any computer. The New Africa Capital Group, its subsidiaries or associates do not accept liability for any personal views expressed in this message. ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork