-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate 3 - spring - JSF ->synchronization
PostPosted: Thu May 25, 2006 6:09 am 
Newbie

Joined: Sun Apr 24, 2005 4:34 pm
Posts: 5
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.3

Hi, I have a question of principle about hibernate. Currently i do some tests with JSF/Spring/Hibernate The JSF use a Bean which use a Spring object (service) which is using an hibernate object mapping (POJO). If i do like that, in fact i play with hibernate model object at the JSF Bean level -> i have some problems (when i update the values at the JSF level -> i update the value in the Bean ... BUT when i save the data, the data to be saved is sometime the new value but also some time the old value !!!!! - it is like first i update the value to save but at the time of saving, the new updated value is replaced by the old one from the db).

The problem disappears if i use a Transfert Object (Value Object - TO) which is exactly the same as my hibernate POJO. I map one for one. So now, i have MyTo myTo = new MyTo(myHibernatePojo); and i work with that TO object.

My question is : Do i have to work like that or did i miss something somewhere ?

Another question is: Do i have to create the TO in the DAOImpl or do i have to create it in the BO (Business Object) ?

Thanks and sorry for my poor english


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 27, 2006 4:19 am 
Beginner
Beginner

Joined: Sat Dec 17, 2005 1:24 pm
Posts: 42
Location: Berlin, Germany
Hi!

I believe, you are running into multiple problems related to database access in web applications. Usually one database transactions starts at the beginning of the web requests and ends at its end. When you get a new request (a new page or a form-submission), you open a new transaction. The database objects you may have stored in the HTTP-session are now somewhat stale (they may or may not have been changed between the two requests).

I believe, you may want to do some more research into the architecture of web applications. Have a look at some example applications (pet shop) and/or check the framework's documentation. While I am a spring/hibernate user, for a new project, I would at least evaluate some other frameworks for my problem domain.

If you have some concrete questions, don't hesitate to ask.

All the best,

René


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.