|
From: Oliver H. <Oli...@ou...> - 2004-05-12 03:42:09
|
In the event of validation failure couldn't you just rollback the current transaction and start a new one for the rest of the request? Or, even simpler, use Session.evict to make sure that it will never get flushed.=20 > -----Original Message----- > From: Daniel Miller [mailto:mi...@pa...]=20 > Sent: Wednesday, 12 May 2004 1:19 PM > To: spr...@li... > Subject: RE: [Springframework-developer] Pre-binding validation >=20 >=20 > Hi Seth, >=20 > > Please point out my error(s) here if I have made one or many. > > > > One potential solution (inspired by above mentioned post): Create a=20 > > RequestWrapper that can be validated just like the=20 > persistent object=20 > > to which the request will be bound (I realize this could be messy=20 > > because it is essentially reverse reflection aka emulation). Then=20 > > invoke > the > > validator substituting the wrapped request for the actual object=20 > > _before_ binding. >=20 > >Great thinking, Daniel. I've always used a Command/FormBean because > often the web workflow doesn't match up to the domain objects=20 > close enough. But you're right, I wouldn't want any flush()=20 > to happen until after validation. >=20 > >For this scenario to happen, a call to find() or iterate()=20 > would have=20 > >to > be called /on the session for this request/, correct? =20 > Assuming a usual setup of one session for the request, and=20 > the request itself is not multithreaded, how would this=20 > condition arise? >=20 > After validation failure: processFormSubmission() -> showForm() -> > referenceData() which could load objects from the database=20 > using a find() or iterate(). >=20 > Thanks for the quick feedback. > Daniel >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software > Learn developer strategies Cisco, Motorola, Ericsson & Lucent=20 > use to deliver higher performing products faster, at low TCO.=20 > http://www.sleepycat.com/telcomwpreg.php?> From=3Dosdnemail3 >=20 >=20 > _______________________________________________ > Springframework-developer mailing list=20 > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software > Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to=20 > deliver higher performing products faster, at low TCO.=20 > http://www.sleepycat.com/telcomwpreg.php?> From=3Dosdnemail3 >=20 >=20 > _______________________________________________ > Springframework-developer mailing list=20 > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 |