-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Concept ? Spring SessionInView vs form validation control
PostPosted: Thu Jul 28, 2005 6:08 pm 
Regular
Regular

Joined: Thu May 26, 2005 12:20 am
Posts: 72
I understand that things are working "correctly", but I am looking for ideas or links to ideas for how to make this work the way i need it to.

I am using Spring's SessionInViewInterceptor with flushMode set to FLUSH_AUTO. This means that anything live hibernate object that changes gets persisted automagically, and its easy for development. Trade off is obviously less control. Less control is fine because we have no business transactions that need commit/rollback.

EXCEPT, for form validation. Using Spring BIND tags, the Spring framework creates a Command object from the the form post which is one of my hibernate classes. This is great for create/edit/save, BUT when I need to do custom DB validation (i.e. checking for duplicate emails), doing that DB check turns my POJO into a hibernate object and it gets persisted even if the validation fails.

Again, I know this is correct, but are there any ideas for how to keep the simple SIVInterceptor pattern, but allow for checking data in the DB for an object before persisting? Evicting the object first maybe? Creating a separate Session? (No) Thoughts?

Thanks for any ideas... =)

Hibernate version: 3.0.3

Spring version: 1.2


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:37 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This is not a Spring forum.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:41 pm 
Regular
Regular

Joined: Thu May 26, 2005 12:20 am
Posts: 72
Because I was thinking that evicting objects might be a way to handle it, and since many Hibernate users probably use this pattern successfully, I was posting here. Please feel free to ignore my post, and I will post to Spring Forums also.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.